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-25 21:16:54
|
Revision: 8460 http://gridarta.svn.sourceforge.net/gridarta/?rev=8460&view=rev Author: akirschbaum Date: 2010-06-25 21:16:48 +0000 (Fri, 25 Jun 2010) Log Message: ----------- Fix typos. Modified Paths: -------------- trunk/crossfire/resource/resource/conf/types.xml trunk/gridarta.ipr Modified: trunk/crossfire/resource/resource/conf/types.xml =================================================================== --- trunk/crossfire/resource/resource/conf/types.xml 2010-06-25 21:05:08 UTC (rev 8459) +++ trunk/crossfire/resource/resource/conf/types.xml 2010-06-25 21:16:48 UTC (rev 8460) @@ -353,7 +353,7 @@ <ignorelists> - <!-- This ignorelist is for all system objects which are non pickable + <!-- This ignore list is for all system objects which are non pickable and invisible. They don't interact with players at all. --> <ignore_list name="system_object"> <attribute arch="value"/> @@ -370,7 +370,7 @@ <attribute arch="invisible"/> </ignore_list> - <!-- This ignorelist is for non-pickable objects. They can be seen by + <!-- This ignore list is for non-pickable objects. They can be seen by the player, but don't have values like material or weight. --> <ignore_list name="non_pickable"> <attribute arch="value"/> @@ -384,7 +384,7 @@ <attribute arch="identified"/> </ignore_list> - <!-- This ignorelist is for event objects. --> + <!-- This ignore list is for event objects. --> <ignore_list name="event_object"> <attribute arch="name"/> <attribute arch="face"/> @@ -553,7 +553,7 @@ the name of an object. Yet, titles are not recognized by altars. Remember to put a note somewhere, telling the player what he is expected to drop on the altar. (Often this is put in the altar's - name: E.g. "drop 100 platinums") + name: E.g. "drop 100 platinum coins") </attribute> <attribute arch="food" editor="drop amount" type="int" min="1" max="32767"> The drop amount specifies the amount of items (specified in <match @@ -610,7 +610,7 @@ the name of an object. Yet, titles are not recognized by altars. Remember to put a note somewhere, telling the player what he is expected to drop on the altar. (Often this is put in the altar's - name: E.g. "drop 100 platinums") + name: E.g. "drop 100 platinum coins") </attribute> <attribute arch="food" editor="drop amount" type="int" min="1" max="32767"> The drop amount specifies the amount of items (specified in <match @@ -673,7 +673,7 @@ <attribute arch="wc" editor="weapon class" type="int" min="-128" max="127"> The <weapon class> value adds to the overall weapon class of the wielder's melee attacks. Weapon class improves the chance of - hitting the opponent. Weapon class is the "counterpiece" of <armor + hitting the opponent. Weapon class is the "counter piece" of <armor class>. It should usually be set only for weapon-like items. Lower values are better. </attribute> @@ -1270,7 +1270,7 @@ "arrows" and "keys". Unfortunately it is not easy to create new container classes, - because items need a matching counterpiece-attribute to the <container + because items need a matching counter piece attribute to the <container class> before they can be put inside a container. This attribute ("race") is set only for the existing container classes. </attribute> @@ -1345,7 +1345,7 @@ VERY IMPORTANT: Be careful with the exchange-ratio! When you drop items on a converter, the stuff you get must be of equal or lesser value than before! (Except if you are using "rare" items like - dragonscales for payment). The code will not check if your ratio is + dragon scales for payment). The code will not check if your ratio is sane, so the player could gain infinite wealth by using your converter. ]]> </use> <attribute arch="no_pick" value="1" type="fixed"/> @@ -1686,7 +1686,7 @@ </attribute> <attribute arch="ac" editor="armor class" type="int"> Doors of high <armor class> are less likely to get hit. <armor - class> can be considered the "counterpiece" to <weapon class>. + class> can be considered the "counter piece" to <weapon class>. </attribute> <attribute arch="other_arch" editor="drop arch" type="string"> This string defines the object that will be created when the door @@ -1823,7 +1823,7 @@ If set, this message will be displayed to the player when he applies the exit. This is quite useful to throw in some "role-play feeling": "As you enter the dark cave you hear the sound of rustling - dragonscales...". Well, my English is poor, but you get the point. + dragon scales...". Well, my English is poor, but you get the point. =) </attribute> <attribute arch="unique" editor="unique destination" type="bool"> @@ -1865,9 +1865,9 @@ in that special piece of weapon or armor, so don't let the dragon-fellows miss out on the reward completely. ]]> </use> - <attribute arch="food" editor="foodpoints" type="int" min="0" max="32767"> - The player's stomach will get filled with this amount of foodpoints. - The player's health will increase by <foodpoints>/50 hp. + <attribute arch="food" editor="food points" type="int" min="0" max="32767"> + The player's stomach will get filled with this amount of food points. + The player's health will increase by <food points>/50 hp. </attribute> <attribute arch="level" editor="flesh level" type="int" min="-32768" max="32767" check_min="1" check_max="115"> The <flesh level> is not visible to the players and it affects @@ -2137,9 +2137,9 @@ By eating/drinking food-objects, the player can fill his stomach and gain a little health. ]]> </description> - <attribute arch="food" editor="foodpoints" type="int" min="0" max="32767"> - The player's stomach will get filled with this amount of foodpoints. - The player's health will increase by <foodpoints>/50 hp. + <attribute arch="food" editor="food points" type="int" min="0" max="32767"> + The player's stomach will get filled with this amount of food points. + The player's health will increase by <food points>/50 hp. </attribute> <attribute arch="startequip" editor="godgiven item" type="bool"> A godgiven item vanishes as soon as the player drops it to the @@ -2502,7 +2502,7 @@ <description><![CDATA[ Inorganic materials are generally used as ingredients for alchemical recipes. By themselves, they have no special - functionalities. ]]> + functionality. ]]> </description> <attribute arch="is_dust" editor="is dust" type="bool"></attribute> <section name="resistance"> @@ -2836,7 +2836,7 @@ <attribute arch="ac" editor="armor class" type="int"> A magic wall of high <armor class> is less likely to get hit from an opponent. <armor class> can be considered the - "counterpiece" to <weapon class>. + "counter piece" to <weapon class>. </attribute> </section> <section name="resistance"> @@ -3032,7 +3032,7 @@ make sure that the <experience> is set to a reasonable value. Compare with existing arches to get a feeling what reasonable means. Keep in mind that spellcasting monsters are a lot harder to kill - than non-spellcasters! + than non spell casters! </attribute> <attribute arch="speed" editor="speed" type="float"> The <speed> determines how fast a monster will both move and @@ -3112,7 +3112,7 @@ <attribute arch="wc" editor="weapon class" type="int" min="-128" max="127"> Monsters of high <weapon class> are more likely to really hit their opponent. <weapon class> can be considered the - "counterpiece" to <armor class>. + "counter piece" to <armor class>. </attribute> <attribute arch="hp" editor="health points" type="int" min="0" max="32767"> The <health points> of a monster define how long it takes @@ -3130,7 +3130,7 @@ <attribute arch="ac" editor="armor class" type="int"> Monsters of low <armor class> are less likely to get hit from their opponent. <armor class> can be considered the - "counterpiece" to <weapon class>. Values typically range + "counter piece" to <weapon class>. Values typically range between +20 (very bad) to -20 (quite good). </attribute> <attribute arch="Con" editor="healing rate" type="int" min="0" max="127"> @@ -3296,7 +3296,7 @@ Being <asleep>, a monster won't move unless a player enters the <sensing range> of the monster. Usually the sensing range is larger than the players line of sight. Due to - that, in most cases the player won't ever notice weither a + that, in most cases the player won't ever notice whether a monster was asleep or not. </attribute> <attribute arch="will_apply" editor="misc. actions" type="bitmask_will_apply"> @@ -4466,7 +4466,7 @@ <attribute arch="invisible" value="1" type="fixed"/> <attribute arch="no_drop" value="1" type="fixed"/> <attribute arch="skill" editor="skill name" type="string"> - The <skill name> is used for matchings. When a usable object + The <skill name> is used for matching. When a usable object has an identical <skill name>, players (or monsters) will need this skill to apply/use the object. </attribute> @@ -4886,7 +4886,7 @@ <type number="2" name="Transport"> <description><![CDATA[ A transport is an object that helps the player move. It should not be confused - an EXIT, which instaneously transport a player from one map to another. + an EXIT, which instantaneously transport a player from one map to another. <br><br> Instead, a transport may let the player move faster, give him move types they don't have, etc. A simple example of this would a horse. It doesn't @@ -5025,7 +5025,7 @@ <description><![CDATA[ Trapdoors are very similar to pits. The difference is that they can not be closed. Instead, the weight of the object on the - trapdoor determines weither it slams the trapdoor open and falls through + trapdoor determines whether it slams the trapdoor open and falls through or not.<br> Once a trapdoor has been opened (by a creature or items of sufficient weight,) it remains open, acting like an opened pit. ]]> @@ -5186,7 +5186,7 @@ <attribute arch="move_block" editor="blocked movement" type="bitmask_movement"> If set, the object cannot be passed by players nor monsters. </attribute> - <attribute arch="can_roll" editor="moveable" type="bool"> + <attribute arch="can_roll" editor="movable" type="bool"> If set, the object is able to "roll", so it can be pushed around. This setting is used for boulders and barrels. </attribute> @@ -5209,7 +5209,7 @@ charging, but usually that isn't worth the cost. ]]> </description> <use><![CDATA[ - Wands are quite seldomly used. The reason probably is that they're + Wands are quite rarely used. The reason probably is that they're generally not cost-efficient. Handing out high-level wands with powerful special spells isn't a good idea either, because of the recharge ability. @@ -5301,7 +5301,7 @@ </attribute> <attribute arch="ac" editor="armor class" type="int"> Weak walls of high <armor class> are less likely to get hit. - <armor class> can be considered the "counterpiece" to <weapon + <armor class> can be considered the "counter piece" to <weapon class>. </attribute> <section name="resistance"> Modified: trunk/gridarta.ipr =================================================================== --- trunk/gridarta.ipr 2010-06-25 21:05:08 UTC (rev 8459) +++ trunk/gridarta.ipr 2010-06-25 21:16:48 UTC (rev 8460) @@ -1125,6 +1125,7 @@ <dictionary name="ank"> <words> <w>accel</w> + <w>adamantite</w> <w>agentlib</w> <w>angelion</w> <w>animname</w> @@ -1141,6 +1142,7 @@ <w>autojoin</w> <w>autojoining</w> <w>backbuffer</w> + <w>balrogs</w> <w>baseobject</w> <w>batchpng</w> <w>beanshell</w> @@ -1172,12 +1174,14 @@ <w>cvsroot</w> <w>daimonin</w> <w>daimonin's</w> + <w>damnations</w> <w>debian</w> <w>dedit</w> <w>derivates</w> <w>dest</w> <w>djava</w> <w>doctype</w> + <w>dragonmen</w> <w>encodings</w> <w>endlore</w> <w>endmsg</w> @@ -1191,6 +1195,7 @@ <w>filenames</w> <w>filter<?, ?></w> <w>finalizer</w> + <w>fireborns</w> <w>fixme</w> <w>focusability</w> <w>formatter</w> @@ -1202,12 +1207,14 @@ <w>getenv</w> <w>glibc</w> <w>gnomovision</w> + <w>godgiven</w> <w>goto</w> <w>gridarta</w> <w>gridarta's</w> <w>gridder</w> <w>gridzilla</w> <w>guildmaster</w> + <w>hitpoints</w> <w>hotkey</w> <w>hprof</w> <w>https</w> @@ -1239,6 +1246,7 @@ <w>mapcontrol</w> <w>matchers</w> <w>megaxslt</w> + <w>mergeable</w> <w>metalforge</w> <w>microsystems</w> <w>missorted</w> @@ -1246,13 +1254,16 @@ <w>monospaced</w> <w>mpart</w> <w>multi</w> + <w>natively</w> <w>nesw</w> <w>nmtoken</w> <w>nodeps</w> <w>nogui</w> <w>nokleberg</w> + <w>nuernberg</w> <w>ohloh</w> <w>online</w> + <w>orcs</w> <w>outfile</w> <w>oversized</w> <w>overstrike</w> @@ -1277,10 +1288,12 @@ <w>resize</w> <w>resized</w> <w>resizes</w> + <w>respawn</w> <w>rethrown</w> <w>revertable</w> <w>revivable</w> <w>riedquat</w> + <w>roleplay</w> <w>rsync</w> <w>scansize</w> <w>screenshot</w> @@ -1301,13 +1314,19 @@ <w>solaris</w> <w>sourceforge</w> <w>spawnpoint</w> + <w>spellbook's</w> + <w>spellcraft</w> + <w>spellpath</w> + <w>spellpaths</w> <w>startup</w> + <w>staves</w> <w>stdtxt</w> <w>stoneglow</w> <w>strncmp</w> <w>sublicense</w> <w>sweeped</w> <w>switchcheck</w> + <w>teleported</w> <w>teleporter</w> <w>teleporters</w> <w>textfield</w> @@ -1330,6 +1349,7 @@ <w>tönnies</w> <w>unapplied</w> <w>unconstructable</w> + <w>uncursed</w> <w>undoable</w> <w>unexperienced</w> <w>unislash</w> @@ -1337,6 +1357,7 @@ <w>unregistering</w> <w>unsets</w> <w>unsynchronized</w> + <w>unwielded</w> <w>validator's</w> <w>validator...</w> <w>variable's</w> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-25 21:05:14
|
Revision: 8459 http://gridarta.svn.sourceforge.net/gridarta/?rev=8459&view=rev Author: akirschbaum Date: 2010-06-25 21:05:08 +0000 (Fri, 25 Jun 2010) Log Message: ----------- Simplify tags. Modified Paths: -------------- trunk/src/doc/faq2txt.xslt Modified: trunk/src/doc/faq2txt.xslt =================================================================== --- trunk/src/doc/faq2txt.xslt 2010-06-25 19:35:24 UTC (rev 8458) +++ trunk/src/doc/faq2txt.xslt 2010-06-25 21:05:08 UTC (rev 8459) @@ -42,14 +42,14 @@ <xsl:text>
</xsl:text> </xsl:if> <xsl:if test="starts-with(., ' ')"> - <xsl:text></xsl:text> + <xsl:text/> </xsl:if> <xsl:value-of select="normalize-space(.)"/> <xsl:if test="ends-with(., '
')"> <xsl:text>
</xsl:text> </xsl:if> <xsl:if test="ends-with(., ' ')"> - <xsl:text></xsl:text> + <xsl:text/> </xsl:if> </xsl:template> </xsl:transform> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-25 19:35:31
|
Revision: 8458 http://gridarta.svn.sourceforge.net/gridarta/?rev=8458&view=rev Author: akirschbaum Date: 2010-06-25 19:35:24 +0000 (Fri, 25 Jun 2010) Log Message: ----------- Implement #3018414 (Improved archetype list). Now monster archetypes display "level X" (or "level X*" for generators). Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/resource/resource/conf/types.xml Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-06-25 19:34:30 UTC (rev 8457) +++ trunk/crossfire/ChangeLog 2010-06-25 19:35:24 UTC (rev 8458) @@ -1,5 +1,8 @@ 2010-06-25 Andreas Kirschbaum + * Implement #3018414 (Improved archetype list). Now monster + archetypes display "level X" (or "level X*" for generators). + * Implement #3018432 (Display archetype titles): Include "title" attribute when showing game object or archetype names. Modified: trunk/crossfire/resource/resource/conf/types.xml =================================================================== --- trunk/crossfire/resource/resource/conf/types.xml 2010-06-25 19:34:30 UTC (rev 8457) +++ trunk/crossfire/resource/resource/conf/types.xml 2010-06-25 19:35:24 UTC (rev 8458) @@ -2948,7 +2948,7 @@ </type> <!--####################################################################--> - <type number="0" name="Monster & NPC"> + <type number="0" name="Monster & NPC" display="level ${level}${generator?*:}"> <required> <attribute arch="is_floor" value="0"/> <attribute arch="alive" value="1"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-25 19:34:37
|
Revision: 8457 http://gridarta.svn.sourceforge.net/gridarta/?rev=8457&view=rev Author: akirschbaum Date: 2010-06-25 19:34:30 +0000 (Fri, 25 Jun 2010) Log Message: ----------- Add support needed for #3018414. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeType.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeParser.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java trunk/resource/system/dtd/types.dtd trunk/src/app/net/sf/gridarta/gui/findarchetypes/TableModel.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ArchTab.java trunk/src/app/net/sf/gridarta/gui/objectchoicedisplay/ObjectChoiceDisplay.java Added Paths: ----------- trunk/model/src/test/net/sf/gridarta/model/archetypetype/ArchetypeTypeTest.java Modified: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeType.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeType.java 2010-06-25 18:05:24 UTC (rev 8456) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeType.java 2010-06-25 19:34:30 UTC (rev 8457) @@ -52,6 +52,12 @@ private final int typeNo; /** + * Additional description text. + */ + @NotNull + private final String display; + + /** * The description. */ @Nullable @@ -88,15 +94,17 @@ * Creates a new instance. * @param typeName the type name (artificial) * @param typeNo the type number + * @param display additional description text * @param description the description * @param use the usage notes * @param sectionNum the number of attribute sections * @param archetypeAttributes the list of archetype attributes * @param typeAttributes the list of additional attributes */ - public ArchetypeType(@NotNull final String typeName, final int typeNo, @Nullable final String description, @Nullable final String use, final int sectionNum, @NotNull final ArchetypeAttributes archetypeAttributes, @NotNull final ArchetypeAttributesDefinition typeAttributes) { + public ArchetypeType(@NotNull final String typeName, final int typeNo, @NotNull final String display, @Nullable final String description, @Nullable final String use, final int sectionNum, @NotNull final ArchetypeAttributes archetypeAttributes, @NotNull final ArchetypeAttributesDefinition typeAttributes) { this.typeName = typeName; this.typeNo = typeNo; + this.display = display; this.description = description; this.use = use; this.sectionNum = sectionNum; @@ -240,4 +248,58 @@ } } + /** + * Returns a description of this type. + * @param baseObject the base object to describe + * @return the description + */ + @NotNull + public String getDisplayName(@NotNull final BaseObject<?, ?, ?, ?> baseObject) { + final StringBuilder sb = new StringBuilder(); + sb.append(typeName); + sb.append(" ("); + sb.append(typeNo); + sb.append(')'); + + if (display.length() > 0) { + sb.append(" ["); + int start = 0; + while (start < display.length()) { + final int end = display.indexOf("${", start); + if (end == -1) { + break; + } + + final int end2 = display.indexOf('}', end + 2); + if (end2 == -1) { + // ignore syntax error + break; + } + + sb.append(display.substring(start, end)); + final String spec = display.substring(end + 2, end2); + final int question = spec.indexOf('?'); + final String value; + if (question == -1) { + value = baseObject.getAttributeString(spec); + } else { + final int colon = spec.indexOf(':', question + 1); + final String attributeValue = baseObject.getAttributeString(spec.substring(0, question)); + final boolean attributeExists = attributeValue.length() != 0 && !attributeValue.equals("0"); + if (attributeExists) { + value = spec.substring(question + 1, colon == -1 ? spec.length(): colon); + } else { + value = colon == -1 ? "" : spec.substring(colon + 1); + } + } + sb.append(value); + start = end2 + 1; + } + sb.append(display.substring(start)); + sb.append(']'); + } + + return sb.toString(); + } + } // class ArchetypeType Modified: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeParser.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeParser.java 2010-06-25 18:05:24 UTC (rev 8456) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeParser.java 2010-06-25 19:34:30 UTC (rev 8457) @@ -148,6 +148,7 @@ public ArchetypeType loadAttributeList(@NotNull final Element typeElement, @NotNull final ErrorViewCollector errorViewCollector, @Nullable final ArchetypeType archetypeType, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final IgnorelistsDefinition ignorelistsDefinition, final boolean isDefaultType) { final String typeName = parseTypeName(typeElement, isDefaultType); final int typeNo = parseTypeNo(typeElement, isDefaultType, typeName, errorViewCollector); + final String display = typeElement.getAttribute(ArchetypeTypeSetParser.XML_TYPE_DISPLAY); final Collection<String> ignoreTable = new HashSet<String>(); final ArchetypeAttributesDefinition typeAttributes = isDefaultType ? new ArchetypeAttributesDefinition() : parseTypeAttributes(typeElement, typeName, errorViewCollector, ignoreTable, ignorelistsDefinition); @@ -180,7 +181,7 @@ } attributes.setSectionNames(sectionNames); - return new ArchetypeType(typeName, typeNo, parseDescription(typeElement), parseUse(typeElement), sectionNames.getSectionNames(), attributes, typeAttributes); + return new ArchetypeType(typeName, typeNo, display, parseDescription(typeElement), parseUse(typeElement), sectionNames.getSectionNames(), attributes, typeAttributes); } /** Modified: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java 2010-06-25 18:05:24 UTC (rev 8456) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java 2010-06-25 19:34:30 UTC (rev 8457) @@ -219,6 +219,15 @@ } /** + * Returns a description of this type. + * @param baseObject the base object to describe + * @return the description + */ + @NotNull + public String getDisplayName(@NotNull final BaseObject<?, ?, ?, ?> baseObject) { + return getArchetypeType(baseObject).getDisplayName(baseObject); + } + /** * Returns an {@link ArchetypeType} by type name. * @param typeName the type name to look up * @return the archetype type instance or <code>null</code> if the type name @@ -267,7 +276,7 @@ public void defineFallbackArchetypeType() { fallbackArchetypeType = archetypeTypeNames.get("Misc"); if (fallbackArchetypeType == null) { - fallbackArchetypeType = new ArchetypeType("", 0, null, null, 2, new ArchetypeAttributes(), new ArchetypeAttributesDefinition()); + fallbackArchetypeType = new ArchetypeType("", 0, "", null, null, 2, new ArchetypeAttributes(), new ArchetypeAttributesDefinition()); } } Modified: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java 2010-06-25 18:05:24 UTC (rev 8456) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java 2010-06-25 19:34:30 UTC (rev 8457) @@ -176,6 +176,13 @@ public static final String XML_TYPE_NUMBER = "number"; /** + * The name of the "display" attribute within {@link #XML_ELEMENT_TYPE} + * elements. + */ + @NotNull + public static final String XML_TYPE_DISPLAY = "display"; + + /** * The name of the "ignorelists" element. */ @NotNull Added: trunk/model/src/test/net/sf/gridarta/model/archetypetype/ArchetypeTypeTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/archetypetype/ArchetypeTypeTest.java (rev 0) +++ trunk/model/src/test/net/sf/gridarta/model/archetypetype/ArchetypeTypeTest.java 2010-06-25 19:34:30 UTC (rev 8457) @@ -0,0 +1,153 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.model.archetypetype; + +import java.util.regex.Pattern; +import net.sf.gridarta.model.anim.AnimationObjects; +import net.sf.gridarta.model.anim.DefaultAnimationObjects; +import net.sf.gridarta.model.archetype.TestArchetype; +import net.sf.gridarta.model.baseobject.BaseObject; +import net.sf.gridarta.model.face.ArchFaceProvider; +import net.sf.gridarta.model.face.DefaultFaceObjects; +import net.sf.gridarta.model.face.FaceObjectProviders; +import net.sf.gridarta.model.face.FaceObjects; +import net.sf.gridarta.model.gameobject.TestGameObject; +import net.sf.gridarta.model.map.maparchobject.TestMapArchObject; +import net.sf.gridarta.utils.GUIUtils; +import net.sf.gridarta.utils.SystemIcons; +import org.junit.Assert; +import org.junit.Test; + +/** + * Regression tests for {@link ArchetypeType}. + * @author Andreas Kirschbaum + */ +public class ArchetypeTypeTest { + + /** + * Checks that empty expansions work correctly. + */ + @Test + public void testAttributes1() { + final GUIUtils guiUtils = new GUIUtils(); + final SystemIcons systemIcons = new SystemIcons(guiUtils); + final ArchFaceProvider archFaceProvider = new ArchFaceProvider(); + final FaceObjects<TestGameObject, TestMapArchObject, TestArchetype> faceObjects = new DefaultFaceObjects<TestGameObject, TestMapArchObject, TestArchetype>("png", "facetree", Pattern.compile(".*"), "", archFaceProvider); + final FaceObjectProviders faceObjectProviders = new FaceObjectProviders(0, faceObjects, systemIcons); + final AnimationObjects<TestGameObject, TestMapArchObject, TestArchetype> animationObjects = new DefaultAnimationObjects<TestGameObject, TestMapArchObject, TestArchetype>("animtree"); + final ArchetypeAttributes archetypeAttributes = new ArchetypeAttributes(); + final ArchetypeAttributesDefinition typeAttributes = new ArchetypeAttributesDefinition(); + final BaseObject<?, ?, ?, ?> archetype = new TestArchetype("base", faceObjectProviders, animationObjects); + + final ArchetypeType archetypeType1 = new ArchetypeType("name1", 1, "", "description", "use", 1, archetypeAttributes, typeAttributes); + Assert.assertEquals("name1 (1)", archetypeType1.getDisplayName(archetype)); + } + + /** + * Checks that ${xxx} expansions work correctly. + */ + @Test + public void testAttributes2() { + final GUIUtils guiUtils = new GUIUtils(); + final SystemIcons systemIcons = new SystemIcons(guiUtils); + final ArchFaceProvider archFaceProvider = new ArchFaceProvider(); + final FaceObjects<TestGameObject, TestMapArchObject, TestArchetype> faceObjects = new DefaultFaceObjects<TestGameObject, TestMapArchObject, TestArchetype>("png", "facetree", Pattern.compile(".*"), "", archFaceProvider); + final FaceObjectProviders faceObjectProviders = new FaceObjectProviders(0, faceObjects, systemIcons); + final AnimationObjects<TestGameObject, TestMapArchObject, TestArchetype> animationObjects = new DefaultAnimationObjects<TestGameObject, TestMapArchObject, TestArchetype>("animtree"); + final ArchetypeAttributes archetypeAttributes = new ArchetypeAttributes(); + final ArchetypeAttributesDefinition typeAttributes = new ArchetypeAttributesDefinition(); + final BaseObject<?, ?, ?, ?> archetype = new TestArchetype("base", faceObjectProviders, animationObjects); + + final ArchetypeType archetypeType2 = new ArchetypeType("name2", 1, "a=${a}${a}", "description", "use", 1, archetypeAttributes, typeAttributes); + Assert.assertEquals("name2 (1) [a=]", archetypeType2.getDisplayName(archetype)); + + archetype.setObjectText("a xyz\n"); + Assert.assertEquals("name2 (1) [a=xyzxyz]", archetypeType2.getDisplayName(archetype)); + + archetype.setObjectText("a ${a}\n"); + Assert.assertEquals("name2 (1) [a=${a}${a}]", archetypeType2.getDisplayName(archetype)); + + // syntax errors are not fatal + final ArchetypeType archetypeType3 = new ArchetypeType("name", 1, "${}", "description", "use", 1, archetypeAttributes, typeAttributes); + Assert.assertEquals("name (1) []", archetypeType3.getDisplayName(archetype)); + + final ArchetypeType archetypeType4 = new ArchetypeType("name", 1, "${a", "description", "use", 1, archetypeAttributes, typeAttributes); + Assert.assertEquals("name (1) [${a]", archetypeType4.getDisplayName(archetype)); + } + + /** + * Checks that ${xxx?true:false} expansions work correctly. + */ + @Test + public void testAttributes3() { + final GUIUtils guiUtils = new GUIUtils(); + final SystemIcons systemIcons = new SystemIcons(guiUtils); + final ArchFaceProvider archFaceProvider = new ArchFaceProvider(); + final FaceObjects<TestGameObject, TestMapArchObject, TestArchetype> faceObjects = new DefaultFaceObjects<TestGameObject, TestMapArchObject, TestArchetype>("png", "facetree", Pattern.compile(".*"), "", archFaceProvider); + final FaceObjectProviders faceObjectProviders = new FaceObjectProviders(0, faceObjects, systemIcons); + final AnimationObjects<TestGameObject, TestMapArchObject, TestArchetype> animationObjects = new DefaultAnimationObjects<TestGameObject, TestMapArchObject, TestArchetype>("animtree"); + final ArchetypeAttributes archetypeAttributes = new ArchetypeAttributes(); + final ArchetypeAttributesDefinition typeAttributes = new ArchetypeAttributesDefinition(); + final BaseObject<?, ?, ?, ?> archetype = new TestArchetype("base", faceObjectProviders, animationObjects); + + final ArchetypeType archetypeType2 = new ArchetypeType("name2", 1, "a=${a?True:False}", "description", "use", 1, archetypeAttributes, typeAttributes); + Assert.assertEquals("name2 (1) [a=False]", archetypeType2.getDisplayName(archetype)); + + archetype.setObjectText("a xyz\n"); + Assert.assertEquals("name2 (1) [a=True]", archetypeType2.getDisplayName(archetype)); + + archetype.setObjectText("a 0\n"); + Assert.assertEquals("name2 (1) [a=False]", archetypeType2.getDisplayName(archetype)); + + // empty replacements are allowed + final ArchetypeType archetypeType3 = new ArchetypeType("name", 1, "${a?:}", "description", "use", 1, archetypeAttributes, typeAttributes); + archetype.setObjectText("a 0\n"); + Assert.assertEquals("name (1) []", archetypeType3.getDisplayName(archetype)); + archetype.setObjectText("a 1\n"); + Assert.assertEquals("name (1) []", archetypeType3.getDisplayName(archetype)); + + // replacements with multiple colons + final ArchetypeType archetypeType4 = new ArchetypeType("name", 1, "${a?b:c:d}", "description", "use", 1, archetypeAttributes, typeAttributes); + archetype.setObjectText("a 0\n"); + Assert.assertEquals("name (1) [c:d]", archetypeType4.getDisplayName(archetype)); + archetype.setObjectText("a 1\n"); + Assert.assertEquals("name (1) [b]", archetypeType4.getDisplayName(archetype)); + + // syntax errors are not fatal + final ArchetypeType archetypeType5 = new ArchetypeType("name", 1, "${?", "description", "use", 1, archetypeAttributes, typeAttributes); + archetype.setObjectText("a 0\n"); + Assert.assertEquals("name (1) [${?]", archetypeType5.getDisplayName(archetype)); + archetype.setObjectText("a 1\n"); + Assert.assertEquals("name (1) [${?]", archetypeType5.getDisplayName(archetype)); + + final ArchetypeType archetypeType6 = new ArchetypeType("name", 1, "${a?", "description", "use", 1, archetypeAttributes, typeAttributes); + archetype.setObjectText("a 0\n"); + Assert.assertEquals("name (1) [${a?]", archetypeType6.getDisplayName(archetype)); + archetype.setObjectText("a 1\n"); + Assert.assertEquals("name (1) [${a?]", archetypeType6.getDisplayName(archetype)); + + final ArchetypeType archetypeType7 = new ArchetypeType("name", 1, "${a?:", "description", "use", 1, archetypeAttributes, typeAttributes); + archetype.setObjectText("a 0\n"); + Assert.assertEquals("name (1) [${a?:]", archetypeType7.getDisplayName(archetype)); + archetype.setObjectText("a 1\n"); + Assert.assertEquals("name (1) [${a?:]", archetypeType7.getDisplayName(archetype)); + } + +} // class ArchetypeTypeTest Property changes on: trunk/model/src/test/net/sf/gridarta/model/archetypetype/ArchetypeTypeTest.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/resource/system/dtd/types.dtd =================================================================== --- trunk/resource/system/dtd/types.dtd 2010-06-25 18:05:24 UTC (rev 8456) +++ trunk/resource/system/dtd/types.dtd 2010-06-25 19:34:30 UTC (rev 8457) @@ -93,12 +93,17 @@ is implicitly imported at the end. --> <!-- available: the type is ignored when set to "no"; can be used to temporarily disable type definitions. --> +<!-- display: a string to include in the description of this type; ${attr} + references are replaced with attribute values; ${attr?true:false} + references are replaced by "true" if the attribute exists and is not zero, + or else by "false". --> <!ELEMENT type (import_type*,required?,ignore?,description?,use?,(section | attribute)*)> <!ATTLIST type xml:base CDATA #IMPLIED name CDATA #REQUIRED number CDATA #REQUIRED available (yes|no) 'yes' + display CDATA #IMPLIED > <!ELEMENT description (#PCDATA)> Modified: trunk/src/app/net/sf/gridarta/gui/findarchetypes/TableModel.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/findarchetypes/TableModel.java 2010-06-25 18:05:24 UTC (rev 8456) +++ trunk/src/app/net/sf/gridarta/gui/findarchetypes/TableModel.java 2010-06-25 19:34:30 UTC (rev 8457) @@ -25,7 +25,6 @@ import java.util.List; import javax.swing.table.AbstractTableModel; import net.sf.gridarta.model.archetype.Archetype; -import net.sf.gridarta.model.archetypetype.ArchetypeType; import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; @@ -170,8 +169,7 @@ return archetype.getArchetypeName(); case 2: - final ArchetypeType archetypeType = archetypeTypeSet.getArchetypeType(archetype); - return archetypeType.getTypeName() + " (" + archetypeType.getTypeNo() + ')'; + return archetypeTypeSet.getDisplayName(archetype); case 3: return archetype.getEditorFolder(); Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ArchTab.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ArchTab.java 2010-06-25 18:05:24 UTC (rev 8456) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ArchTab.java 2010-06-25 19:34:30 UTC (rev 8457) @@ -33,7 +33,6 @@ import javax.swing.text.JTextComponent; import net.sf.gridarta.gui.utils.Severity; import net.sf.gridarta.model.archetype.Archetype; -import net.sf.gridarta.model.archetypetype.ArchetypeType; import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; import net.sf.gridarta.model.baseobject.BaseObject; import net.sf.gridarta.model.gameobject.FaceSource; @@ -299,9 +298,7 @@ archTypeText.setText("Type:"); } else { final StringBuilder typeText = new StringBuilder("Type: "); - final ArchetypeType archetypeType = archetypeTypeSet.getArchetypeType(gameObject); - typeText.append(archetypeType.getTypeName()); - typeText.append(" (").append(archetypeType.getTypeNo()).append(')'); + typeText.append(archetypeTypeSet.getDisplayName(gameObject)); typeText.append(" [").append(gameObject.getArchetype().getArchetypeName()).append(']'); if (gameObject.isMulti()) { typeText.append(" [").append(gameObject.getSizeX()).append('x').append(gameObject.getSizeY()).append(']'); Modified: trunk/src/app/net/sf/gridarta/gui/objectchoicedisplay/ObjectChoiceDisplay.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/objectchoicedisplay/ObjectChoiceDisplay.java 2010-06-25 18:05:24 UTC (rev 8456) +++ trunk/src/app/net/sf/gridarta/gui/objectchoicedisplay/ObjectChoiceDisplay.java 2010-06-25 19:34:30 UTC (rev 8457) @@ -24,7 +24,6 @@ import java.awt.GridBagLayout; import javax.swing.JLabel; import javax.swing.JPanel; -import net.sf.gridarta.model.archetypetype.ArchetypeType; import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; import net.sf.gridarta.model.baseobject.BaseObject; import org.jetbrains.annotations.NotNull; @@ -131,8 +130,7 @@ gameObjectArchetypeNameLabel.setText(headObject.getArchetype().getArchetypeName()); - final ArchetypeType archetypeType = archetypeTypeSet.getArchetypeType(headObject); - gameObjectTypeLabel.setText(archetypeType.getTypeName() + " (" + archetypeType.getTypeNo() + ')'); + gameObjectTypeLabel.setText(archetypeTypeSet.getDisplayName(headObject)); if (headObject.isMulti()) { gameObjectExtentsLabel.setText("<html><span style=\"color:green;\"> multi</span> (" + headObject.getMultiRefCount() + " parts) (" + headObject.getSizeX() + ',' + headObject.getSizeY() + ")</html>"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-25 18:05:33
|
Revision: 8456 http://gridarta.svn.sourceforge.net/gridarta/?rev=8456&view=rev Author: akirschbaum Date: 2010-06-25 18:05:24 +0000 (Fri, 25 Jun 2010) Log Message: ----------- Implement #3018432 (Display archetype titles): Include "title" attribute when showing game object or archetype names. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java trunk/model/src/app/net/sf/gridarta/model/baseobject/BaseObject.java trunk/src/app/net/sf/gridarta/gui/selectedsquare/CellRenderer.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-06-25 05:46:21 UTC (rev 8455) +++ trunk/atrinik/ChangeLog 2010-06-25 18:05:24 UTC (rev 8456) @@ -1,3 +1,8 @@ +2010-06-25 Andreas Kirschbaum + + * Implement #3018432 (Display archetype titles): Include "title" + attribute when showing game object or archetype names. + 2010-06-24 Andreas Kirschbaum * Set cursor to end of text in CTRL-ALT-E (toggle game object text Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-06-25 05:46:21 UTC (rev 8455) +++ trunk/crossfire/ChangeLog 2010-06-25 18:05:24 UTC (rev 8456) @@ -1,3 +1,8 @@ +2010-06-25 Andreas Kirschbaum + + * Implement #3018432 (Display archetype titles): Include "title" + attribute when showing game object or archetype names. + 2010-06-24 Andreas Kirschbaum * Set cursor to end of text in CTRL-ALT-E (toggle game object text Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-06-25 05:46:21 UTC (rev 8455) +++ trunk/daimonin/ChangeLog 2010-06-25 18:05:24 UTC (rev 8456) @@ -1,3 +1,8 @@ +2010-06-25 Andreas Kirschbaum + + * Implement #3018432 (Display archetype titles): Include "title" + attribute when showing game object or archetype names. + 2010-06-24 Andreas Kirschbaum * Set cursor to end of text in CTRL-ALT-E (toggle game object text Modified: trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2010-06-25 05:46:21 UTC (rev 8455) +++ trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2010-06-25 18:05:24 UTC (rev 8456) @@ -716,17 +716,21 @@ @NotNull @Override public String getBestName() { + final String baseName; if (objName.length() > 0) { - return objName; + baseName = objName; + } else { + final Archetype<G, A, R> archetype = getArchetype(); + final String archObjName = archetype.getObjName(); + if (archObjName.length() > 0) { + baseName = archObjName; + } else { + baseName = archetype.getArchetypeName(); + } } - final Archetype<G, A, R> archetype = getArchetype(); - final String archObjName = archetype.getObjName(); - if (archObjName.length() > 0) { - return archObjName; - } - - return archetype.getArchetypeName(); + final String title = getAttributeString(TITLE); + return title.isEmpty() ? baseName : baseName + " " +title; } /** Modified: trunk/model/src/app/net/sf/gridarta/model/baseobject/BaseObject.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/baseobject/BaseObject.java 2010-06-25 05:46:21 UTC (rev 8455) +++ trunk/model/src/app/net/sf/gridarta/model/baseobject/BaseObject.java 2010-06-25 18:05:24 UTC (rev 8456) @@ -63,6 +63,12 @@ String TYPE = "type"; /** + * The attribute name of the object's title. + */ + @NotNull + String TITLE = "title"; + + /** * Returns the type number of this Archetype. * @return The type number of this Archetype. */ Modified: trunk/src/app/net/sf/gridarta/gui/selectedsquare/CellRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/selectedsquare/CellRenderer.java 2010-06-25 05:46:21 UTC (rev 8455) +++ trunk/src/app/net/sf/gridarta/gui/selectedsquare/CellRenderer.java 2010-06-25 18:05:24 UTC (rev 8456) @@ -83,22 +83,8 @@ // window gets changed by user and java is still blitting here if (arch != null) { arch = arch.getHead(); - setIcon(faceObjectProviders.getFace(arch)); - - // In the map-square-window the object names are displayed - // next to the icons - final String archObjName = arch.getObjName(); - if (archObjName.length() > 0) { - setText(archObjName); // special name - } else { - final String defaultName = arch.getArchetype().getObjName(); - if (defaultName.length() > 0) { - setText(defaultName); // default name - } else { - setText(arch.getArchetype().getArchetypeName()); // arch name - } - } + setText(arch.getBestName()); } else { setIcon(unknownSquareIcon); setText("?"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-25 05:46:27
|
Revision: 8455 http://gridarta.svn.sourceforge.net/gridarta/?rev=8455&view=rev Author: akirschbaum Date: 2010-06-25 05:46:21 +0000 (Fri, 25 Jun 2010) Log Message: ----------- Add temporary variables. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/findarchetypes/FindArchetypesDialog.java Modified: trunk/src/app/net/sf/gridarta/gui/findarchetypes/FindArchetypesDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/findarchetypes/FindArchetypesDialog.java 2010-06-25 05:43:56 UTC (rev 8454) +++ trunk/src/app/net/sf/gridarta/gui/findarchetypes/FindArchetypesDialog.java 2010-06-25 05:46:21 UTC (rev 8455) @@ -25,6 +25,7 @@ import java.awt.Rectangle; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; import javax.swing.Action; import javax.swing.JButton; import javax.swing.JDialog; @@ -169,18 +170,18 @@ resultTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); resultTable.setRowSelectionAllowed(true); resultTable.setColumnSelectionAllowed(false); - resultTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() { - /** {@inheritDoc} */ + final ListSelectionListener listSelectionListener = new ListSelectionListener() { + @Override public void valueChanged(final ListSelectionEvent e) { highlightSelectedEntry(); } - }); - resultTable.addMouseListener(new MouseAdapter() { - /** - * {@inheritDoc} - * @noinspection RefusedBequest - */ + + }; + resultTable.getSelectionModel().addListSelectionListener(listSelectionListener); + //noinspection RefusedBequest + final MouseListener mouseListener = new MouseAdapter() { + @Override public void mousePressed(final MouseEvent e) { highlightSelectedEntry(); @@ -188,7 +189,9 @@ findArchetypesClose(); } } - }); + + }; + resultTable.addMouseListener(mouseListener); scrollPane = new JScrollPane(resultTable); scrollPane.getViewport().setScrollMode(JViewport.SIMPLE_SCROLL_MODE); scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-25 05:44:02
|
Revision: 8454 http://gridarta.svn.sourceforge.net/gridarta/?rev=8454&view=rev Author: akirschbaum Date: 2010-06-25 05:43:56 +0000 (Fri, 25 Jun 2010) Log Message: ----------- Remove FindArchetypesDialog.documentListener. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/findarchetypes/FindArchetypesDialog.java Modified: trunk/src/app/net/sf/gridarta/gui/findarchetypes/FindArchetypesDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/findarchetypes/FindArchetypesDialog.java 2010-06-25 05:43:25 UTC (rev 8453) +++ trunk/src/app/net/sf/gridarta/gui/findarchetypes/FindArchetypesDialog.java 2010-06-25 05:43:56 UTC (rev 8454) @@ -123,32 +123,6 @@ private String previousSearch = ""; /** - * The document listener to detect changes in {@link #nameField}. - */ - @NotNull - private final DocumentListener documentListener = new DocumentListener() { - - /** {@inheritDoc} */ - @Override - public void changedUpdate(@NotNull final DocumentEvent e) { - doSearch(false); - } - - /** {@inheritDoc} */ - @Override - public void insertUpdate(@NotNull final DocumentEvent e) { - doSearch(false); - } - - /** {@inheritDoc} */ - @Override - public void removeUpdate(@NotNull final DocumentEvent e) { - doSearch(false); - } - - }; - - /** * Create a new instance. * @param parent The parent component. * @param archetypeChooserControl The archetype chooser control to to @@ -166,6 +140,28 @@ nameField = new JTextField(); addAction(nameField, ACTION_BUILDER.createAction(false, "findArchetypesScrollUp", this)); addAction(nameField, ACTION_BUILDER.createAction(false, "findArchetypesScrollDown", this)); + + final DocumentListener documentListener = new DocumentListener() { + + /** {@inheritDoc} */ + @Override + public void changedUpdate(@NotNull final DocumentEvent e) { + doSearch(false); + } + + /** {@inheritDoc} */ + @Override + public void insertUpdate(@NotNull final DocumentEvent e) { + doSearch(false); + } + + /** {@inheritDoc} */ + @Override + public void removeUpdate(@NotNull final DocumentEvent e) { + doSearch(false); + } + + }; nameField.getDocument().addDocumentListener(documentListener); resultTableModel = new TableModel<G, A, R>(archetypeTypeSet); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-25 05:43:31
|
Revision: 8453 http://gridarta.svn.sourceforge.net/gridarta/?rev=8453&view=rev Author: akirschbaum Date: 2010-06-25 05:43:25 +0000 (Fri, 25 Jun 2010) Log Message: ----------- Add @NotNull annotations. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/findarchetypes/FindArchetypesDialog.java Modified: trunk/src/app/net/sf/gridarta/gui/findarchetypes/FindArchetypesDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/findarchetypes/FindArchetypesDialog.java 2010-06-25 05:36:55 UTC (rev 8452) +++ trunk/src/app/net/sf/gridarta/gui/findarchetypes/FindArchetypesDialog.java 2010-06-25 05:43:25 UTC (rev 8453) @@ -70,69 +70,79 @@ /** * Action Builder. */ + @NotNull private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); /** * The archetype set to search. */ + @NotNull private final ArchetypeChooserControl<G, A, R> archetypeChooserControl; /** * The insertion object chooser to use when selecting search results. */ + @NotNull private final ObjectChooser<G, A, R> objectChooser; /** * The name input field. */ + @NotNull private final JTextComponent nameField; /** * The table model for the search results table {@link #resultTable}. */ + @NotNull private final TableModel<G, A, R> resultTableModel; /** * The search results table. */ + @NotNull private final JTable resultTable; /** * The scroll pane which contains the search results table {@link * #resultTable}. */ + @NotNull private final JScrollPane scrollPane; /** * The complete dialog. */ + @NotNull private final JDialog dialog; /** * The previously processed search string. */ + @NotNull private String previousSearch = ""; /** * The document listener to detect changes in {@link #nameField}. */ + @NotNull private final DocumentListener documentListener = new DocumentListener() { /** {@inheritDoc} */ @Override - public void changedUpdate(final DocumentEvent e) { + public void changedUpdate(@NotNull final DocumentEvent e) { doSearch(false); } /** {@inheritDoc} */ @Override - public void insertUpdate(final DocumentEvent e) { + public void insertUpdate(@NotNull final DocumentEvent e) { doSearch(false); } /** {@inheritDoc} */ @Override - public void removeUpdate(final DocumentEvent e) { + public void removeUpdate(@NotNull final DocumentEvent e) { doSearch(false); } @@ -147,7 +157,7 @@ * search results. * @param archetypeTypeSet the instance for looking up archetype types */ - public FindArchetypesDialog(final Component parent, final ArchetypeChooserControl<G, A, R> archetypeChooserControl, final ObjectChooser<G, A, R> objectChooser, final ArchetypeTypeSet archetypeTypeSet) { + public FindArchetypesDialog(@NotNull final Component parent, @NotNull final ArchetypeChooserControl<G, A, R> archetypeChooserControl, @NotNull final ObjectChooser<G, A, R> objectChooser, @NotNull final ArchetypeTypeSet archetypeTypeSet) { this.archetypeChooserControl = archetypeChooserControl; this.objectChooser = objectChooser; @@ -338,7 +348,7 @@ * @param textComponent The text component to add to. * @param action The action to add. */ - private static void addAction(final JTextComponent textComponent, @NotNull final Action action) { + private static void addAction(@NotNull final JTextComponent textComponent, @NotNull final Action action) { final KeyStroke keyStroke = (KeyStroke) action.getValue(Action.ACCELERATOR_KEY); if (keyStroke != null) { textComponent.getKeymap().addActionForKeyStroke(keyStroke, action); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-25 05:37:01
|
Revision: 8452 http://gridarta.svn.sourceforge.net/gridarta/?rev=8452&view=rev Author: akirschbaum Date: 2010-06-25 05:36:55 +0000 (Fri, 25 Jun 2010) Log Message: ----------- Fix checkstyle issue. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/map/validation/ValidationErrorComparator.java Modified: trunk/model/src/app/net/sf/gridarta/model/map/validation/ValidationErrorComparator.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/map/validation/ValidationErrorComparator.java 2010-06-24 20:36:03 UTC (rev 8451) +++ trunk/model/src/app/net/sf/gridarta/model/map/validation/ValidationErrorComparator.java 2010-06-25 05:36:55 UTC (rev 8452) @@ -26,7 +26,6 @@ import net.sf.gridarta.model.map.maparchobject.MapArchObject; import net.sf.gridarta.model.map.mapmodel.MapModel; import net.sf.gridarta.model.map.mapmodel.MapSquare; -import net.sf.gridarta.model.map.validation.errors.MapValidationError; import net.sf.gridarta.model.map.validation.errors.ValidationError; import org.jetbrains.annotations.NotNull; @@ -67,7 +66,7 @@ } /** - * Returns the minimal y coordinate of a {@link MapValidationError}. + * Returns the minimal y coordinate of a {@link ValidationError}. * @param validationError the validation error * @return the minimal y coordinate */ @@ -91,8 +90,8 @@ } /** - * Returns the minimal x coordinate of a {@link MapValidationError}. Only - * Only map squares having the given y coordinate are considered. + * Returns the minimal x coordinate of a {@link ValidationError}. Only map + * squares having the given y coordinate are considered. * @param validationError the validation error * @param y the y coordinate * @return the minimal x coordinate This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-24 20:36:10
|
Revision: 8451 http://gridarta.svn.sourceforge.net/gridarta/?rev=8451&view=rev Author: akirschbaum Date: 2010-06-24 20:36:03 +0000 (Thu, 24 Jun 2010) Log Message: ----------- Fix build script in daimonin directory. Modified Paths: -------------- trunk/daimonin/build.xml Modified: trunk/daimonin/build.xml =================================================================== --- trunk/daimonin/build.xml 2010-06-24 17:22:24 UTC (rev 8450) +++ trunk/daimonin/build.xml 2010-06-24 20:36:03 UTC (rev 8451) @@ -94,7 +94,7 @@ <!-- compiling all Java classes --> <target name="compile" depends="init,clean,ctags" description="compiles source."> - <javac srcdir="${src.dir}:../src/app:../textedit/src/app:../utils/src/app:../model/src/app" destdir="${build.dir.production}" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" debug="${debug}" excludes="test/**/*.java" fork="${javac.fork}" includeantruntime="false"> + <javac srcdir="${src.dir}:../src/app:../textedit/src/app:../utils/src/app:../model/src/app:../preferences/src/app" destdir="${build.dir.production}" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" debug="${debug}" excludes="test/**/*.java" fork="${javac.fork}" includeantruntime="false"> <classpath> <fileset dir="${lib.dir}" includes="*.jar"/> <fileset dir="../lib/" includes="*.jar"/> @@ -119,6 +119,7 @@ <fileset dir="../textedit/src/app" excludes="**/*.java,**/package.html,**/overview.html"/> <fileset dir="../utils/src/app" excludes="**/*.java,**/package.html,**/overview.html"/> <fileset dir="../model/src/app" excludes="**/*.java,**/package.html,**/overview.html"/> + <fileset dir="../preferences/src/app" excludes="**/*.java,**/package.html,**/overview.html"/> </copy> <copy todir="${build.dir.production}"> <fileset dir="${src.dir}" includes="**/*.properties"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-24 17:22:30
|
Revision: 8450 http://gridarta.svn.sourceforge.net/gridarta/?rev=8450&view=rev Author: akirschbaum Date: 2010-06-24 17:22:24 +0000 (Thu, 24 Jun 2010) Log Message: ----------- Set cursor to end of text in CTRL-ALT-E (toggle game object text editor). Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/TextEditorTab.java trunk/src/app/net/sf/gridarta/gui/gameobjecttexteditor/GameObjectTextEditor.java trunk/src/app/net/sf/gridarta/gui/misc/MainViewActions.java trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-06-24 17:19:29 UTC (rev 8449) +++ trunk/atrinik/ChangeLog 2010-06-24 17:22:24 UTC (rev 8450) @@ -1,5 +1,8 @@ 2010-06-24 Andreas Kirschbaum + * Set cursor to end of text in CTRL-ALT-E (toggle game object text + editor). + * Include all map validators when running plugin scripts from command-line. Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-06-24 17:19:29 UTC (rev 8449) +++ trunk/crossfire/ChangeLog 2010-06-24 17:22:24 UTC (rev 8450) @@ -1,5 +1,8 @@ 2010-06-24 Andreas Kirschbaum + * Set cursor to end of text in CTRL-ALT-E (toggle game object text + editor). + * Include all map validators when running plugin scripts from command-line. Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-06-24 17:19:29 UTC (rev 8449) +++ trunk/daimonin/ChangeLog 2010-06-24 17:22:24 UTC (rev 8450) @@ -1,5 +1,8 @@ 2010-06-24 Andreas Kirschbaum + * Set cursor to end of text in CTRL-ALT-E (toggle game object text + editor). + * Include all map validators when running plugin scripts from command-line. Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/TextEditorTab.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/TextEditorTab.java 2010-06-24 17:19:29 UTC (rev 8449) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/TextEditorTab.java 2010-06-24 17:22:24 UTC (rev 8450) @@ -92,7 +92,7 @@ */ @Override public void activate() { - gameObjectTextEditor.getTextPane().requestFocusInWindow(); + gameObjectTextEditor.activate(); } /** Modified: trunk/src/app/net/sf/gridarta/gui/gameobjecttexteditor/GameObjectTextEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjecttexteditor/GameObjectTextEditor.java 2010-06-24 17:19:29 UTC (rev 8449) +++ trunk/src/app/net/sf/gridarta/gui/gameobjecttexteditor/GameObjectTextEditor.java 2010-06-24 17:22:24 UTC (rev 8450) @@ -153,8 +153,20 @@ * Returns the text input pane. * @return the text input pane */ + @NotNull public Component getTextPane() { return archEdit; } + /** + * Activates this component. + */ + public void activate() { + archEdit.requestFocusInWindow(); + final Document document = archEdit.getDocument(); + if (document != null) { + archEdit.setCaretPosition(document.getLength()); + } + } + } // class GameObjectTextEditor Modified: trunk/src/app/net/sf/gridarta/gui/misc/MainViewActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/misc/MainViewActions.java 2010-06-24 17:19:29 UTC (rev 8449) +++ trunk/src/app/net/sf/gridarta/gui/misc/MainViewActions.java 2010-06-24 17:22:24 UTC (rev 8450) @@ -21,6 +21,7 @@ import net.sf.gridarta.gui.gameobjectattributespanel.GameObjectAttributesControl; import net.sf.gridarta.gui.gameobjectattributespanel.GameObjectAttributesTab; +import net.sf.gridarta.gui.gameobjectattributespanel.TextEditorTab; import net.sf.gridarta.gui.utils.tabbedpanel.Tab; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; @@ -58,7 +59,7 @@ * editor. */ @NotNull - private final GameObjectAttributesTab<G, A, R> textEditorTab; + private final TextEditorTab<G, A, R> textEditorTab; /** * Whether a previously selected tab has been remembered. Applies to {@link @@ -92,7 +93,7 @@ * @param textEditorTab the game object attributes tab that displays the * game object text editor */ - public MainViewActions(@NotNull final MainView mainView, @NotNull final GameObjectAttributesControl<G, A, R> gameObjectAttributesControl, @NotNull final Tab gameObjectTab, @NotNull final GameObjectAttributesTab<G, A, R> textEditorTab) { + public MainViewActions(@NotNull final MainView mainView, @NotNull final GameObjectAttributesControl<G, A, R> gameObjectAttributesControl, @NotNull final Tab gameObjectTab, @NotNull final TextEditorTab<G, A, R> textEditorTab) { this.mainView = mainView; this.gameObjectAttributesControl = gameObjectAttributesControl; this.gameObjectTab = gameObjectTab; @@ -127,6 +128,7 @@ } if (prevTab2 != null) { gameObjectAttributesControl.selectTab(prevTab2); + prevTab2.activate(); prevTab2 = null; } } Modified: trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-06-24 17:19:29 UTC (rev 8449) +++ trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-06-24 17:22:24 UTC (rev 8450) @@ -37,7 +37,6 @@ import net.sf.gridarta.delayedmapmodel.DelayedMapModelListenerManager; import net.sf.gridarta.exitconnector.ExitConnectorActions; import net.sf.gridarta.gui.archetypechooser.ArchetypeChooserControl; -import net.sf.gridarta.gui.archetypetype.ArchetypeTypeChecks; import net.sf.gridarta.gui.autovalidator.AutoValidator; import net.sf.gridarta.gui.bookmarks.BookmarkActions; import net.sf.gridarta.gui.connectionview.ConnectionControl; @@ -55,7 +54,6 @@ import net.sf.gridarta.gui.gameobjectattributespanel.FaceTab; import net.sf.gridarta.gui.gameobjectattributespanel.GameObjectAttributesControl; import net.sf.gridarta.gui.gameobjectattributespanel.GameObjectAttributesModel; -import net.sf.gridarta.gui.gameobjectattributespanel.GameObjectAttributesTab; import net.sf.gridarta.gui.gameobjectattributespanel.MsgTextTab; import net.sf.gridarta.gui.gameobjectattributespanel.TextEditorTab; import net.sf.gridarta.gui.io.GuiFileFilters; @@ -498,7 +496,7 @@ final ToolPalette<G, A, R> toolPalette = new ToolPalette<G, A, R>(mapViewSettings, selectedSquareView, selectedSquareModel, objectChooser, pickmapChooserControl, floorMatcher, wallMatcher, monsterMatcher, insertionModeSet); updaterManager = new UpdaterManager(exiter, mapManager, mainViewFrame, gridartaJarFilename); - final GameObjectAttributesTab<G, A, R> textEditorTab = new TextEditorTab<G, A, R>(gameObjectAttributesModel, archetypeTypeSet); + final TextEditorTab<G, A, R> textEditorTab = new TextEditorTab<G, A, R>(gameObjectAttributesModel, archetypeTypeSet); final GameObjectTab<G, A, R> gameObjectTab = new GameObjectTab<G, A, R>("gameObject", gameObjectAttributesControl, Location.BOTTOM, 0, true); //noinspection ResultOfObjectAllocationIgnored This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-24 17:19:35
|
Revision: 8449 http://gridarta.svn.sourceforge.net/gridarta/?rev=8449&view=rev Author: akirschbaum Date: 2010-06-24 17:19:29 +0000 (Thu, 24 Jun 2010) Log Message: ----------- Rename function name. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ArchTab.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/EventsTab.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/FaceTab.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesTab.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/MsgTextTab.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/TextEditorTab.java trunk/src/app/net/sf/gridarta/gui/misc/MainViewActions.java Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ArchTab.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ArchTab.java 2010-06-24 17:01:59 UTC (rev 8448) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ArchTab.java 2010-06-24 17:19:29 UTC (rev 8449) @@ -253,7 +253,7 @@ * {@inheritDoc} */ @Override - public void requestFocus() { + public void activate() { archNameField.requestFocusInWindow(); } Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/EventsTab.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/EventsTab.java 2010-06-24 17:01:59 UTC (rev 8448) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/EventsTab.java 2010-06-24 17:19:29 UTC (rev 8449) @@ -231,7 +231,7 @@ * {@inheritDoc} */ @Override - public void requestFocus() { + public void activate() { scrollPane.requestFocusInWindow(); } Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/FaceTab.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/FaceTab.java 2010-06-24 17:01:59 UTC (rev 8448) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/FaceTab.java 2010-06-24 17:19:29 UTC (rev 8449) @@ -315,7 +315,7 @@ * {@inheritDoc} */ @Override - public void requestFocus() { + public void activate() { faceComponent.requestFocusInWindow(); } Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesTab.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesTab.java 2010-06-24 17:01:59 UTC (rev 8448) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesTab.java 2010-06-24 17:19:29 UTC (rev 8449) @@ -82,6 +82,6 @@ /** * Sets the focus to this component. */ - void requestFocus(); + void activate(); } // interface GameObjectAttributesTab Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/MsgTextTab.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/MsgTextTab.java 2010-06-24 17:01:59 UTC (rev 8448) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/MsgTextTab.java 2010-06-24 17:19:29 UTC (rev 8449) @@ -138,7 +138,7 @@ * {@inheritDoc} */ @Override - public void requestFocus() { + public void activate() { archTextArea.requestFocusInWindow(); } Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/TextEditorTab.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/TextEditorTab.java 2010-06-24 17:01:59 UTC (rev 8448) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/TextEditorTab.java 2010-06-24 17:19:29 UTC (rev 8449) @@ -91,7 +91,7 @@ * {@inheritDoc} */ @Override - public void requestFocus() { + public void activate() { gameObjectTextEditor.getTextPane().requestFocusInWindow(); } Modified: trunk/src/app/net/sf/gridarta/gui/misc/MainViewActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/misc/MainViewActions.java 2010-06-24 17:01:59 UTC (rev 8448) +++ trunk/src/app/net/sf/gridarta/gui/misc/MainViewActions.java 2010-06-24 17:19:29 UTC (rev 8449) @@ -115,7 +115,7 @@ gameObjectTab.getButton().setSelected(true); gameObjectAttributesControl.selectTab(textEditorTab); - textEditorTab.requestFocus(); + textEditorTab.activate(); } else if (prevTabSaved) { prevTabSaved = false; // restore saved state This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-24 17:02:06
|
Revision: 8448 http://gridarta.svn.sourceforge.net/gridarta/?rev=8448&view=rev Author: akirschbaum Date: 2010-06-24 17:01:59 +0000 (Thu, 24 Jun 2010) Log Message: ----------- Iterate row-wise rather than column-wise through map squares. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/map/mapmodel/MapSquareIterator.java Modified: trunk/model/src/app/net/sf/gridarta/model/map/mapmodel/MapSquareIterator.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/map/mapmodel/MapSquareIterator.java 2010-06-24 17:01:08 UTC (rev 8447) +++ trunk/model/src/app/net/sf/gridarta/model/map/mapmodel/MapSquareIterator.java 2010-06-24 17:01:59 UTC (rev 8448) @@ -93,7 +93,7 @@ //The exception is expected and handled //noinspection ProhibitedExceptionCaught try { - final MapSquare<G, A, R> square = mapModel.getMapSquare(new Point(point / mapHeight, point % mapHeight)); + final MapSquare<G, A, R> square = mapModel.getMapSquare(new Point(point % mapWidth, point / mapWidth)); point++; return square; } catch (final ArrayIndexOutOfBoundsException ignore) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-24 17:01:14
|
Revision: 8447 http://gridarta.svn.sourceforge.net/gridarta/?rev=8447&view=rev Author: akirschbaum Date: 2010-06-24 17:01:08 +0000 (Thu, 24 Jun 2010) Log Message: ----------- Order map validation errors by map location. Added Paths: ----------- trunk/model/src/app/net/sf/gridarta/model/map/validation/ValidationErrorComparator.java Added: trunk/model/src/app/net/sf/gridarta/model/map/validation/ValidationErrorComparator.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/map/validation/ValidationErrorComparator.java (rev 0) +++ trunk/model/src/app/net/sf/gridarta/model/map/validation/ValidationErrorComparator.java 2010-06-24 17:01:08 UTC (rev 8447) @@ -0,0 +1,123 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.model.map.validation; + +import java.io.Serializable; +import java.util.Comparator; +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.mapmodel.MapModel; +import net.sf.gridarta.model.map.mapmodel.MapSquare; +import net.sf.gridarta.model.map.validation.errors.MapValidationError; +import net.sf.gridarta.model.map.validation.errors.ValidationError; +import org.jetbrains.annotations.NotNull; + +/** + * A {@link Comparator} that compares {@link ValidationError} instances for + * display ordering. + * @author Andreas Kirschbaum + */ +public class ValidationErrorComparator<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> implements Comparator<ValidationError<G, A, R>>, Serializable { + + /** + * The serial version UID. + */ + private static final long serialVersionUID = 1L; + + /** + * {@inheritDoc} + */ + @Override + public int compare(@NotNull final ValidationError<G, A, R> o1, @NotNull final ValidationError<G, A, R> o2) { + final MapModel<G, A, R> mapModel1 = o1.getMapModel(); + final MapModel<G, A, R> mapModel2 = o2.getMapModel(); + if (mapModel1 == mapModel2) { + final int minY1 = getMinY(o1); + final int minY2 = getMinY(o2); + if (minY1 != minY2) { + return minY1 - minY2; + } + + final int minX1 = getMinX(o1, minY1); + final int minX2 = getMinX(o2, minY2); + if (minX1 != minX2) { + return minX1 - minX2; + } + } + + return System.identityHashCode(mapModel1) - System.identityHashCode(mapModel2); + } + + /** + * Returns the minimal y coordinate of a {@link MapValidationError}. + * @param validationError the validation error + * @return the minimal y coordinate + */ + private int getMinY(@NotNull final ValidationError<G, A, R> validationError) { + int result = Integer.MAX_VALUE; + for (final MapSquare<G, A, R> mapSquare : validationError.getMapSquares()) { + final int y = mapSquare.getMapY(); + if (result > y) { + result = y; + } + } + for (final G gameObject : validationError.getGameObjects()) { + final MapSquare<G, A, R> mapSquare = gameObject.getMapSquare(); + assert mapSquare != null; + final int y = mapSquare.getMapY(); + if (result > y) { + result = y; + } + } + return result; + } + + /** + * Returns the minimal x coordinate of a {@link MapValidationError}. Only + * Only map squares having the given y coordinate are considered. + * @param validationError the validation error + * @param y the y coordinate + * @return the minimal x coordinate + */ + private int getMinX(@NotNull final ValidationError<G, A, R> validationError, final int y) { + int result = Integer.MAX_VALUE; + for (final MapSquare<G, A, R> mapSquare : validationError.getMapSquares()) { + if (mapSquare.getMapY() == y) { + final int x = mapSquare.getMapX(); + if (result > x) { + result = x; + } + } + } + for (final G gameObject : validationError.getGameObjects()) { + final MapSquare<G, A, R> mapSquare = gameObject.getMapSquare(); + assert mapSquare != null; + if (mapSquare.getMapY() == y) { + final int x = mapSquare.getMapX(); + if (result > x) { + result = x; + } + } + } + return result; + } + +} // class ValidationErrorComparator Property changes on: trunk/model/src/app/net/sf/gridarta/model/map/validation/ValidationErrorComparator.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-24 17:00:40
|
Revision: 8446 http://gridarta.svn.sourceforge.net/gridarta/?rev=8446&view=rev Author: akirschbaum Date: 2010-06-24 17:00:34 +0000 (Thu, 24 Jun 2010) Log Message: ----------- Order map validation errors by map location. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/map/validation/DefaultErrorCollector.java Modified: trunk/model/src/app/net/sf/gridarta/model/map/validation/DefaultErrorCollector.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/map/validation/DefaultErrorCollector.java 2010-06-24 16:59:45 UTC (rev 8445) +++ trunk/model/src/app/net/sf/gridarta/model/map/validation/DefaultErrorCollector.java 2010-06-24 17:00:34 UTC (rev 8446) @@ -20,6 +20,7 @@ package net.sf.gridarta.model.map.validation; import java.util.ArrayList; +import java.util.Collections; import java.util.Iterator; import java.util.List; import net.sf.gridarta.model.archetype.Archetype; @@ -43,14 +44,21 @@ /** * Errors. */ + @NotNull private final List<ValidationError<G, A, R>> errors = new ArrayList<ValidationError<G, A, R>>(); /** + * Whether {@link #errors} is sorted. + */ + private boolean sorted = true; + + /** * {@inheritDoc} */ @Override public void collect(@NotNull final ValidationError<G, A, R> error) { errors.add(error); + sorted = false; } /** @@ -59,7 +67,11 @@ @NotNull @Override public Iterator<ValidationError<G, A, R>> iterator() { - return errors.iterator(); + if (!sorted) { + sorted = true; + Collections.sort(errors, new ValidationErrorComparator<G, A, R>()); + } + return Collections.unmodifiableList(errors).iterator(); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-24 16:59:51
|
Revision: 8445 http://gridarta.svn.sourceforge.net/gridarta/?rev=8445&view=rev Author: akirschbaum Date: 2010-06-24 16:59:45 +0000 (Thu, 24 Jun 2010) Log Message: ----------- Report at most one error message for autojoin lists referencing undefined archetypes. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/autojoin/AutojoinListsParser.java Modified: trunk/model/src/app/net/sf/gridarta/model/autojoin/AutojoinListsParser.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/autojoin/AutojoinListsParser.java 2010-06-24 16:58:17 UTC (rev 8444) +++ trunk/model/src/app/net/sf/gridarta/model/autojoin/AutojoinListsParser.java 2010-06-24 16:59:45 UTC (rev 8445) @@ -120,6 +120,7 @@ private void loadList(@NotNull final URL url, @NotNull final BufferedReader bufferedReader) throws IOException { boolean sectionFlag = false; // true while section (start ... end) read; XXX: replace flag with control flow final List<R> archetypes = new ArrayList<R>(AutojoinList.SIZE); + final StringBuilder undefinedArchetypes = new StringBuilder(); boolean skipList = true; while (true) { final String line2 = bufferedReader.readLine(); @@ -132,6 +133,9 @@ if (sectionFlag) { // we are inside a section if (line.equals("end")) { + if (undefinedArchetypes.length() > 0) { + errorView.addWarning(ErrorViewCategory.AUTOJOIN_ENTRY_INVALID, url + ": Autojoin list references undefined archetypes:" + undefinedArchetypes); + } if (!skipList) { try { final AutojoinList<G, A, R> autojoinList = new AutojoinList<G, A, R>(archetypes); @@ -151,7 +155,7 @@ archetypes.add(archetype); } } catch (final UndefinedArchetypeException ex) { - errorView.addWarning(ErrorViewCategory.AUTOJOIN_ENTRY_INVALID, url + ": Autojoin list references undefined archetype: archetype '" + ex.getMessage() + "'"); + undefinedArchetypes.append(' ').append(ex.getMessage()); skipList = true; } } @@ -161,6 +165,7 @@ sectionFlag = true; archetypes.clear(); skipList = false; + undefinedArchetypes.setLength(0); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-24 16:58:26
|
Revision: 8444 http://gridarta.svn.sourceforge.net/gridarta/?rev=8444&view=rev Author: akirschbaum Date: 2010-06-24 16:58:17 +0000 (Thu, 24 Jun 2010) Log Message: ----------- Accelerate map validator by omitting checks that never fail. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/validation/checks/AttributeRangeChecker.java Modified: trunk/src/app/net/sf/gridarta/validation/checks/AttributeRangeChecker.java =================================================================== --- trunk/src/app/net/sf/gridarta/validation/checks/AttributeRangeChecker.java 2010-06-24 16:56:56 UTC (rev 8443) +++ trunk/src/app/net/sf/gridarta/validation/checks/AttributeRangeChecker.java 2010-06-24 16:58:17 UTC (rev 8444) @@ -69,6 +69,10 @@ * @throws InvalidCheckException if the check is invalid */ public void add(final int type, @NotNull final String name, @NotNull final String displayName, final int minValue, final int maxValue) throws InvalidCheckException { + if (minValue == Integer.MIN_VALUE && maxValue == Integer.MAX_VALUE) { + return; + } + getType(type).add(name, displayName, new Range(minValue, maxValue)); } @@ -83,6 +87,10 @@ * @throws InvalidCheckException if the check is invalid */ public void add(@NotNull final GameObjectMatcher matcher, @NotNull final String name, @NotNull final String displayName, final int minValue, final int maxValue) throws InvalidCheckException { + if (minValue == Integer.MIN_VALUE && maxValue == Integer.MAX_VALUE) { + return; + } + getMatcher(matcher).add(name, displayName, new Range(minValue, maxValue)); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-24 16:57:02
|
Revision: 8443 http://gridarta.svn.sourceforge.net/gridarta/?rev=8443&view=rev Author: akirschbaum Date: 2010-06-24 16:56:56 +0000 (Thu, 24 Jun 2010) Log Message: ----------- Include all map validators when running plugin scripts from command-line. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-06-24 16:55:09 UTC (rev 8442) +++ trunk/atrinik/ChangeLog 2010-06-24 16:56:56 UTC (rev 8443) @@ -1,3 +1,8 @@ +2010-06-24 Andreas Kirschbaum + + * Include all map validators when running plugin scripts from + command-line. + 2010-06-23 Andreas Kirschbaum * Open map files even if no archetypes have been found. Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-06-24 16:55:09 UTC (rev 8442) +++ trunk/crossfire/ChangeLog 2010-06-24 16:56:56 UTC (rev 8443) @@ -1,3 +1,8 @@ +2010-06-24 Andreas Kirschbaum + + * Include all map validators when running plugin scripts from + command-line. + 2010-06-23 Andreas Kirschbaum * Open map files even if no archetypes have been found. Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-06-24 16:55:09 UTC (rev 8442) +++ trunk/daimonin/ChangeLog 2010-06-24 16:56:56 UTC (rev 8443) @@ -1,3 +1,8 @@ +2010-06-24 Andreas Kirschbaum + + * Include all map validators when running plugin scripts from + command-line. + 2010-06-23 Andreas Kirschbaum * Open map files even if no archetypes have been found. Modified: trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java 2010-06-24 16:55:09 UTC (rev 8442) +++ trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java 2010-06-24 16:56:56 UTC (rev 8443) @@ -31,6 +31,7 @@ import javax.swing.ImageIcon; import javax.swing.filechooser.FileFilter; import javax.xml.parsers.ParserConfigurationException; +import net.sf.gridarta.gui.archetypetype.ArchetypeTypeChecks; import net.sf.gridarta.gui.filter.FilterControl; import net.sf.gridarta.gui.io.GuiFileFilters; import net.sf.gridarta.gui.map.renderer.RendererFactory; @@ -298,6 +299,7 @@ final ScriptModelParser<G, A, R> scriptModelParser = new ScriptModelParser<G, A, R>(pluginParameterFactory); new ScriptModelLoader<G, A, R>(scriptModelParser).loadScripts(errorView, scriptsFile, scriptModel); new AutojoinListsParser<G, A, R>(errorView, archetypeSet, autojoinLists).loadList(globalSettings.getConfigurationDirectory()); + ArchetypeTypeChecks.addChecks(archetypeTypeSet, attributeRangeChecker); } /** Modified: trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-06-24 16:55:09 UTC (rev 8442) +++ trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-06-24 16:56:56 UTC (rev 8443) @@ -488,7 +488,6 @@ final ExitMatcher<G, A, R> exitMatcher = new ExitMatcher<G, A, R>(exitGameObjectMatcher); final MapPathNormalizer mapPathNormalizer = new MapPathNormalizer(globalSettings); final MapPropertiesDialogFactory<G, A, R> mapPropertiesDialogFactory = editorFactory.newMapPropertiesDialogFactory(globalSettings, mapManager, mapPathNormalizer); - ArchetypeTypeChecks.addChecks(archetypeTypeSet, attributeRangeChecker); final DelayedMapModelListenerManager<G, A, R> delayedMapModelListenerManager = new DelayedMapModelListenerManager<G, A, R>(mapManager, exiter); final Control<?, G, A, R> lockedItemsControl = new LockedItemsControl<G, A, R>(mapViewManager, delayedMapModelListenerManager, lockedItemsTypeNumbers); final GameObjectAttributesModel<G, A, R> gameObjectAttributesModel = new GameObjectAttributesModel<G, A, R>(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-24 16:55:16
|
Revision: 8442 http://gridarta.svn.sourceforge.net/gridarta/?rev=8442&view=rev Author: akirschbaum Date: 2010-06-24 16:55:09 +0000 (Thu, 24 Jun 2010) Log Message: ----------- Set default size for error dialog. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/errorview/DefaultErrorView.java Modified: trunk/src/app/net/sf/gridarta/gui/errorview/DefaultErrorView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/errorview/DefaultErrorView.java 2010-06-24 03:29:45 UTC (rev 8441) +++ trunk/src/app/net/sf/gridarta/gui/errorview/DefaultErrorView.java 2010-06-24 16:55:09 UTC (rev 8442) @@ -21,6 +21,7 @@ import java.awt.Component; import java.awt.Dialog; +import java.awt.Dimension; import java.lang.reflect.InvocationTargetException; import java.util.EnumMap; import java.util.Map; @@ -251,6 +252,7 @@ } }; + pane.setPreferredSize(new Dimension(800, 600)); assert okButton != null; okButton.setEnabled(false); dialog = pane.createDialog(parent, ActionBuilderUtils.getString(ACTION_BUILDER, "errorViewTitle")); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-24 03:29:56
|
Revision: 8441 http://gridarta.svn.sourceforge.net/gridarta/?rev=8441&view=rev Author: akirschbaum Date: 2010-06-24 03:29:45 +0000 (Thu, 24 Jun 2010) Log Message: ----------- Whitespace changes. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java Modified: trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-06-24 03:27:31 UTC (rev 8440) +++ trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-06-24 03:29:45 UTC (rev 8441) @@ -503,7 +503,7 @@ System.out.println(" -c, --collectarches collect archetypes"); System.out.println(" -n, --normal start editor with GUI (default)"); System.out.println(" -s, --singlepng create a PNG file from the specified map"); - System.out.println(" --config=config-file use given config file; uses "+(defaultConfig == null ? "Java preferences" : "~/.gridarta/" + defaultConfig)+" is not given"); + System.out.println(" --config=config-file use given config file; uses " + (defaultConfig == null ? "Java preferences" : "~/.gridarta/" + defaultConfig) + " is not given"); System.out.println(" --noexit do not call System.exit()"); System.out.println(" --script=name [arg=value...]"); System.out.println(" run a plugin script with the given arguments"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-24 03:27:37
|
Revision: 8440 http://gridarta.svn.sourceforge.net/gridarta/?rev=8440&view=rev Author: akirschbaum Date: 2010-06-24 03:27:31 +0000 (Thu, 24 Jun 2010) Log Message: ----------- Fix unchecked warnings. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/DefaultResources.java trunk/model/src/app/net/sf/gridarta/model/resource/CollectedResourcesWriter.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java 2010-06-24 03:17:54 UTC (rev 8439) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java 2010-06-24 03:27:31 UTC (rev 8440) @@ -136,7 +136,11 @@ */ @Override protected void writeCollectedInt(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { - new CollectedResourcesWriter<GameObject, MapArchObject, Archetype>(gameObjectParser, archetypeSet, animationObjects, faceObjects).write(progress, collectedDirectory); + final CollectedResourcesWriter<GameObject, MapArchObject, Archetype> collectedResourcesWriter = new CollectedResourcesWriter<GameObject, MapArchObject, Archetype>(gameObjectParser); + collectedResourcesWriter.addCollectable(archetypeSet); + collectedResourcesWriter.addCollectable(animationObjects); + collectedResourcesWriter.addCollectable(faceObjects); + collectedResourcesWriter.write(progress, collectedDirectory); } /** Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java 2010-06-24 03:17:54 UTC (rev 8439) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java 2010-06-24 03:27:31 UTC (rev 8440) @@ -141,7 +141,12 @@ */ @Override protected void writeCollectedInt(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { - new CollectedResourcesWriter<GameObject, MapArchObject, Archetype>(gameObjectParser, archetypeSet, animationObjects, faceObjects, smoothFaces).write(progress, collectedDirectory); + final CollectedResourcesWriter<GameObject, MapArchObject, Archetype> collectedResourcesWriter = new CollectedResourcesWriter<GameObject, MapArchObject, Archetype>(gameObjectParser); + collectedResourcesWriter.addCollectable(archetypeSet); + collectedResourcesWriter.addCollectable(animationObjects); + collectedResourcesWriter.addCollectable(faceObjects); + collectedResourcesWriter.addCollectable(smoothFaces); + collectedResourcesWriter.write(progress, collectedDirectory); } } // class DefaultResources Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/DefaultResources.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/DefaultResources.java 2010-06-24 03:17:54 UTC (rev 8439) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/DefaultResources.java 2010-06-24 03:27:31 UTC (rev 8440) @@ -136,7 +136,11 @@ */ @Override protected void writeCollectedInt(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { - new CollectedResourcesWriter<GameObject, MapArchObject, Archetype>(gameObjectParser, archetypeSet, animationObjects, faceObjects).write(progress, collectedDirectory); + final CollectedResourcesWriter<GameObject, MapArchObject, Archetype> collectedResourcesWriter = new CollectedResourcesWriter<GameObject, MapArchObject, Archetype>(gameObjectParser); + collectedResourcesWriter.addCollectable(archetypeSet); + collectedResourcesWriter.addCollectable(animationObjects); + collectedResourcesWriter.addCollectable(faceObjects); + collectedResourcesWriter.write(progress, collectedDirectory); } /** Modified: trunk/model/src/app/net/sf/gridarta/model/resource/CollectedResourcesWriter.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/resource/CollectedResourcesWriter.java 2010-06-24 03:17:54 UTC (rev 8439) +++ trunk/model/src/app/net/sf/gridarta/model/resource/CollectedResourcesWriter.java 2010-06-24 03:27:31 UTC (rev 8440) @@ -22,7 +22,6 @@ import java.io.File; import java.io.IOException; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collection; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.collectable.Collectable; @@ -54,14 +53,20 @@ * Creates a new instance. * @param gameObjectParser the game object parser for writing inventory game * objects - * @param collectables the collectable resources */ - public CollectedResourcesWriter(@NotNull final GameObjectParser<G, A, R> gameObjectParser, @NotNull final Collectable<G, A, R>... collectables) { + public CollectedResourcesWriter(@NotNull final GameObjectParser<G, A, R> gameObjectParser) { this.gameObjectParser = gameObjectParser; - this.collectables.addAll(Arrays.asList(collectables)); } /** + * Adds a {@link Collectable} resource. + * @param collectable the collectable resource + */ + public void addCollectable(@NotNull final Collectable<G, A, R> collectable) { + collectables.add(collectable); + } + + /** * Writes the resources into a collection. * @param progress the progress to use * @param collectedDirectory the collected directory to write to This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-24 03:18:01
|
Revision: 8439 http://gridarta.svn.sourceforge.net/gridarta/?rev=8439&view=rev Author: akirschbaum Date: 2010-06-24 03:17:54 +0000 (Thu, 24 Jun 2010) Log Message: ----------- Make sure every GameObject has an Archetype. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java trunk/model/src/app/net/sf/gridarta/model/gameobject/AbstractGameObject.java Modified: trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2010-06-24 03:09:38 UTC (rev 8438) +++ trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2010-06-24 03:17:54 UTC (rev 8439) @@ -219,7 +219,7 @@ final String normalizedFaceName = faceName.length() > 0 ? faceName.intern() : null; //Strings are interned //noinspection StringEquality - final String effectiveFaceName = normalizedFaceName != null && normalizedFaceName.length() > 0 && (getArchetype() == null || isArchetype() || normalizedFaceName != getArchetype().getFaceName()) ? normalizedFaceName : null; + final String effectiveFaceName = normalizedFaceName != null && normalizedFaceName.length() > 0 && (isArchetype() || normalizedFaceName != getArchetype().getFaceName()) ? normalizedFaceName : null; //Strings are interned //noinspection StringEquality if (this.faceName == effectiveFaceName) { @@ -280,7 +280,7 @@ public String getAttributeString(@NotNull final String attributeName, final boolean queryArchetype) { String result = gameObjectText.getAttributeValue(attributeName); if (result == null) { - if (!queryArchetype || isArchetype() || getArchetype() == null) { + if (!queryArchetype || isArchetype()) { result = ""; } else { result = getArchetype().getAttributeString(attributeName); @@ -352,7 +352,7 @@ @Override public void setAttributeString(@NotNull final String attributeName, @NotNull final String value) { final String attributeNameWithSpace = attributeName.trim() + " "; // attributeName must be followed by space - final boolean sameAsInArchetype = getArchetype() != null && getArchetype().getAttributeString(attributeName).equals(value); + final boolean sameAsInArchetype = getArchetype().getAttributeString(attributeName).equals(value); boolean exists = false; final StringBuilder result = new StringBuilder(); for (final String line : StringUtils.PATTERN_END_OF_LINE.split(getObjectText(), 0)) { @@ -716,23 +716,17 @@ @NotNull @Override public String getBestName() { + if (objName.length() > 0) { + return objName; + } + final Archetype<G, A, R> archetype = getArchetype(); - if (archetype != null) { - final String archObjName = archetype.getObjName(); - if (objName.length() > 0) { - return objName; - } else if (archObjName.length() > 0) { - return archObjName; - } else { - return archetype.getArchetypeName(); - } - } else { - if (objName.length() > 0) { - return objName; - } else { - throw new IllegalStateException(); - } + final String archObjName = archetype.getObjName(); + if (archObjName.length() > 0) { + return archObjName; } + + return archetype.getArchetypeName(); } /** @@ -786,9 +780,6 @@ @Override public boolean isDefaultGameObject() { final R archetype = getArchetype(); - if (archetype == null) { - return false; - } if (!objName.equals(archetype.getObjName())) { return false; } Modified: trunk/model/src/app/net/sf/gridarta/model/gameobject/AbstractGameObject.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/gameobject/AbstractGameObject.java 2010-06-24 03:09:38 UTC (rev 8438) +++ trunk/model/src/app/net/sf/gridarta/model/gameobject/AbstractGameObject.java 2010-06-24 03:17:54 UTC (rev 8439) @@ -42,7 +42,7 @@ * not yet known. * @serial */ - @Nullable + @NotNull private R archetype; /** @@ -324,7 +324,7 @@ /** * {@inheritDoc} */ - //XXX: @NotNull + @NotNull @Override public R getArchetype() { return archetype; @@ -348,7 +348,7 @@ */ @Override public boolean hasUndefinedArchetype() { - return archetype != null && archetype.isUndefinedArchetype(); + return archetype.isUndefinedArchetype(); } } // class AbstractGameObject This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-24 03:09:46
|
Revision: 8438 http://gridarta.svn.sourceforge.net/gridarta/?rev=8438&view=rev Author: akirschbaum Date: 2010-06-24 03:09:38 +0000 (Thu, 24 Jun 2010) Log Message: ----------- Remove GameObject,setArchetypeName() and BaseObject.getArchetypeName(). Modified Paths: -------------- trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java trunk/model/src/app/net/sf/gridarta/model/archetype/Archetype.java trunk/model/src/app/net/sf/gridarta/model/archetype/ArchetypeValidator.java trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java trunk/model/src/app/net/sf/gridarta/model/baseobject/BaseObject.java trunk/model/src/app/net/sf/gridarta/model/filter/NamedFilter.java trunk/model/src/app/net/sf/gridarta/model/gameobject/AbstractGameObject.java trunk/model/src/app/net/sf/gridarta/model/gameobject/GameObject.java trunk/model/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java trunk/model/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java trunk/model/src/app/net/sf/gridarta/model/match/MutableNameGameObjectMatcher.java trunk/model/src/app/net/sf/gridarta/model/spells/GameObjectSpell.java trunk/src/app/net/sf/gridarta/gui/archetypechooser/ArchetypeNameCellRenderer.java trunk/src/app/net/sf/gridarta/gui/findarchetypes/TableModel.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ArchTab.java trunk/src/app/net/sf/gridarta/gui/objectchoicedisplay/ObjectChoiceDisplay.java trunk/src/app/net/sf/gridarta/gui/replacedialog/ArchetypeNameMatchCriteria.java trunk/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBoxCellRenderer.java trunk/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBoxEditor.java trunk/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBoxModel.java trunk/src/app/net/sf/gridarta/gui/selectedsquare/CellRenderer.java Modified: trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java =================================================================== --- trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -98,7 +98,7 @@ final Archetype arch2 = getArchetypeSet().getArchetype("arch2"); Assert.assertEquals(1, arch2.countInvObjects()); final GameObject inv = arch2.iterator().next(); - Assert.assertEquals("arch1", inv.getArchetypeName()); + Assert.assertEquals("arch1", inv.getArchetype().getArchetypeName()); Assert.assertEquals("name1", inv.getAttributeString(BaseObject.NAME)); } Modified: trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java =================================================================== --- trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -72,7 +72,7 @@ final Archetype arch2 = getArchetypeSet().getArchetype("arch2"); Assert.assertEquals(1, arch2.countInvObjects()); final GameObject inv = arch2.iterator().next(); - Assert.assertEquals("arch1", inv.getArchetypeName()); + Assert.assertEquals("arch1", inv.getArchetype().getArchetypeName()); Assert.assertEquals("name1", inv.getAttributeString(BaseObject.NAME)); } Modified: trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -203,20 +203,7 @@ */ @Override public void setArchetypeName(@NotNull final String archetypeName) { - final String newArchetypeName = archetypeName.intern(); - // Using == on these Strings is okay, they are both interned. - //noinspection StringEquality - if (this.archetypeName == newArchetypeName) { - return; - } - - beginGameObjectChange(); - try { - this.archetypeName = newArchetypeName; - // XXX: update objName - } finally { - endGameObjectChange(); - } + this.archetypeName = archetypeName; } /** Modified: trunk/model/src/app/net/sf/gridarta/model/archetype/Archetype.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetype/Archetype.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/model/src/app/net/sf/gridarta/model/archetype/Archetype.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -66,9 +66,16 @@ void addFirst(@NotNull G gameObject); /** - * Set the archetype name. - * @param archetypeName the archetype name + * Returns the name of this archetype. + * @return the name */ + @NotNull + String getArchetypeName(); + + /** + * Sets the name of this archetype. + * @param archetypeName the name + */ void setArchetypeName(@NotNull String archetypeName); /** Modified: trunk/model/src/app/net/sf/gridarta/model/archetype/ArchetypeValidator.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetype/ArchetypeValidator.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/model/src/app/net/sf/gridarta/model/archetype/ArchetypeValidator.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -21,7 +21,6 @@ import net.sf.gridarta.model.anim.AnimationObject; import net.sf.gridarta.model.anim.AnimationObjects; -import net.sf.gridarta.model.baseobject.BaseObject; import net.sf.gridarta.model.errorview.ErrorView; import net.sf.gridarta.model.errorview.ErrorViewCategory; import net.sf.gridarta.model.face.FaceObject; @@ -70,7 +69,7 @@ * @param archetypeSet the archetype set instance to validate */ public void validate(@NotNull final ArchetypeSet<?, ?, ?> archetypeSet) { - for (final BaseObject<?, ?, ?, ?> archetype : archetypeSet.getArchetypes()) { + for (final Archetype<?, ?, ?> archetype : archetypeSet.getArchetypes()) { validateArchetype(archetype); } } @@ -79,7 +78,7 @@ * Validates an {@link Archetype} instance. * @param archetype the archetype instance to validate */ - private void validateArchetype(@NotNull final BaseObject<?, ?, ?, ?> archetype) { + private void validateArchetype(@NotNull final Archetype<?, ?, ?> archetype) { final String animName = archetype.getAnimName(); if (animName != null && !animName.equals("NONE")) { final AnimationObject animation = animationObjects.get(animName); Modified: trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -694,7 +694,7 @@ * @param objName the name of this object. */ private void setObjName(@NotNull final String objName) { - final String objName2 = objName.length() == 0 ? getArchetypeName() : objName; + final String objName2 = objName.length() == 0 ? getArchetype().getArchetypeName() : objName; final String newObjName = objName2.intern(); // Using == on these Strings is okay, they are both interned. //noinspection StringEquality @@ -716,22 +716,19 @@ @NotNull @Override public String getBestName() { - if (getArchetype() != null) { - final String archObjName = getArchetype().getObjName(); + final Archetype<G, A, R> archetype = getArchetype(); + if (archetype != null) { + final String archObjName = archetype.getObjName(); if (objName.length() > 0) { return objName; } else if (archObjName.length() > 0) { return archObjName; - } else if (getArchetypeName().length() > 0) { - return getArchetypeName(); } else { - return getArchetype().getArchetypeName(); + return archetype.getArchetypeName(); } } else { if (objName.length() > 0) { return objName; - } else if (getArchetypeName().length() > 0) { - return getArchetypeName(); } else { throw new IllegalStateException(); } @@ -788,13 +785,10 @@ */ @Override public boolean isDefaultGameObject() { - final BaseObject<G, A, R, ?> archetype = getArchetype(); + final R archetype = getArchetype(); if (archetype == null) { return false; } - if (!getArchetypeName().equals(archetype.getArchetypeName())) { - return false; - } if (!objName.equals(archetype.getObjName())) { return false; } @@ -828,7 +822,7 @@ // ignore "faceObjSource" // ignore "normalFace" // ignore "container" - && abstractBaseObject.getArchetype() == getArchetype() && abstractBaseObject.getArchetypeName().equals(getArchetypeName()) && abstractBaseObject.objName.equals(objName) && abstractBaseObject.gameObjectText.equals(gameObjectText) && (abstractBaseObject.msgText == null ? msgText == null : msgText != null && msgText.toString().equals(abstractBaseObject.msgText.toString())) + && abstractBaseObject.getArchetype() == getArchetype() && abstractBaseObject.getArchetype().getArchetypeName().equals(getArchetype().getArchetypeName()) && abstractBaseObject.objName.equals(objName) && abstractBaseObject.gameObjectText.equals(gameObjectText) && (abstractBaseObject.msgText == null ? msgText == null : msgText != null && msgText.toString().equals(abstractBaseObject.msgText.toString())) // ignore "mapX" // ignore "mapY" // ignore "attributeCache" Modified: trunk/model/src/app/net/sf/gridarta/model/baseobject/BaseObject.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/baseobject/BaseObject.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/model/src/app/net/sf/gridarta/model/baseobject/BaseObject.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -227,13 +227,6 @@ R getArchetype(); /** - * Returns the name of the archetype. - * @return the name - */ - @NotNull - String getArchetypeName(); - - /** * Returns the edit type. * @return edit type */ Modified: trunk/model/src/app/net/sf/gridarta/model/filter/NamedFilter.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/filter/NamedFilter.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/model/src/app/net/sf/gridarta/model/filter/NamedFilter.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -85,7 +85,7 @@ public boolean match(@NotNull final NamedFilterConfig config, @NotNull final GameObject<?, ?, ?> gameObject) { try { if (log.isDebugEnabled()) { - log.debug("match called on " + gameObject.getArchetypeName()); + log.debug("match called on " + gameObject.getArchetype().getArchetypeName()); } for (final String name : subFilters.keySet()) { if (log.isDebugEnabled()) { Modified: trunk/model/src/app/net/sf/gridarta/model/gameobject/AbstractGameObject.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/gameobject/AbstractGameObject.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/model/src/app/net/sf/gridarta/model/gameobject/AbstractGameObject.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -38,13 +38,6 @@ public abstract class AbstractGameObject<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends AbstractBaseObject<G, A, R, G> implements GameObject<G, A, R> { /** - * The name of the {@link Archetype} associated with this game object. - * @serial - */ - @NotNull - private String archetypeName; - - /** * The {@link Archetype} of this game object. Set to <code>null</code> if * not yet known. * @serial @@ -71,7 +64,6 @@ */ protected AbstractGameObject(@NotNull final R archetype, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects<G, A, R> animationObjects) { super(faceObjectProviders, animationObjects); - archetypeName = archetype.getArchetypeName(); this.archetype = archetype; updateArchetype(); } @@ -348,44 +340,13 @@ } this.archetype = archetype; - setArchetypeName(archetype.getArchetypeName()); updateArchetype(); } /** * {@inheritDoc} */ - @NotNull @Override - public String getArchetypeName() { - return archetypeName; - } - - /** - * {@inheritDoc} - */ - @Override - public void setArchetypeName(@NotNull final String archetypeName) { - final String newArchetypeName = archetypeName.intern(); - // Using == on these Strings is okay, they are both interned. - //noinspection StringEquality - if (this.archetypeName == newArchetypeName) { - return; - } - - beginGameObjectChange(); - try { - this.archetypeName = newArchetypeName; - // XXX: update objName - } finally { - endGameObjectChange(); - } - } - - /** - * {@inheritDoc} - */ - @Override public boolean hasUndefinedArchetype() { return archetype != null && archetype.isUndefinedArchetype(); } Modified: trunk/model/src/app/net/sf/gridarta/model/gameobject/GameObject.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/gameobject/GameObject.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/model/src/app/net/sf/gridarta/model/gameobject/GameObject.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -269,12 +269,6 @@ void setArchetype(@NotNull R archetype); /** - * Set the archetype name. - * @param archetypeName the archetype name - */ - void setArchetypeName(@NotNull String archetypeName); - - /** * Return whether this instance references an undefined archetype. * @return <code>true</code> if this instance references an undefined * archetype Modified: trunk/model/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/model/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -224,7 +224,7 @@ final Map<String, String> fields = getModifiedFields(gameObject); appendable.append("arch "); - appendable.append(gameObject.getArchetypeName()); + appendable.append(gameObject.getArchetype().getArchetypeName()); appendable.append("\n"); for (final Map.Entry<String, String> entry : fields.entrySet()) { appendable.append(entry.getKey()); Modified: trunk/model/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/model/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -677,7 +677,7 @@ if (!allowDouble) { final String temp = part.getArchetypeName(); for (final BaseObject<G, A, R, ?> node : mapGrid.getMapSquare(point.x, point.y)) { - if (node.getArchetypeName().equals(temp)) { + if (node.getArchetype().getArchetypeName().equals(temp)) { return false; } } Modified: trunk/model/src/app/net/sf/gridarta/model/match/MutableNameGameObjectMatcher.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/match/MutableNameGameObjectMatcher.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/model/src/app/net/sf/gridarta/model/match/MutableNameGameObjectMatcher.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -55,7 +55,7 @@ */ @Override public boolean isMatching(@NotNull final GameObject<?, ?, ?> arch) { - return name.matches(arch.getArchetypeName()); + return name.matches(arch.getArchetype().getArchetypeName()); } /** Modified: trunk/model/src/app/net/sf/gridarta/model/spells/GameObjectSpell.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/spells/GameObjectSpell.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/model/src/app/net/sf/gridarta/model/spells/GameObjectSpell.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -80,7 +80,7 @@ */ private static String getName(final BaseObject<?, ?, ?, ?> archetype) { final String archObjName = archetype.getObjName(); - final String archetypeName = archetype.getArchetypeName(); + final String archetypeName = archetype.getArchetype().getArchetypeName(); return (archObjName.length() > 0 ? archObjName : archetypeName) + " [" + archetypeName + "]"; } Modified: trunk/src/app/net/sf/gridarta/gui/archetypechooser/ArchetypeNameCellRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/archetypechooser/ArchetypeNameCellRenderer.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/src/app/net/sf/gridarta/gui/archetypechooser/ArchetypeNameCellRenderer.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -22,7 +22,6 @@ import java.awt.Component; import javax.swing.JList; import net.sf.gridarta.model.archetype.Archetype; -import net.sf.gridarta.model.baseobject.BaseObject; import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; @@ -61,7 +60,7 @@ 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 BaseObject<?, ?, ?, ?> archetype = (BaseObject<?, ?, ?, ?>) value; + final Archetype<?, ?, ?> archetype = (Archetype<?, ?, ?>) value; setText(archetype.getArchetypeName()); setIcon(faceObjectProviders.getFace(archetype)); return this; Modified: trunk/src/app/net/sf/gridarta/gui/findarchetypes/TableModel.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/findarchetypes/TableModel.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/src/app/net/sf/gridarta/gui/findarchetypes/TableModel.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -27,7 +27,6 @@ import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.archetypetype.ArchetypeType; import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; -import net.sf.gridarta.model.baseobject.BaseObject; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; import net.sf.gridarta.utils.ActionBuilderUtils; @@ -88,8 +87,8 @@ /** {@inheritDoc} */ @Override public int compare(final Integer o1, final Integer o2) { - final BaseObject<G, A, R, ?> archetype1 = archetypes.get(o1); - final BaseObject<G, A, R, ?> archetype2 = archetypes.get(o2); + final Archetype<G, A, R> archetype1 = archetypes.get(o1); + final Archetype<G, A, R> archetype2 = archetypes.get(o2); final int cmpBestName = archetype1.getBestName().compareToIgnoreCase(archetype2.getBestName()); if (cmpBestName != 0) { Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ArchTab.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ArchTab.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ArchTab.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -281,7 +281,7 @@ setArchNameField(objName, Color.blue); } else { final String archObjName = gameObject.getArchetype().getObjName(); - setArchNameField(archObjName.length() > 0 ? archObjName : gameObject.getArchetypeName(), Color.black); + setArchNameField(archObjName.length() > 0 ? archObjName : gameObject.getArchetype().getArchetypeName(), Color.black); } } @@ -302,7 +302,7 @@ final ArchetypeType archetypeType = archetypeTypeSet.getArchetypeType(gameObject); typeText.append(archetypeType.getTypeName()); typeText.append(" (").append(archetypeType.getTypeNo()).append(')'); - typeText.append(" [").append(gameObject.getArchetypeName()).append(']'); + typeText.append(" [").append(gameObject.getArchetype().getArchetypeName()).append(']'); if (gameObject.isMulti()) { typeText.append(" [").append(gameObject.getSizeX()).append('x').append(gameObject.getSizeY()).append(']'); } else { @@ -331,7 +331,7 @@ } final BaseObject<G, A, R, ?> cont = gameObject.getContainerGameObject(); if (cont != null) { - specialText.append(" (env: ").append(cont.getArchetypeName()).append(')'); + specialText.append(" (env: ").append(cont.getArchetype().getArchetypeName()).append(')'); } archMapPos.setText(specialText.toString()); } Modified: trunk/src/app/net/sf/gridarta/gui/objectchoicedisplay/ObjectChoiceDisplay.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/objectchoicedisplay/ObjectChoiceDisplay.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/src/app/net/sf/gridarta/gui/objectchoicedisplay/ObjectChoiceDisplay.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -129,7 +129,7 @@ gameObjectNameLabel.setForeground(Color.BLACK); gameObjectNameLabel.setText(objName); - gameObjectArchetypeNameLabel.setText(headObject.getArchetypeName()); + gameObjectArchetypeNameLabel.setText(headObject.getArchetype().getArchetypeName()); final ArchetypeType archetypeType = archetypeTypeSet.getArchetypeType(headObject); gameObjectTypeLabel.setText(archetypeType.getTypeName() + " (" + archetypeType.getTypeNo() + ')'); Modified: trunk/src/app/net/sf/gridarta/gui/replacedialog/ArchetypeNameMatchCriteria.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/replacedialog/ArchetypeNameMatchCriteria.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/src/app/net/sf/gridarta/gui/replacedialog/ArchetypeNameMatchCriteria.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -51,7 +51,7 @@ */ @Override public boolean matches(@NotNull final G gameObject) { - return archetypeName.matcher(gameObject.getArchetypeName()).matches(); + return archetypeName.matcher(gameObject.getArchetype().getArchetypeName()).matches(); } } // class ArchetypeNameMatchCriteria Modified: trunk/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBoxCellRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBoxCellRenderer.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBoxCellRenderer.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -76,7 +76,7 @@ setIcon(null); return this; } - setText(arch.getArchetypeName()); + setText(arch.getArchetype().getArchetypeName()); setIcon(faceObjectProviders.getFace(arch)); Modified: trunk/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBoxEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBoxEditor.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBoxEditor.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -120,7 +120,7 @@ public void actionPerformed(final ActionEvent e) { final BaseObject<G, A, R, ?> gameObject = objectChooser.getSelection(); if (gameObject != null) { - final Archetype<G, A, R> ao = archComboBoxModel.getNearestMatch(gameObject.getArchetypeName()); + final Archetype<G, A, R> ao = archComboBoxModel.getNearestMatch(gameObject.getArchetype().getArchetypeName()); archComboBox.setSelectedItem(ao); setItem(ao); } @@ -133,7 +133,7 @@ public void actionPerformed(final ActionEvent e) { final BaseObject<G, A, R, ?> gameObject = gameObjectAttributesModel.getSelectedGameObject(); if (gameObject != null) { - final Archetype<G, A, R> ao = archComboBoxModel.getNearestMatch(gameObject.getArchetypeName()); + final Archetype<G, A, R> ao = archComboBoxModel.getNearestMatch(gameObject.getArchetype().getArchetypeName()); archComboBox.setSelectedItem(ao); setItem(ao); } @@ -253,9 +253,9 @@ } } else { if (!locked) { - editor.setText(arch.getArchetypeName()); + editor.setText(arch.getArchetype().getArchetypeName()); } - icon.setText(arch.getArchetypeName()); + icon.setText(arch.getArchetype().getArchetypeName()); } } Modified: trunk/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBoxModel.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBoxModel.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBoxModel.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -26,7 +26,6 @@ import javax.swing.ComboBoxModel; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.archetype.ArchetypeSet; -import net.sf.gridarta.model.baseobject.BaseObject; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; import org.jetbrains.annotations.NotNull; @@ -115,13 +114,13 @@ public int compare(final Object o1, final Object o2) { final String s1; if (o1 instanceof Archetype) { - s1 = ((BaseObject<?, ?, ?, ?>) o1).getArchetypeName(); + s1 = ((Archetype<?, ?, ?>) o1).getArchetypeName(); } else { s1 = o1.toString(); } final String s2; if (o2 instanceof Archetype) { - s2 = ((BaseObject<?, ?, ?, ?>) o2).getArchetypeName(); + s2 = ((Archetype<?, ?, ?>) o2).getArchetypeName(); } else { s2 = o2.toString(); } Modified: trunk/src/app/net/sf/gridarta/gui/selectedsquare/CellRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/selectedsquare/CellRenderer.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/src/app/net/sf/gridarta/gui/selectedsquare/CellRenderer.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -96,7 +96,7 @@ if (defaultName.length() > 0) { setText(defaultName); // default name } else { - setText(arch.getArchetypeName()); // arch name + setText(arch.getArchetype().getArchetypeName()); // arch name } } } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-24 02:44:33
|
Revision: 8437 http://gridarta.svn.sourceforge.net/gridarta/?rev=8437&view=rev Author: akirschbaum Date: 2010-06-24 02:44:24 +0000 (Thu, 24 Jun 2010) Log Message: ----------- Remove support for creating GameObject instances from archetype names. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeSet.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/DefaultArchetype.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/DefaultArchetypeFactory.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/UndefinedArchetype.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/DefaultGameObjectParser.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/DefaultGameObjectParserFactory.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParser.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeSet.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/DefaultArchetype.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/DefaultArchetypeFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/UndefinedArchetype.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/DefaultGameObjectFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/GameObject.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/DefaultGameObjectParser.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/DefaultGameObjectParserFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/smoothface/SmoothFaces.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/gameobject/GameObjectCreator.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/ArchetypeSet.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/DefaultArchetypeFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/UndefinedArchetype.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/DefaultGameObjectFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/GameObject.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/io/DefaultGameObjectParser.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/io/DefaultGameObjectParserFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/DefaultResources.java trunk/model/src/app/net/sf/gridarta/model/anim/AnimationObjects.java trunk/model/src/app/net/sf/gridarta/model/anim/AnimationValidator.java trunk/model/src/app/net/sf/gridarta/model/anim/DefaultAnimationObjects.java trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeSet.java trunk/model/src/app/net/sf/gridarta/model/archetype/ArchetypeSet.java trunk/model/src/app/net/sf/gridarta/model/archetype/ArchetypeValidator.java trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java trunk/model/src/app/net/sf/gridarta/model/collectable/Collectable.java trunk/model/src/app/net/sf/gridarta/model/face/DefaultFaceObjects.java trunk/model/src/app/net/sf/gridarta/model/face/FaceObjectProviders.java trunk/model/src/app/net/sf/gridarta/model/face/FaceObjects.java trunk/model/src/app/net/sf/gridarta/model/gameobject/AbstractGameObject.java trunk/model/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java trunk/model/src/app/net/sf/gridarta/model/gameobject/GameObjectFactory.java trunk/model/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java trunk/model/src/app/net/sf/gridarta/model/io/DefaultMapReader.java trunk/model/src/app/net/sf/gridarta/model/io/DefaultMapReaderFactory.java trunk/model/src/app/net/sf/gridarta/model/io/GameObjectParser.java trunk/model/src/app/net/sf/gridarta/model/resource/AbstractResources.java trunk/model/src/app/net/sf/gridarta/model/resource/CollectedResourcesWriter.java trunk/model/src/test/net/sf/gridarta/model/archetype/ArchetypeParserTest.java trunk/model/src/test/net/sf/gridarta/model/archetype/TestArchetype.java trunk/model/src/test/net/sf/gridarta/model/archetype/TestArchetypeSet.java trunk/model/src/test/net/sf/gridarta/model/artifact/ArtifactParserTest.java trunk/model/src/test/net/sf/gridarta/model/baseobject/AbstractBaseObjectTest.java trunk/model/src/test/net/sf/gridarta/model/gameobject/TestGameObject.java trunk/model/src/test/net/sf/gridarta/model/gameobject/TestGameObjectFactory.java trunk/model/src/test/net/sf/gridarta/model/io/TestGameObjectParser.java trunk/model/src/test/net/sf/gridarta/model/io/TestMapReaderFactory.java trunk/model/src/test/net/sf/gridarta/model/map/mapmodel/DefaultMapModelTest.java trunk/model/src/test/net/sf/gridarta/model/match/NamedGameObjectMatcherTest.java trunk/model/src/test/net/sf/gridarta/model/resource/AbstractFilesResourcesReaderTest.java trunk/src/app/net/sf/gridarta/gui/utils/AnimTreeChooseAction.java trunk/src/app/net/sf/gridarta/gui/utils/FaceComponent.java trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java trunk/src/app/net/sf/gridarta/maincontrol/ImageCreatorFactory.java trunk/src/test/net/sf/gridarta/gui/map/test/TestMapControlCreator.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2010-06-24 00:59:32 UTC (rev 8436) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2010-06-24 02:44:24 UTC (rev 8437) @@ -238,7 +238,7 @@ */ @NotNull @Override - public GameObjectFactory<GameObject, MapArchObject, Archetype> newGameObjectFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet archetypeTypeSet) { + public GameObjectFactory<GameObject, MapArchObject, Archetype> newGameObjectFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchetypeTypeSet archetypeTypeSet) { return new DefaultGameObjectFactory(faceObjectProviders, animationObjects, archetypeTypeSet); } @@ -247,8 +247,8 @@ */ @NotNull @Override - public GameObjectParserFactory<GameObject, MapArchObject, Archetype> newGameObjectParserFactory(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GameObjectMatchers gameObjectMatchers) { - return new DefaultGameObjectParserFactory(gameObjectFactory, gameObjectMatchers); + public GameObjectParserFactory<GameObject, MapArchObject, Archetype> newGameObjectParserFactory(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { + return new DefaultGameObjectParserFactory(gameObjectFactory, gameObjectMatchers, archetypeSet); } /** @@ -265,7 +265,7 @@ */ @NotNull @Override - public ArchetypeFactory<GameObject, MapArchObject, Archetype> newArchetypeFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects) { + public ArchetypeFactory<GameObject, MapArchObject, Archetype> newArchetypeFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects) { return new DefaultArchetypeFactory(faceObjectProviders, animationObjects); } @@ -274,8 +274,8 @@ */ @NotNull @Override - public ArchetypeSet newArchetypeSet(@NotNull final GlobalSettings globalSettings, @NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final FaceObjectProviders faceObjectProviders) { - return new ArchetypeSet(archetypeFactory, gameObjectParser, faceObjectProviders); + public ArchetypeSet newArchetypeSet(@NotNull final GlobalSettings globalSettings, @NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final FaceObjectProviders faceObjectProviders) { + return new ArchetypeSet(archetypeFactory, faceObjectProviders); } /** @@ -292,15 +292,15 @@ */ @NotNull @Override - public FaceObjects createFaceObjects(@NotNull final ArchFaceProvider archFaceProvider) { - return new DefaultFaceObjects(IGUIConstants.PNG_FILE, IGUIConstants.FACETREE_FILE, Pattern.compile("^(.*)"), "%2$s", archFaceProvider); + public FaceObjects<GameObject, MapArchObject, Archetype> createFaceObjects(@NotNull final ArchFaceProvider archFaceProvider) { + return new DefaultFaceObjects<GameObject, MapArchObject, Archetype>(IGUIConstants.PNG_FILE, IGUIConstants.FACETREE_FILE, Pattern.compile("^(.*)"), "%2$s", archFaceProvider); } /** * {@inheritDoc} */ @Override - public void initSmoothFaces(@NotNull final FaceObjects faceObjects) { + public void initSmoothFaces(@NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects) { } /** @@ -397,7 +397,7 @@ * {@inheritDoc} */ @Override - public ArchetypeParser newArchetypeParser(@NotNull final ErrorView errorView, final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, final AnimationObjects animationObjects, final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GlobalSettings globalSettings) { + public ArchetypeParser newArchetypeParser(@NotNull final ErrorView errorView, final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GlobalSettings globalSettings) { try { final URL url = IOUtils.getResource(globalSettings.getConfigurationDirectory(), IGUIConstants.ARCHDEF_FILE); multiPositionData.load(errorView, url); @@ -502,7 +502,7 @@ */ @NotNull @Override - public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final ScriptExecutor<GameObject, MapArchObject, Archetype> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapControlFactory<GameObject, MapArchObject, Archetype> mapControlFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { + public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final ScriptExecutor<GameObject, MapArchObject, Archetype> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapControlFactory<GameObject, MapArchObject, Archetype> mapControlFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { return mainControl.createGUIMainControl(GuiFileFilters.pythonFileFilter, ".py", true, mapManager, pickmapManager, archetypeSet, mapControlFactory, guiUtils.getResourceIcon(IGUIConstants.TILE_NORTH), "AtrinikEditor.jar", new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_ALTAR_TRIGGER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_SPAWN_POINT, Archetype.TYPE_CONTAINER, }, PREFERENCES_VALIDATOR_AUTO_DEFAULT, IGUIConstants.SPELL_FILE, this, errorView, new SubDirectoryCacheFiles(".dedit"), configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, -1, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, IGUIConstants.SCRIPTS_DIR, scriptModel, animationObjects, archetypeChooserModel, false, scriptedEventEditor, new Direction[] { Direction.NORTH_EAST, Direction.SOUTH_EAST, Direction.SOUTH_WEST, Direction.NORTH_WEST, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.NORTH, }, resources, gameObjectSpells, numberSpells, attributeRangeChecker, pluginParameterFactory); } @@ -511,7 +511,7 @@ */ @NotNull @Override - public AbstractResources<GameObject, MapArchObject, Archetype> newResources(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders) { + public AbstractResources<GameObject, MapArchObject, Archetype> newResources(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders) { return new DefaultResources(gameObjectParser, archetypeSet, archetypeParser, mapViewSettings, faceObjects, animationObjects, archFaceProvider, faceObjectProviders); } @@ -520,8 +520,8 @@ */ @NotNull @Override - public AnimationObjects newAnimationObjects() { - return new DefaultAnimationObjects(IGUIConstants.ANIMTREE_FILE); + public AnimationObjects<GameObject, MapArchObject, Archetype> newAnimationObjects() { + return new DefaultAnimationObjects<GameObject, MapArchObject, Archetype>(IGUIConstants.ANIMTREE_FILE); } } // class DefaultEditorFactory Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeSet.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeSet.java 2010-06-24 00:59:32 UTC (rev 8436) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeSet.java 2010-06-24 02:44:24 UTC (rev 8437) @@ -40,27 +40,19 @@ public class ArchetypeSet extends AbstractArchetypeSet<GameObject, MapArchObject, Archetype> { /** - * The game object parser for saving inventories. - */ - @NotNull - private final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser; - - /** * Create the ArchetypeSet. * @param archetypeFactory the archetype factory instance to use - * @param gameObjectParser the game object parser to use * @param faceObjectProviders the face object providers */ - public ArchetypeSet(@NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final FaceObjectProviders faceObjectProviders) { + public ArchetypeSet(@NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final FaceObjectProviders faceObjectProviders) { super(archetypeFactory, IGUIConstants.ARCH_FILE, faceObjectProviders); - this.gameObjectParser = gameObjectParser; } /** * {@inheritDoc} */ @Override - protected int collectArch(@NotNull final Archetype arch, @NotNull final Writer out) throws IOException { + protected int collectArch(@NotNull final Archetype arch, @NotNull final Writer out, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser) throws IOException { out.append("Object ").append(arch.getArchetypeName()).append('\n'); if (arch.getMultiShapeID() > 0) { 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-24 00:59:32 UTC (rev 8436) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/DefaultArchetype.java 2010-06-24 02:44:24 UTC (rev 8437) @@ -44,7 +44,7 @@ * faces * @param animationObjects the animation objects for looking up animations */ - public DefaultArchetype(@NotNull final String archetypeName, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects) { + public DefaultArchetype(@NotNull final String archetypeName, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects) { super(archetypeName, faceObjectProviders, animationObjects); } Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/DefaultArchetypeFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/DefaultArchetypeFactory.java 2010-06-24 00:59:32 UTC (rev 8436) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/DefaultArchetypeFactory.java 2010-06-24 02:44:24 UTC (rev 8437) @@ -42,7 +42,7 @@ * The {@link AnimationObjects} for looking up animations. */ @NotNull - private final AnimationObjects animationObjects; + private final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects; /** * Creates a new instance. @@ -50,7 +50,7 @@ * faces * @param animationObjects the animation objects for looking up animations */ - public DefaultArchetypeFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects) { + public DefaultArchetypeFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects) { this.faceObjectProviders = faceObjectProviders; this.animationObjects = animationObjects; } 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-24 00:59:32 UTC (rev 8436) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/UndefinedArchetype.java 2010-06-24 02:44:24 UTC (rev 8437) @@ -45,7 +45,7 @@ * faces * @param animationObjects the animation objects for looking up animations */ - public UndefinedArchetype(@NotNull final String archetypeName, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects) { + public UndefinedArchetype(@NotNull final String archetypeName, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects) { super(archetypeName, faceObjectProviders, animationObjects); setEditorFolder(net.sf.gridarta.model.gameobject.GameObject.EDITOR_FOLDER_INTERN); } Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java 2010-06-24 00:59:32 UTC (rev 8436) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java 2010-06-24 02:44:24 UTC (rev 8437) @@ -46,7 +46,7 @@ * The {@link AnimationObjects} for looking up animations. */ @NotNull - private final AnimationObjects animationObjects; + private final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects; /** * The {@link ArchetypeTypeSet} for looking up archetype types. @@ -61,7 +61,7 @@ * @param archetypeTypeSet the archetype type set for looking up archetype * types */ - public DefaultGameObjectFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet archetypeTypeSet) { + public DefaultGameObjectFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchetypeTypeSet archetypeTypeSet) { this.faceObjectProviders = faceObjectProviders; this.animationObjects = animationObjects; this.archetypeTypeSet = archetypeTypeSet; @@ -79,18 +79,8 @@ /** * {@inheritDoc} */ - @Deprecated @NotNull @Override - public GameObject newGameObject(@NotNull final String archetypeName) { - return new GameObject(archetypeName, faceObjectProviders, animationObjects, archetypeTypeSet); - } - - /** - * {@inheritDoc} - */ - @NotNull - @Override public GameObject createGameObject(@NotNull final Archetype archetype) { return createGameObjectPart(archetype, null); } 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-24 00:59:32 UTC (rev 8436) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java 2010-06-24 02:44:24 UTC (rev 8437) @@ -54,21 +54,6 @@ /** * Creates a new instance. - * @param archetypeName the name of the base archetype - * @param faceObjectProviders the face face object providers for looking up - * faces - * @param animationObjects the animation objects for looking up animations - * @param archetypeTypeSet the archetype type set for looking up archetype - * types - */ - @Deprecated - public GameObject(@NotNull final String archetypeName, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet archetypeTypeSet) { - super(archetypeName, faceObjectProviders, animationObjects); - this.archetypeTypeSet = archetypeTypeSet; - } - - /** - * Creates a new instance. * @param archetype the base archetype * @param faceObjectProviders the face object providers for looking up * faces @@ -76,7 +61,7 @@ * @param archetypeTypeSet the archetype type set for looking up archetype * types */ - public GameObject(@NotNull final Archetype archetype, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet archetypeTypeSet) { + public GameObject(@NotNull final Archetype archetype, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchetypeTypeSet archetypeTypeSet) { super(archetype, faceObjectProviders, animationObjects); this.archetypeTypeSet = archetypeTypeSet; } Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/DefaultGameObjectParser.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/DefaultGameObjectParser.java 2010-06-24 00:59:32 UTC (rev 8436) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/DefaultGameObjectParser.java 2010-06-24 02:44:24 UTC (rev 8437) @@ -21,6 +21,7 @@ import java.util.LinkedHashMap; import java.util.Map; +import net.sf.gridarta.model.archetype.ArchetypeSet; import net.sf.gridarta.model.gameobject.GameObjectFactory; import net.sf.gridarta.model.io.AbstractGameObjectParser; import net.sf.gridarta.model.match.GameObjectMatchers; @@ -41,9 +42,10 @@ * @param gameObjectFactory the game object factory for creating new game * object instances * @param gameObjectMatchers the game object matchers to use + * @param archetypeSet the archetype set for looking up archetypes */ - public DefaultGameObjectParser(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GameObjectMatchers gameObjectMatchers) { - super(gameObjectFactory, gameObjectMatchers); + public DefaultGameObjectParser(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { + super(gameObjectFactory, gameObjectMatchers, archetypeSet); } /** Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/DefaultGameObjectParserFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/DefaultGameObjectParserFactory.java 2010-06-24 00:59:32 UTC (rev 8436) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/DefaultGameObjectParserFactory.java 2010-06-24 02:44:24 UTC (rev 8437) @@ -19,6 +19,7 @@ package net.sf.gridarta.var.atrinik.model.io; +import net.sf.gridarta.model.archetype.ArchetypeSet; import net.sf.gridarta.model.gameobject.GameObjectFactory; import net.sf.gridarta.model.io.GameObjectParser; import net.sf.gridarta.model.io.GameObjectParserFactory; @@ -47,13 +48,21 @@ private final GameObjectMatchers gameObjectMatchers; /** + * The {@link ArchetypeSet} for looking up archetypes. + */ + @NotNull + private final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet; + + /** * Creates a new instance. * @param gameObjectFactory the game object factory to use * @param gameObjectMatchers the game object matchers to use + * @param archetypeSet the archetype set for looking up archetypes */ - public DefaultGameObjectParserFactory(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GameObjectMatchers gameObjectMatchers) { + public DefaultGameObjectParserFactory(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { this.gameObjectFactory = gameObjectFactory; this.gameObjectMatchers = gameObjectMatchers; + this.archetypeSet = archetypeSet; } /** @@ -61,7 +70,7 @@ */ @Override public GameObjectParser<GameObject, MapArchObject, Archetype> newGameObjectParser() { - return new DefaultGameObjectParser(gameObjectFactory, gameObjectMatchers); + return new DefaultGameObjectParser(gameObjectFactory, gameObjectMatchers, archetypeSet); } } // class DefaultGameObjectParserFactory Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java 2010-06-24 00:59:32 UTC (rev 8436) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java 2010-06-24 02:44:24 UTC (rev 8437) @@ -49,6 +49,12 @@ public class DefaultResources extends AbstractResources<GameObject, MapArchObject, Archetype> { /** + * The {@link GameObjectParser} to use. + */ + @NotNull + private final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser; + + /** * The {@link ArchetypeSet} to update. */ @NotNull @@ -64,13 +70,13 @@ * The {@link FaceObjects} instance. */ @NotNull - private final FaceObjects faceObjects; + private final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects; /** * The {@link AnimationObjects} instance. */ @NotNull - private final AnimationObjects animationObjects; + private final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects; /** * The {@link ArchFaceProvider} to use. @@ -96,8 +102,9 @@ * @param faceObjectProviders the face object providers for looking up * faces */ - public DefaultResources(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders) { + public DefaultResources(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders) { super(gameObjectParser, archetypeSet, mapViewSettings); + this.gameObjectParser = gameObjectParser; this.archetypeSet = archetypeSet; this.archetypeParser = archetypeParser; this.faceObjects = faceObjects; @@ -129,7 +136,7 @@ */ @Override protected void writeCollectedInt(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { - new CollectedResourcesWriter(archetypeSet, animationObjects, faceObjects).write(progress, collectedDirectory); + new CollectedResourcesWriter<GameObject, MapArchObject, Archetype>(gameObjectParser, archetypeSet, animationObjects, faceObjects).write(progress, collectedDirectory); } /** Modified: trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java =================================================================== --- trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java 2010-06-24 00:59:32 UTC (rev 8436) +++ trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java 2010-06-24 02:44:24 UTC (rev 8437) @@ -118,19 +118,20 @@ @Override protected AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ? extends AbstractArchetypeBuilder<GameObject, MapArchObject, Archetype>> newArchetypeParser() { final ArchFaceProvider archFaceProvider = new ArchFaceProvider(); - final FaceObjects faceObjects = new DefaultFaceObjects("png", "facetree", Pattern.compile(".*"), "facetree.output", archFaceProvider); + final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects = new DefaultFaceObjects<GameObject, MapArchObject, Archetype>("png", "facetree", Pattern.compile(".*"), "facetree.output", archFaceProvider); final GUIUtils guiUtils = new GUIUtils(); final SystemIcons systemIcons = new SystemIcons(guiUtils); final FaceObjectProviders faceObjectProviders = new FaceObjectProviders(0, faceObjects, systemIcons); - final AnimationObjects animationObjects = new DefaultAnimationObjects("animtree"); + final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects = new DefaultAnimationObjects<GameObject, MapArchObject, Archetype>("animtree"); final ArchetypeTypeSet archetypeTypeSet = new ArchetypeTypeSet(); final DefaultGameObjectFactory gameObjectFactory = new DefaultGameObjectFactory(faceObjectProviders, animationObjects, archetypeTypeSet); final DefaultArchetypeFactory archetypeFactory = new DefaultArchetypeFactory(faceObjectProviders, animationObjects); final GameObjectMatchers gameObjectMatchers = new GameObjectMatchers(); - final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser = new DefaultGameObjectParser(gameObjectFactory, gameObjectMatchers); - archetypeSet = new ArchetypeSet(archetypeFactory, gameObjectParser, faceObjectProviders); + archetypeSet = new ArchetypeSet(archetypeFactory, faceObjectProviders); archetypeSet.setLoadedFromArchive(true); assert archetypeSet != null; + final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser = new DefaultGameObjectParser(gameObjectFactory, gameObjectMatchers, archetypeSet); + assert archetypeSet != null; final IsoMapSquareInfo isoMapSquareInfo = new IsoMapSquareInfo(1, 1, 1, 1); final MultiPositionData multiPositionData = new MultiPositionData(isoMapSquareInfo); assert archetypeSet != null; Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2010-06-24 00:59:32 UTC (rev 8436) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2010-06-24 02:44:24 UTC (rev 8437) @@ -194,7 +194,7 @@ */ @NotNull @Override - public GameObjectFactory<GameObject, MapArchObject, Archetype> newGameObjectFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet archetypeTypeSet) { + public GameObjectFactory<GameObject, MapArchObject, Archetype> newGameObjectFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchetypeTypeSet archetypeTypeSet) { return new DefaultGameObjectFactory(faceObjectProviders, animationObjects); } @@ -203,8 +203,8 @@ */ @NotNull @Override - public GameObjectParserFactory<GameObject, MapArchObject, Archetype> newGameObjectParserFactory(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GameObjectMatchers gameObjectMatchers) { - return new DefaultGameObjectParserFactory(gameObjectFactory, gameObjectMatchers); + public GameObjectParserFactory<GameObject, MapArchObject, Archetype> newGameObjectParserFactory(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { + return new DefaultGameObjectParserFactory(gameObjectFactory, gameObjectMatchers, archetypeSet); } /** @@ -221,7 +221,7 @@ */ @NotNull @Override - public ArchetypeFactory<GameObject, MapArchObject, Archetype> newArchetypeFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects) { + public ArchetypeFactory<GameObject, MapArchObject, Archetype> newArchetypeFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects) { return new DefaultArchetypeFactory(faceObjectProviders, animationObjects); } @@ -230,8 +230,8 @@ */ @NotNull @Override - public ArchetypeSet newArchetypeSet(@NotNull final GlobalSettings globalSettings, @NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final FaceObjectProviders faceObjectProviders) { - return new ArchetypeSet(globalSettings.getImageSet(), archetypeFactory, gameObjectParser, faceObjectProviders); + public ArchetypeSet newArchetypeSet(@NotNull final GlobalSettings globalSettings, @NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final FaceObjectProviders faceObjectProviders) { + return new ArchetypeSet(globalSettings.getImageSet(), archetypeFactory, faceObjectProviders); } /** @@ -248,15 +248,15 @@ */ @NotNull @Override - public FaceObjects createFaceObjects(@NotNull final ArchFaceProvider archFaceProvider) { - return new DefaultFaceObjects(IGUIConstants.PNG_FILE, IGUIConstants.FACETREE_FILE, Pattern.compile("^.*\t\\.?(.*)"), "\\%1$05d\t./arch%2$s", archFaceProvider); + public FaceObjects<GameObject, MapArchObject, Archetype> createFaceObjects(@NotNull final ArchFaceProvider archFaceProvider) { + return new DefaultFaceObjects<GameObject, MapArchObject, Archetype>(IGUIConstants.PNG_FILE, IGUIConstants.FACETREE_FILE, Pattern.compile("^.*\t\\.?(.*)"), "\\%1$05d\t./arch%2$s", archFaceProvider); } /** * {@inheritDoc} */ @Override - public void initSmoothFaces(@NotNull final FaceObjects faceObjects) { + public void initSmoothFaces(@NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects) { if (smoothFaces != null) { throw new IllegalStateException(); } @@ -292,7 +292,7 @@ * {@inheritDoc} */ @Override - public ArchetypeParser newArchetypeParser(@NotNull final ErrorView errorView, final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, final AnimationObjects animationObjects, final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GlobalSettings globalSettings) { + public ArchetypeParser newArchetypeParser(@NotNull final ErrorView errorView, final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GlobalSettings globalSettings) { if (smoothFaces == null) { throw new IllegalStateException(); } @@ -398,7 +398,7 @@ */ @NotNull @Override - public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final ScriptExecutor<GameObject, MapArchObject, Archetype> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapControlFactory<GameObject, MapArchObject, Archetype> mapControlFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { + public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final ScriptExecutor<GameObject, MapArchObject, Archetype> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapControlFactory<GameObject, MapArchObject, Archetype> mapControlFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { return mainControl.createGUIMainControl(GuiFileFilters.pythonFileFilter, ".py", false, mapManager, pickmapManager, archetypeSet, mapControlFactory, null, "CrossfireEditor.jar", new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_TRIGGER_ALTAR, Archetype.TYPE_DETECTOR, Archetype.TYPE_TRIGGER_MARKER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_CONTAINER, }, PREFERENCES_VALIDATOR_AUTO_DEFAULT, null, this, errorView, new DirectoryCacheFiles(ConfigFileUtils.getHomeFile("thumbnails"), ".png"), configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, 0, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, IGUIConstants.SCRIPTS_DIR, scriptModel, animationObjects, archetypeChooserModel, true, scriptedEventEditor, new Direction[] { Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.NORTH_EAST, Direction.SOUTH_EAST, Direction.SOUTH_WEST, Direction.NORTH_WEST, }, resources, gameObjectSpells, numberSpells, attributeRangeChecker, pluginParameterFactory); } @@ -407,7 +407,7 @@ */ @NotNull @Override - public AbstractResources<GameObject, MapArchObject, Archetype> newResources(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders) { + public AbstractResources<GameObject, MapArchObject, Archetype> newResources(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders) { if (smoothFaces == null) { throw new IllegalStateException(); } @@ -419,8 +419,8 @@ */ @NotNull @Override - public AnimationObjects newAnimationObjects() { - return new DefaultAnimationObjects(IGUIConstants.ANIMTREE_FILE); + public AnimationObjects<GameObject, MapArchObject, Archetype> newAnimationObjects() { + return new DefaultAnimationObjects<GameObject, MapArchObject, Archetype>(IGUIConstants.ANIMTREE_FILE); } } // class DefaultEditorFactory Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParser.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParser.java 2010-06-24 00:59:32 UTC (rev 8436) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParser.java 2010-06-24 02:44:24 UTC (rev 8437) @@ -91,7 +91,7 @@ * @param gameObjectFactory the factory for creating game objects * @param smoothFaces the smooth faces instance to update */ - public ArchetypeParser(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SmoothFaces smoothFaces) { + public ArchetypeParser(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SmoothFaces smoothFaces) { super(new DefaultArchetypeBuilder(gameObjectFactory), animationObjects, archetypeSet); this.gameObjectParser = gameObjectParser; this.smoothFaces = smoothFaces; Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeSet.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeSet.java 2010-06-24 00:59:32 UTC (rev 8436) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeSet.java 2010-06-24 02:44:24 UTC (rev 8437) @@ -46,29 +46,21 @@ private final String imageSet; /** - * The game object parser for saving inventories. - */ - @NotNull - private final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser; - - /** * Create the ArchetypeSet. * @param imageSet the image set to use * @param archetypeFactory the archetype factory to use - * @param gameObjectParser the game object parser to use * @param faceObjectProviders the face object providers */ - public ArchetypeSet(@NotNull final String imageSet, @NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final FaceObjectProviders faceObjectProviders) { + public ArchetypeSet(@NotNull final String imageSet, @NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final FaceObjectProviders faceObjectProviders) { super(archetypeFactory, IGUIConstants.ARCH_FILE, faceObjectProviders); this.imageSet = imageSet.equals("none") ? null : imageSet; - this.gameObjectParser = gameObjectParser; } /** * {@inheritDoc} */ @Override - protected int collectArch(@NotNull final Archetype arch, @NotNull final Writer out) throws IOException { + protected int collectArch(@NotNull final Archetype arch, @NotNull final Writer out, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser) throws IOException { out.append("Object ").append(arch.getArchetypeName()).append('\n'); // special: add a string-attribute with the display-category Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/DefaultArchetype.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/DefaultArchetype.java 2010-06-24 00:59:32 UTC (rev 8436) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/DefaultArchetype.java 2010-06-24 02:44:24 UTC (rev 8437) @@ -44,7 +44,7 @@ * faces * @param animationObjects the animation objects for looking up animations */ - public DefaultArchetype(@NotNull final String archetypeName, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects) { + public DefaultArchetype(@NotNull final String archetypeName, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects) { super(archetypeName, faceObjectProviders, animationObjects); } Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/DefaultArchetypeFactory.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/DefaultArchetypeFactory.java 2010-06-24 00:59:32 UTC (rev 8436) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/DefaultArchetypeFactory.java 2010-06-24 02:44:24 UTC (rev 8437) @@ -42,7 +42,7 @@ * The {@link AnimationObjects} for looking up animations. */ @NotNull - private final AnimationObjects animationObjects; + private final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects; /** * Creates a new instance. @@ -50,7 +50,7 @@ * faces * @param animationObjects the animation objects for looking up animations */ - public DefaultArchetypeFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects) { + public DefaultArchetypeFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects) { this.faceObjectProviders = faceObjectProviders; this.animationObjects = animationObjects; } 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-24 00:59:32 UTC (rev 8436) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/UndefinedArchetype.java 2010-06-24 02:44:24 UTC (rev 8437) @@ -45,7 +45,7 @@ * faces * @param animationObjects the animation objects for looking up animations */ - public UndefinedArchetype(@NotNull final String archetypeName, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects) { + ... [truncated message content] |
From: <aki...@us...> - 2010-06-24 00:59:39
|
Revision: 8436 http://gridarta.svn.sourceforge.net/gridarta/?rev=8436&view=rev Author: akirschbaum Date: 2010-06-24 00:59:32 +0000 (Thu, 24 Jun 2010) Log Message: ----------- Disable buttons in selected square view if the operation is not applicable. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java Modified: trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java 2010-06-24 00:44:52 UTC (rev 8435) +++ trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java 2010-06-24 00:59:32 UTC (rev 8436) @@ -299,7 +299,7 @@ /** {@inheritDoc} */ @Override public void selectedGameObjectChanged(@Nullable final G gameObject) { - // ignore + updateActions(); } /** {@inheritDoc} */ @@ -414,6 +414,8 @@ mapManager.addMapManagerListener(mapManagerListener); mapViewManager.addMapViewManagerListener(mapViewManagerListener); selectedSquareModel.addSelectedSquareListener(selectedSquareModelListener); + + updateActions(); } /** @@ -465,6 +467,18 @@ } /** + * Updates the enabled state of all actions. + */ + private void updateActions() { + aMoveSquareTop.setEnabled(selectedSquareActions.doMoveSquareTop(false)); + aMoveSquareUp.setEnabled(selectedSquareActions.doMoveSquareUp(false)); + aMoveSquareDown.setEnabled(selectedSquareActions.doMoveSquareDown(false)); + aMoveSquareBottom.setEnabled(selectedSquareActions.doMoveSquareBottom(false)); + aMoveSquareEnv.setEnabled(selectedSquareActions.doMoveSquareEnv(false)); + aMoveSquareInv.setEnabled(selectedSquareActions.doMoveSquareInv(false)); + } + + /** * Re-display the map square panel for {@link SelectedSquareModel#selectedMapSquare}. * Possibly updates information in <code>selectedMapSquare</code>. */ @@ -475,6 +489,7 @@ } finally { list.setEnabled(true); } + updateActions(); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |