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...> - 2013-05-28 19:12:50
|
Revision: 9235 http://sourceforge.net/p/gridarta/code/9235 Author: akirschbaum Date: 2013-05-28 19:12:45 +0000 (Tue, 28 May 2013) Log Message: ----------- Rename and move source directories. Modified Paths: -------------- trunk/atrinik/atrinik.iml trunk/build.xml trunk/crossfire/crossfire.iml trunk/daimonin/daimonin.iml trunk/gridarta.iml trunk/model/model.iml trunk/plugin/plugin.iml trunk/preferences/preferences.iml trunk/textedit/textedit.iml trunk/utils/utils.iml Added Paths: ----------- trunk/atrinik/src/main/ trunk/atrinik/src/main/java/ trunk/atrinik/src/main/resources/ trunk/atrinik/src/test/java/ trunk/atrinik/src/test/java/net/ trunk/atrinik/src/test/resources/ trunk/crossfire/src/main/ trunk/crossfire/src/main/java/ trunk/crossfire/src/main/resources/ trunk/crossfire/src/test/java/ trunk/crossfire/src/test/java/net/ trunk/crossfire/src/test/resources/ trunk/daimonin/src/main/ trunk/daimonin/src/main/java/ trunk/daimonin/src/main/resources/ trunk/daimonin/src/test/java/ trunk/daimonin/src/test/java/net/ trunk/daimonin/src/test/resources/ trunk/model/src/main/ trunk/model/src/main/java/ trunk/model/src/main/resources/ trunk/model/src/test/java/ trunk/model/src/test/java/net/ trunk/model/src/test/resources/ trunk/plugin/src/main/ trunk/plugin/src/main/java/ trunk/plugin/src/main/resources/ trunk/plugin/src/test/java/ trunk/plugin/src/test/resources/ trunk/preferences/src/main/ trunk/preferences/src/main/java/ trunk/preferences/src/main/resources/ trunk/preferences/src/test/java/ trunk/preferences/src/test/resources/ trunk/src/main/ trunk/src/main/java/ trunk/src/main/resources/ trunk/src/test/java/ trunk/src/test/java/net/ trunk/src/test/resources/ trunk/textedit/src/main/ trunk/textedit/src/main/java/ trunk/textedit/src/main/resources/ trunk/textedit/src/test/java/ trunk/textedit/src/test/resources/ trunk/utils/src/main/ trunk/utils/src/main/java/ trunk/utils/src/main/resources/ trunk/utils/src/test/java/ trunk/utils/src/test/java/net/ trunk/utils/src/test/resources/ Removed Paths: ------------- trunk/atrinik/src/app/ trunk/atrinik/src/test/net/ trunk/crossfire/src/app/ trunk/crossfire/src/test/net/ trunk/daimonin/src/app/ trunk/daimonin/src/test/net/ trunk/model/src/app/ trunk/model/src/test/net/ trunk/plugin/src/app/ trunk/preferences/src/app/ trunk/src/app/ trunk/src/test/net/ trunk/textedit/src/app/ trunk/utils/src/app/ trunk/utils/src/test/net/ Modified: trunk/atrinik/atrinik.iml =================================================================== --- trunk/atrinik/atrinik.iml 2013-05-28 18:39:34 UTC (rev 9234) +++ trunk/atrinik/atrinik.iml 2013-05-28 19:12:45 UTC (rev 9235) @@ -4,8 +4,10 @@ <exclude-output /> <content url="file://$MODULE_DIR$"> <sourceFolder url="file://$MODULE_DIR$/resource" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/src/app" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/src/test" isTestSource="true" /> + <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> + <sourceFolder url="file://$MODULE_DIR$/src/test/resources" isTestSource="true" /> + <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" /> <excludeFolder url="file://$MODULE_DIR$/class" /> </content> <orderEntry type="inheritedJdk" /> Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2013-05-28 18:39:34 UTC (rev 9234) +++ trunk/build.xml 2013-05-28 19:12:45 UTC (rev 9235) @@ -327,7 +327,7 @@ <target name="compile-atrinik" description="Compiles the atrinik module." depends="compile-gridarta,compile-model,compile-preferences,compile-plugin,compile-utils"> <mkdir dir="${build.dir}/atrinik/app"/> - <javac srcdir="atrinik/src/app" destdir="${build.dir}/atrinik/app" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="${debug}"> + <javac srcdir="atrinik/src/main/java" destdir="${build.dir}/atrinik/app" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="${debug}"> <classpath> <path refid="path.class.gridarta.app"/> <path refid="path.class.model.app"/> @@ -342,10 +342,10 @@ <compilerarg line="${javac.args}"/> </javac> <copy todir="${build.dir}/atrinik/app"> - <fileset dir="atrinik/src/app" includes="**/*.properties"/> + <fileset dir="atrinik/src/main/java" includes="**/*.properties"/> </copy> <mkdir dir="${build.dir}/atrinik/test"/> - <javac srcdir="atrinik/src/test" destdir="${build.dir}/atrinik/test" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> + <javac srcdir="atrinik/src/test/java" destdir="${build.dir}/atrinik/test" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> <classpath> <path refid="path.class.atrinik.app"/> <path refid="path.class.gridarta.test"/> @@ -358,13 +358,13 @@ <compilerarg line="${javac.args}"/> </javac> <copy todir="${build.dir}/atrinik/test"> - <fileset dir="atrinik/src/test" includes="**/*.properties"/> + <fileset dir="atrinik/src/test/java" includes="**/*.properties"/> </copy> </target> <target name="compile-crossfire" description="Compiles the crossfire module." depends="compile-gridarta,compile-model,compile-preferences,compile-plugin,compile-utils"> <mkdir dir="${build.dir}/crossfire/app"/> - <javac srcdir="crossfire/src/app" destdir="${build.dir}/crossfire/app" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="${debug}"> + <javac srcdir="crossfire/src/main/java" destdir="${build.dir}/crossfire/app" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="${debug}"> <classpath> <path refid="path.class.gridarta.app"/> <path refid="path.class.model.app"/> @@ -379,10 +379,10 @@ <compilerarg line="${javac.args}"/> </javac> <copy todir="${build.dir}/crossfire/app"> - <fileset dir="crossfire/src/app" includes="**/*.properties"/> + <fileset dir="crossfire/src/main/java" includes="**/*.properties"/> </copy> <mkdir dir="${build.dir}/crossfire/test"/> - <javac srcdir="crossfire/src/test" destdir="${build.dir}/crossfire/test" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> + <javac srcdir="crossfire/src/test/java" destdir="${build.dir}/crossfire/test" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> <classpath> <path refid="path.class.crossfire.app"/> <path refid="path.class.gridarta.test"/> @@ -395,13 +395,13 @@ <compilerarg line="${javac.args}"/> </javac> <copy todir="${build.dir}/crossfire/test"> - <fileset dir="crossfire/src/test" includes="**/*.properties"/> + <fileset dir="crossfire/src/test/java" includes="**/*.properties"/> </copy> </target> <target name="compile-daimonin" description="Compiles the daimonin module." depends="compile-gridarta,compile-model,compile-plugin,compile-utils"> <mkdir dir="${build.dir}/daimonin/app"/> - <javac srcdir="daimonin/src/app" destdir="${build.dir}/daimonin/app" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="${debug}"> + <javac srcdir="daimonin/src/main/java" destdir="${build.dir}/daimonin/app" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="${debug}"> <classpath> <path refid="path.class.gridarta.app"/> <path refid="path.class.model.app"/> @@ -416,10 +416,10 @@ <compilerarg line="${javac.args}"/> </javac> <copy todir="${build.dir}/daimonin/test"> - <fileset dir="daimonin/src/test" includes="**/*.properties"/> + <fileset dir="daimonin/src/test/java" includes="**/*.properties"/> </copy> <mkdir dir="${build.dir}/daimonin/test"/> - <javac srcdir="daimonin/src/test" destdir="${build.dir}/daimonin/test" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> + <javac srcdir="daimonin/src/test/java" destdir="${build.dir}/daimonin/test" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> <classpath> <path refid="path.class.daimonin.app"/> <path refid="path.class.gridarta.test"/> @@ -430,13 +430,13 @@ <compilerarg line="${javac.args}"/> </javac> <copy todir="${build.dir}/daimonin/app"> - <fileset dir="daimonin/src/app" includes="**/*.properties"/> + <fileset dir="daimonin/src/main/java" includes="**/*.properties"/> </copy> </target> <target name="compile-gridarta" description="Compiles the gridarta module." depends="compile-model,compile-preferences,compile-plugin,compile-textedit,compile-utils"> <mkdir dir="${build.dir}/gridarta/app"/> - <javac srcdir="src/app" destdir="${build.dir}/gridarta/app" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="${debug}"> + <javac srcdir="src/main/java" destdir="${build.dir}/gridarta/app" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="${debug}"> <classpath> <path refid="path.class.model.app"/> <path refid="path.class.preferences.app"/> @@ -460,10 +460,10 @@ <compilerarg line="${javac.args}"/> </javac> <copy todir="${build.dir}/gridarta/test"> - <fileset dir="src/test" includes="**/*.properties,cfpython_menu.def"/> + <fileset dir="src/test/java" includes="**/*.properties,cfpython_menu.def"/> </copy> <mkdir dir="${build.dir}/gridarta/test"/> - <javac srcdir="src/test" destdir="${build.dir}/gridarta/test" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> + <javac srcdir="src/test/java" destdir="${build.dir}/gridarta/test" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> <classpath> <path refid="path.class.gridarta.app"/> <path refid="path.class.model.test"/> @@ -477,13 +477,13 @@ <compilerarg line="${javac.args}"/> </javac> <copy todir="${build.dir}/gridarta/app"> - <fileset dir="src/app" includes="**/*.properties,cfpython_menu.def"/> + <fileset dir="src/main/java" includes="**/*.properties,cfpython_menu.def"/> </copy> </target> <target name="compile-model" description="Compiles the model module." depends="compile-utils"> <mkdir dir="${build.dir}/model/app"/> - <javac srcdir="model/src/app" destdir="${build.dir}/model/app" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="${debug}"> + <javac srcdir="model/src/main/java" destdir="${build.dir}/model/app" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="${debug}"> <classpath> <path refid="path.class.utils.app"/> <path refid="path.lib.annotations"/> @@ -497,10 +497,10 @@ <compilerarg line="${javac.args}"/> </javac> <copy todir="${build.dir}/model/test"> - <fileset dir="model/src/test" includes="**/*.properties"/> + <fileset dir="model/src/test/java" includes="**/*.properties"/> </copy> <mkdir dir="${build.dir}/model/test"/> - <javac srcdir="model/src/test" destdir="${build.dir}/model/test" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> + <javac srcdir="model/src/test/java" destdir="${build.dir}/model/test" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> <classpath> <path refid="path.class.model.app"/> <path refid="path.class.utils.test"/> @@ -514,13 +514,13 @@ <compilerarg line="${javac.args}"/> </javac> <copy todir="${build.dir}/model/app"> - <fileset dir="model/src/app" includes="**/*.properties"/> + <fileset dir="model/src/main/java" includes="**/*.properties"/> </copy> </target> <target name="compile-preferences" description="Compiles the preferences module."> <mkdir dir="${build.dir}/preferences/app"/> - <javac srcdir="preferences/src/app" destdir="${build.dir}/preferences/app" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="${debug}"> + <javac srcdir="preferences/src/main/java" destdir="${build.dir}/preferences/app" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="${debug}"> <classpath> <path refid="path.lib.annotations"/> <path refid="path.lib.japi-swing-action"/> @@ -529,23 +529,23 @@ <compilerarg line="${javac.args}"/> </javac> <copy todir="${build.dir}/preferences/test"> - <fileset dir="preferences/src/test" includes="**/*.properties"/> + <fileset dir="preferences/src/test/java" includes="**/*.properties"/> </copy> <mkdir dir="${build.dir}/preferences/test"/> - <javac srcdir="preferences/src/test" destdir="${build.dir}/preferences/test" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> + <javac srcdir="preferences/src/test/java" destdir="${build.dir}/preferences/test" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> <classpath> <path refid="path.class.preferences.app"/> </classpath> <compilerarg line="${javac.args}"/> </javac> <copy todir="${build.dir}/preferences/app"> - <fileset dir="preferences/src/app" includes="**/*.properties"/> + <fileset dir="preferences/src/main/java" includes="**/*.properties"/> </copy> </target> <target name="compile-plugin" description="Compiles the plugin module." depends="compile-model,compile-utils"> <mkdir dir="${build.dir}/plugin/app"/> - <javac srcdir="plugin/src/app" destdir="${build.dir}/plugin/app" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="${debug}"> + <javac srcdir="plugin/src/main/java" destdir="${build.dir}/plugin/app" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="${debug}"> <classpath> <path refid="path.class.model.app"/> <path refid="path.class.utils.app"/> @@ -558,23 +558,23 @@ <compilerarg line="${javac.args}"/> </javac> <copy todir="${build.dir}/plugin/test"> - <fileset dir="plugin/src/test" includes="**/*.properties"/> + <fileset dir="plugin/src/test/java" includes="**/*.properties"/> </copy> <mkdir dir="${build.dir}/plugin/test"/> - <javac srcdir="plugin/src/test" destdir="${build.dir}/plugin/test" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> + <javac srcdir="plugin/src/test/java" destdir="${build.dir}/plugin/test" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> <classpath> <path refid="path.class.plugin.app"/> </classpath> <compilerarg line="${javac.args}"/> </javac> <copy todir="${build.dir}/plugin/app"> - <fileset dir="plugin/src/app" includes="**/*.properties"/> + <fileset dir="plugin/src/main/java" includes="**/*.properties"/> </copy> </target> <target name="compile-textedit" description="Compiles the textedit module." depends="compile-utils"> <mkdir dir="${build.dir}/textedit/app"/> - <javac srcdir="textedit/src/app" destdir="${build.dir}/textedit/app" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="${debug}"> + <javac srcdir="textedit/src/main/java" destdir="${build.dir}/textedit/app" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="${debug}"> <classpath> <path refid="path.class.utils.app"/> <path refid="path.lib.annotations"/> @@ -584,10 +584,10 @@ <compilerarg line="${javac.args}"/> </javac> <copy todir="${build.dir}/textedit/test"> - <fileset dir="textedit/src/test" includes="**/*.properties"/> + <fileset dir="textedit/src/test/java" includes="**/*.properties"/> </copy> <mkdir dir="${build.dir}/textedit/test"/> - <javac srcdir="textedit/src/test" destdir="${build.dir}/textedit/test" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> + <javac srcdir="textedit/src/test/java" destdir="${build.dir}/textedit/test" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> <classpath> <path refid="path.class.textedit.app"/> <path refid="path.class.utils.test"/> @@ -595,13 +595,13 @@ <compilerarg line="${javac.args}"/> </javac> <copy todir="${build.dir}/textedit/app"> - <fileset dir="textedit/src/app" includes="**/*.properties"/> + <fileset dir="textedit/src/main/java" includes="**/*.properties"/> </copy> </target> <target name="compile-utils" description="Compiles the utils module."> <mkdir dir="${build.dir}/utils/app"/> - <javac srcdir="utils/src/app" destdir="${build.dir}/utils/app" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="${debug}"> + <javac srcdir="utils/src/main/java" destdir="${build.dir}/utils/app" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="${debug}"> <classpath> <path refid="path.lib.annotations"/> <path refid="path.lib.japi-swing-action"/> @@ -612,10 +612,10 @@ <compilerarg line="${javac.args}"/> </javac> <copy todir="${build.dir}/utils/test"> - <fileset dir="utils/src/test" includes="**/*.properties"/> + <fileset dir="utils/src/test/java" includes="**/*.properties"/> </copy> <mkdir dir="${build.dir}/utils/test"/> - <javac srcdir="utils/src/test" destdir="${build.dir}/utils/test" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> + <javac srcdir="utils/src/test/java" destdir="${build.dir}/utils/test" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> <classpath> <path refid="path.class.utils.app"/> <path refid="path.lib.annotations"/> @@ -627,7 +627,7 @@ <compilerarg line="${javac.args}"/> </javac> <copy todir="${build.dir}/utils/app"> - <fileset dir="utils/src/app" includes="**/*.properties"/> + <fileset dir="utils/src/main/java" includes="**/*.properties"/> </copy> </target> @@ -674,7 +674,7 @@ <mkdir dir="${build.dir}/doc/api/${project.version}"/> <copy todir="${build.dir}/doc/api/${project.version}" file="src/doc/copyright.xhtml"/> <copy todir="${build.dir}/doc/api/${project.version}" file="src/doc/dev/api/.htaccess"/> - <javadoc destdir="${build.dir}/doc/api/${project.version}" access="protected" author="yes" version="yes" locale="en_US" use="yes" splitindex="yes" windowtitle="Gridarta API documentation" doctitle="Gridarta<br />Yet another Java API<br />API Documentation" header="Gridarta ${project.version}<br />Yet another Java API<br />API Documentation" footer="Gridarta<br />Yet another Java API<br />API Documentation" bottom="<div style="text-align:center;">© 2005-2006 The Gridarta Developers. All rights reserved. See <a href="{@docRoot}/copyright.xhtml">copyright</a></div>" serialwarn="yes" charset="${build.source.encoding}" docencoding="${build.source.encoding}" source="${build.source.version}" encoding="${build.source.encoding}" linksource="yes" overview="src/app/overview.html" link="${user.javadoc.link}"> + <javadoc destdir="${build.dir}/doc/api/${project.version}" access="protected" author="yes" version="yes" locale="en_US" use="yes" splitindex="yes" windowtitle="Gridarta API documentation" doctitle="Gridarta<br />Yet another Java API<br />API Documentation" header="Gridarta ${project.version}<br />Yet another Java API<br />API Documentation" footer="Gridarta<br />Yet another Java API<br />API Documentation" bottom="<div style="text-align:center;">© 2005-2006 The Gridarta Developers. All rights reserved. See <a href="{@docRoot}/copyright.xhtml">copyright</a></div>" serialwarn="yes" charset="${build.source.encoding}" docencoding="${build.source.encoding}" source="${build.source.version}" encoding="${build.source.encoding}" linksource="yes" overview="src/main/java/overview.html" link="${user.javadoc.link}"> <classpath> <fileset dir="atrinik/lib" includes="*.jar" excludes="*.jar-LICENSE"/> <fileset dir="daimonin/lib" includes="*.jar" excludes="*.jar-LICENSE"/> @@ -693,24 +693,24 @@ <path refid="path.class.textedit.test"/> <path refid="path.class.utils.test"/> </sourcepath> - <packageset dir="src/app" defaultexcludes="yes"/> - <packageset dir="src/test" defaultexcludes="yes"/> - <packageset dir="atrinik/src/app" defaultexcludes="yes"/> - <packageset dir="atrinik/src/test" defaultexcludes="yes"/> - <packageset dir="crossfire/src/app" defaultexcludes="yes"/> - <packageset dir="crossfire/src/test" defaultexcludes="yes"/> - <packageset dir="daimonin/src/app" defaultexcludes="yes"/> - <packageset dir="daimonin/src/test" defaultexcludes="yes"/> - <packageset dir="model/src/app" defaultexcludes="yes"/> - <packageset dir="model/src/test" defaultexcludes="yes"/> - <packageset dir="preferences/src/app" defaultexcludes="yes"/> - <packageset dir="preferences/src/test" defaultexcludes="yes"/> - <packageset dir="plugin/src/app" defaultexcludes="yes"/> - <packageset dir="plugin/src/test" defaultexcludes="yes"/> - <packageset dir="textedit/src/app" defaultexcludes="yes"/> - <packageset dir="textedit/src/test" defaultexcludes="yes"/> - <packageset dir="utils/src/app" defaultexcludes="yes"/> - <packageset dir="utils/src/test" defaultexcludes="yes"/> + <packageset dir="src/main/java" defaultexcludes="yes"/> + <packageset dir="src/test/java" defaultexcludes="yes"/> + <packageset dir="atrinik/src/main/java" defaultexcludes="yes"/> + <packageset dir="atrinik/src/test/java" defaultexcludes="yes"/> + <packageset dir="crossfire/src/main/java" defaultexcludes="yes"/> + <packageset dir="crossfire/src/test/java" defaultexcludes="yes"/> + <packageset dir="daimonin/src/main/java" defaultexcludes="yes"/> + <packageset dir="daimonin/src/test/java" defaultexcludes="yes"/> + <packageset dir="model/src/main/java" defaultexcludes="yes"/> + <packageset dir="model/src/test/java" defaultexcludes="yes"/> + <packageset dir="preferences/src/main/java" defaultexcludes="yes"/> + <packageset dir="preferences/src/test/java" defaultexcludes="yes"/> + <packageset dir="plugin/src/main/java" defaultexcludes="yes"/> + <packageset dir="plugin/src/test/java" defaultexcludes="yes"/> + <packageset dir="textedit/src/main/java" defaultexcludes="yes"/> + <packageset dir="textedit/src/test/java" defaultexcludes="yes"/> + <packageset dir="utils/src/main/java" defaultexcludes="yes"/> + <packageset dir="utils/src/test/java" defaultexcludes="yes"/> <tag name="todo" description="Todo:"/> <tag name="used" description="Manually marked as used." enabled="false"/> <tag name="fixme" description="Fixme:"/> @@ -880,24 +880,24 @@ <checkstyle config="src/checkstyle.xml" failOnViolation="true"> <formatter type="plain" tofile="${build.dir}/doc/checkstyle_report.txt"/> <formatter type="plain"/> - <fileset dir="src/app" includes="**/*.java"/> - <fileset dir="src/test" includes="**/*.java"/> - <fileset dir="atrinik/src/app" includes="**/*.java"/> - <fileset dir="atrinik/src/test" includes="**/*.java"/> - <fileset dir="crossfire/src/app" includes="**/*.java"/> - <fileset dir="crossfire/src/test" includes="**/*.java"/> - <fileset dir="daimonin/src/app" includes="**/*.java"/> - <fileset dir="daimonin/src/test" includes="**/*.java"/> - <fileset dir="model/src/app" includes="**/*.java"/> - <fileset dir="model/src/test" includes="**/*.java"/> - <fileset dir="preferences/src/app" includes="**/*.java"/> - <fileset dir="preferences/src/test" includes="**/*.java"/> - <fileset dir="plugin/src/app" includes="**/*.java"/> - <fileset dir="plugin/src/test" includes="**/*.java"/> - <fileset dir="textedit/src/app" includes="**/*.java"/> - <fileset dir="textedit/src/test" includes="**/*.java"/> - <fileset dir="utils/src/app" includes="**/*.java"/> - <fileset dir="utils/src/test" includes="**/*.java"/> + <fileset dir="src/main/java" includes="**/*.java"/> + <fileset dir="src/test/java" includes="**/*.java"/> + <fileset dir="atrinik/src/main/java" includes="**/*.java"/> + <fileset dir="atrinik/src/test/java" includes="**/*.java"/> + <fileset dir="crossfire/src/main/java" includes="**/*.java"/> + <fileset dir="crossfire/src/test/java" includes="**/*.java"/> + <fileset dir="daimonin/src/main/java" includes="**/*.java"/> + <fileset dir="daimonin/src/test/java" includes="**/*.java"/> + <fileset dir="model/src/main/java" includes="**/*.java"/> + <fileset dir="model/src/test/java" includes="**/*.java"/> + <fileset dir="preferences/src/main/java" includes="**/*.java"/> + <fileset dir="preferences/src/test/java" includes="**/*.java"/> + <fileset dir="plugin/src/main/java" includes="**/*.java"/> + <fileset dir="plugin/src/test/java" includes="**/*.java"/> + <fileset dir="textedit/src/main/java" includes="**/*.java"/> + <fileset dir="textedit/src/test/java" includes="**/*.java"/> + <fileset dir="utils/src/main/java" includes="**/*.java"/> + <fileset dir="utils/src/test/java" includes="**/*.java"/> </checkstyle> </target> @@ -917,7 +917,7 @@ <target name="javadoc" depends="init-properties" description="Creates the JavaDoc documentation for the complete editor source."> <mkdir dir="${build.dir}/doc/dev/api"/> - <javadoc destdir="${build.dir}/doc/dev/api" locale="en_US" version="yes" author="yes" use="yes" splitindex="yes" windowtitle="Gridarta — API Documentation" doctitle="Gridarta ${build.number}<br />API Documentation" header="Gridarta ${build.number}<br />API Documentation" footer="Gridarta ${build.number}<br />API Documentation" serialwarn="no" charset="utf-8" docencoding="utf-8" source="${build.source.version}" encoding="${build.source.encoding}" linksource="yes" private="yes" overview="src/app/overview.html" link="${user.javadoc.link}"> + <javadoc destdir="${build.dir}/doc/dev/api" locale="en_US" version="yes" author="yes" use="yes" splitindex="yes" windowtitle="Gridarta — API Documentation" doctitle="Gridarta ${build.number}<br />API Documentation" header="Gridarta ${build.number}<br />API Documentation" footer="Gridarta ${build.number}<br />API Documentation" serialwarn="no" charset="utf-8" docencoding="utf-8" source="${build.source.version}" encoding="${build.source.encoding}" linksource="yes" private="yes" overview="src/main/java/overview.html" link="${user.javadoc.link}"> <classpath> <fileset dir="atrinik/lib" includes="*.jar" excludes="*.jar-LICENSE"/> <fileset dir="daimonin/lib" includes="*.jar" excludes="*.jar-LICENSE"/> @@ -936,24 +936,24 @@ <path refid="path.class.textedit.test"/> <path refid="path.class.utils.test"/> </sourcepath> - <packageset dir="src/app" defaultexcludes="yes"/> - <packageset dir="src/test" defaultexcludes="yes"/> - <packageset dir="atrinik/src/app" defaultexcludes="yes"/> - <packageset dir="atrinik/src/test" defaultexcludes="yes"/> - <packageset dir="crossfire/src/app" defaultexcludes="yes"/> - <packageset dir="crossfire/src/test" defaultexcludes="yes"/> - <packageset dir="daimonin/src/app" defaultexcludes="yes"/> - <packageset dir="daimonin/src/test" defaultexcludes="yes"/> - <packageset dir="model/src/app" defaultexcludes="yes"/> - <packageset dir="model/src/test" defaultexcludes="yes"/> - <packageset dir="preferences/src/app" defaultexcludes="yes"/> - <packageset dir="preferences/src/test" defaultexcludes="yes"/> - <packageset dir="plugin/src/app" defaultexcludes="yes"/> - <packageset dir="plugin/src/test" defaultexcludes="yes"/> - <packageset dir="textedit/src/app" defaultexcludes="yes"/> - <packageset dir="textedit/src/test" defaultexcludes="yes"/> - <packageset dir="utils/src/app" defaultexcludes="yes"/> - <packageset dir="utils/src/test" defaultexcludes="yes"/> + <packageset dir="src/main/java" defaultexcludes="yes"/> + <packageset dir="src/test/java" defaultexcludes="yes"/> + <packageset dir="atrinik/src/main/java" defaultexcludes="yes"/> + <packageset dir="atrinik/src/test/java" defaultexcludes="yes"/> + <packageset dir="crossfire/src/main/java" defaultexcludes="yes"/> + <packageset dir="crossfire/src/test/java" defaultexcludes="yes"/> + <packageset dir="daimonin/src/main/java" defaultexcludes="yes"/> + <packageset dir="daimonin/src/test/java" defaultexcludes="yes"/> + <packageset dir="model/src/main/java" defaultexcludes="yes"/> + <packageset dir="model/src/test/java" defaultexcludes="yes"/> + <packageset dir="preferences/src/main/java" defaultexcludes="yes"/> + <packageset dir="preferences/src/test/java" defaultexcludes="yes"/> + <packageset dir="plugin/src/main/java" defaultexcludes="yes"/> + <packageset dir="plugin/src/test/java" defaultexcludes="yes"/> + <packageset dir="textedit/src/main/java" defaultexcludes="yes"/> + <packageset dir="textedit/src/test/java" defaultexcludes="yes"/> + <packageset dir="utils/src/main/java" defaultexcludes="yes"/> + <packageset dir="utils/src/test/java" defaultexcludes="yes"/> <bottom> <![CDATA[<address> <a href="http://sourceforge.net/"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=166996&type=1" alt="SourceForge.net Logo" width="88" height="31" class="now" /></a> Modified: trunk/crossfire/crossfire.iml =================================================================== --- trunk/crossfire/crossfire.iml 2013-05-28 18:39:34 UTC (rev 9234) +++ trunk/crossfire/crossfire.iml 2013-05-28 19:12:45 UTC (rev 9235) @@ -3,9 +3,11 @@ <component name="NewModuleRootManager" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> - <sourceFolder url="file://$MODULE_DIR$/src/app" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/src/test" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/resource" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> + <sourceFolder url="file://$MODULE_DIR$/src/test/resources" isTestSource="true" /> <excludeFolder url="file://$MODULE_DIR$/class" /> <excludeFolder url="file://$MODULE_DIR$/classes" /> </content> Modified: trunk/daimonin/daimonin.iml =================================================================== --- trunk/daimonin/daimonin.iml 2013-05-28 18:39:34 UTC (rev 9234) +++ trunk/daimonin/daimonin.iml 2013-05-28 19:12:45 UTC (rev 9235) @@ -4,8 +4,10 @@ <exclude-output /> <content url="file://$MODULE_DIR$"> <sourceFolder url="file://$MODULE_DIR$/resource" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/src/app" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/src/test" isTestSource="true" /> + <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> + <sourceFolder url="file://$MODULE_DIR$/src/test/resources" isTestSource="true" /> <excludeFolder url="file://$MODULE_DIR$/class" /> </content> <orderEntry type="inheritedJdk" /> Modified: trunk/gridarta.iml =================================================================== --- trunk/gridarta.iml 2013-05-28 18:39:34 UTC (rev 9234) +++ trunk/gridarta.iml 2013-05-28 19:12:45 UTC (rev 9235) @@ -3,8 +3,10 @@ <component name="NewModuleRootManager" inherit-compiler-output="true"> <content url="file://$MODULE_DIR$"> <sourceFolder url="file://$MODULE_DIR$/resource" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/src/app" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/src/test" isTestSource="true" /> + <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> + <sourceFolder url="file://$MODULE_DIR$/src/test/resources" isTestSource="true" /> + <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" /> <excludeFolder url="file://$MODULE_DIR$/atrinik" /> <excludeFolder url="file://$MODULE_DIR$/classes" /> <excludeFolder url="file://$MODULE_DIR$/crossfire" /> Modified: trunk/model/model.iml =================================================================== --- trunk/model/model.iml 2013-05-28 18:39:34 UTC (rev 9234) +++ trunk/model/model.iml 2013-05-28 19:12:45 UTC (rev 9235) @@ -3,8 +3,10 @@ <component name="NewModuleRootManager" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> - <sourceFolder url="file://$MODULE_DIR$/src/app" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/src/test" isTestSource="true" /> + <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> + <sourceFolder url="file://$MODULE_DIR$/src/test/resources" isTestSource="true" /> </content> <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> Modified: trunk/plugin/plugin.iml =================================================================== --- trunk/plugin/plugin.iml 2013-05-28 18:39:34 UTC (rev 9234) +++ trunk/plugin/plugin.iml 2013-05-28 19:12:45 UTC (rev 9235) @@ -3,8 +3,10 @@ <component name="NewModuleRootManager" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> - <sourceFolder url="file://$MODULE_DIR$/src/app" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/src/test" isTestSource="true" /> + <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> + <sourceFolder url="file://$MODULE_DIR$/src/test/resources" isTestSource="true" /> </content> <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> Modified: trunk/preferences/preferences.iml =================================================================== --- trunk/preferences/preferences.iml 2013-05-28 18:39:34 UTC (rev 9234) +++ trunk/preferences/preferences.iml 2013-05-28 19:12:45 UTC (rev 9235) @@ -2,8 +2,10 @@ <module relativePaths="true" type="JAVA_MODULE" version="4"> <component name="NewModuleRootManager" inherit-compiler-output="true"> <content url="file://$MODULE_DIR$"> - <sourceFolder url="file://$MODULE_DIR$/src/app" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/src/test" isTestSource="true" /> + <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> + <sourceFolder url="file://$MODULE_DIR$/src/test/resources" isTestSource="true" /> </content> <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> Modified: trunk/textedit/textedit.iml =================================================================== --- trunk/textedit/textedit.iml 2013-05-28 18:39:34 UTC (rev 9234) +++ trunk/textedit/textedit.iml 2013-05-28 19:12:45 UTC (rev 9235) @@ -2,8 +2,10 @@ <module relativePaths="true" type="JAVA_MODULE" version="4"> <component name="NewModuleRootManager" inherit-compiler-output="true"> <content url="file://$MODULE_DIR$"> - <sourceFolder url="file://$MODULE_DIR$/src/app" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/src/test" isTestSource="true" /> + <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> + <sourceFolder url="file://$MODULE_DIR$/src/test/resources" isTestSource="true" /> </content> <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> Modified: trunk/utils/utils.iml =================================================================== --- trunk/utils/utils.iml 2013-05-28 18:39:34 UTC (rev 9234) +++ trunk/utils/utils.iml 2013-05-28 19:12:45 UTC (rev 9235) @@ -2,8 +2,10 @@ <module relativePaths="true" type="JAVA_MODULE" version="4"> <component name="NewModuleRootManager" inherit-compiler-output="true"> <content url="file://$MODULE_DIR$"> - <sourceFolder url="file://$MODULE_DIR$/src/app" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/src/test" isTestSource="true" /> + <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> + <sourceFolder url="file://$MODULE_DIR$/src/test/resources" isTestSource="true" /> </content> <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-05-28 18:39:37
|
Revision: 9234 http://sourceforge.net/p/gridarta/code/9234 Author: akirschbaum Date: 2013-05-28 18:39:34 +0000 (Tue, 28 May 2013) Log Message: ----------- Remove ArchetypeTypeSetParser.defaultArchetypeType. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java Modified: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java 2013-05-28 18:35:36 UTC (rev 9233) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java 2013-05-28 18:39:34 UTC (rev 9234) @@ -69,12 +69,6 @@ private final ArchetypeTypeParser archetypeTypeParser; /** - * The default {@link ArchetypeType}. - */ - @Nullable - private ArchetypeType defaultArchetypeType; - - /** * Creates a new instance. * @param documentBuilder the document builder to use * @param archetypeTypeSet the archetype type set to update @@ -118,11 +112,11 @@ parseBitmasks(XmlUtils.getChild(rootElement, Constants.XML_ELEMENT_BITMASKS), errorViewCollector); parseLists(XmlUtils.getChild(rootElement, Constants.XML_ELEMENT_LISTS), errorViewCollector); final IgnorelistsDefinition ignorelistsDefinition = parseIgnoreLists(XmlUtils.getChild(rootElement, Constants.XML_ELEMENT_IGNORELISTS), errorViewCollector); - parseDefaultType(XmlUtils.getChild(rootElement, Constants.XML_ELEMENT_DEFAULT_TYPE), errorViewCollector, ignorelistsDefinition); + final ArchetypeType defaultArchetypeType = parseDefaultType(XmlUtils.getChild(rootElement, Constants.XML_ELEMENT_DEFAULT_TYPE), errorViewCollector, ignorelistsDefinition); final Iterator<Element> typeElements = new NodeListIterator<Element>(rootElement, Constants.XML_ELEMENT_TYPE); while (typeElements.hasNext()) { - parseTypes(typeElements.next(), errorViewCollector, ignorelistsDefinition); + parseTypes(typeElements.next(), errorViewCollector, defaultArchetypeType, ignorelistsDefinition); } if (log.isInfoEnabled()) { @@ -131,7 +125,8 @@ } /** - * Parses the {@link Constants#XML_ELEMENT_BITMASKS} section of a types.xml file. + * Parses the {@link Constants#XML_ELEMENT_BITMASKS} section of a types.xml + * file. * @param bitmasksElement the element to parse * @param errorViewCollector the error view collector for reporting errors */ @@ -149,7 +144,8 @@ } /** - * Parses a {@link Constants#XML_ELEMENT_BITMASK} section of a types.xml file. + * Parses a {@link Constants#XML_ELEMENT_BITMASK} section of a types.xml + * file. * @param bitmaskElement the element to parse * @param name the name of the bitmask element * @param errorViewCollector the error view collector for reporting errors @@ -183,7 +179,8 @@ } /** - * Parses a {@link Constants#XML_ELEMENT_BMENTRY} section of a types.xml file. + * Parses a {@link Constants#XML_ELEMENT_BMENTRY} section of a types.xml + * file. * @param errorViewCollector the error view collector for reporting errors * @param bmentryElement the "bmentry" section to parse * @param bitmaskName the name of the parent's "bitmask" section for error @@ -252,7 +249,8 @@ } /** - * Parses the {@link Constants#XML_ELEMENT_LISTS} section of a types.xml file. + * Parses the {@link Constants#XML_ELEMENT_LISTS} section of a types.xml + * file. * @param listsElement the element to parse * @param errorViewCollector the error view collector for reporting errors */ @@ -264,8 +262,8 @@ } /** - * Parses an {@link Constants#XML_ELEMENT_LIST} section of a types.xml file and adds - * it to {@link #archetypeTypeSet}. + * Parses an {@link Constants#XML_ELEMENT_LIST} section of a types.xml file + * and adds it to {@link #archetypeTypeSet}. * @param listElement the element to parse * @param errorViewCollector the error view collector for reporting errors */ @@ -280,8 +278,8 @@ } /** - * Parses an {@link Constants#XML_ELEMENT_LISTENTRY} section of a types.xml file and - * adds it to an {@link ArchetypeTypeList}. + * Parses an {@link Constants#XML_ELEMENT_LISTENTRY} section of a types.xml + * file and adds it to an {@link ArchetypeTypeList}. * @param listentryElement the element to parse * @param errorViewCollector the error view collector for reporting errors * @param list the archetype type list to add to @@ -304,7 +302,8 @@ } /** - * Parses the {@link Constants#XML_ELEMENT_IGNORELISTS} section of a types.xml file. + * Parses the {@link Constants#XML_ELEMENT_IGNORELISTS} section of a + * types.xml file. * @param ignorelistsElement the element to parse * @param errorViewCollector the error view collector for reporting errors * @return the section's contents @@ -320,7 +319,8 @@ } /** - * Parses the {@link Constants#XML_ELEMENT_IGNORE_LIST} section of a types.xml file. + * Parses the {@link Constants#XML_ELEMENT_IGNORE_LIST} section of a + * types.xml file. * @param ignoreListElement the element to parse * @param errorViewCollector the error view collector for reporting errors * @param ignorelistsDefinition the ignore lists definition to update @@ -354,23 +354,28 @@ } /** - * Parses the {@link Constants#XML_ELEMENT_DEFAULT_TYPE} element of a types.xml - * file. + * Parses the {@link Constants#XML_ELEMENT_DEFAULT_TYPE} element of a + * types.xml file. * @param defaultTypeElement the element to parse * @param errorViewCollector the error view collector for reporting errors * @param ignorelistsDefinition the contents of the "ignorelists" section + * @return the default type */ - private void parseDefaultType(@NotNull final Element defaultTypeElement, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final IgnorelistsDefinition ignorelistsDefinition) { - defaultArchetypeType = archetypeTypeParser.loadAttributeList(defaultTypeElement, errorViewCollector, null, archetypeTypeSet, ignorelistsDefinition, true); + @NotNull + private ArchetypeType parseDefaultType(@NotNull final Element defaultTypeElement, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final IgnorelistsDefinition ignorelistsDefinition) { + return archetypeTypeParser.loadAttributeList(defaultTypeElement, errorViewCollector, null, archetypeTypeSet, ignorelistsDefinition, true); } /** - * Parses an {@link Constants#XML_ELEMENT_TYPE} element of a types.xml file. + * Parses an {@link Constants#XML_ELEMENT_TYPE} element of a types.xml + * file. * @param typeElement the type element to parse * @param errorViewCollector the error view collector for reporting errors + * @param defaultArchetypeType the default archetype type to copy attributes + * from * @param ignorelistsDefinition the contents of the "ignorelists" section */ - private void parseTypes(@NotNull final Element typeElement, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final IgnorelistsDefinition ignorelistsDefinition) { + private void parseTypes(@NotNull final Element typeElement, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final ArchetypeType defaultArchetypeType, @NotNull final IgnorelistsDefinition ignorelistsDefinition) { if (!typeElement.getAttribute(Constants.XML_TYPE_AVAILABLE).equals("no")) { archetypeTypeSet.addArchetypeType(archetypeTypeParser.loadAttributeList(typeElement, errorViewCollector, defaultArchetypeType, archetypeTypeSet, ignorelistsDefinition, false)); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-05-28 18:35:40
|
Revision: 9233 http://sourceforge.net/p/gridarta/code/9233 Author: akirschbaum Date: 2013-05-28 18:35:36 +0000 (Tue, 28 May 2013) Log Message: ----------- Extract all constants for parsing types.xml files into Constants; merge duplicated definitions. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeParser.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeParser.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java Added Paths: ----------- trunk/model/src/app/net/sf/gridarta/model/archetypetype/Constants.java Modified: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeParser.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeParser.java 2013-05-28 18:16:03 UTC (rev 9232) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeParser.java 2013-05-28 18:35:36 UTC (rev 9233) @@ -41,110 +41,6 @@ private static final Pattern LINE_BREAK = Pattern.compile("\\s*\n\\s*"); /** - * The name of the "attribute" element. - */ - @NotNull - public static final String XML_ELEMENT_ATTRIBUTE = "attribute"; - - /** - * The name of the "arch" attribute within {@link #XML_ELEMENT_ATTRIBUTE} - * elements. - */ - @NotNull - public static final String XML_ATTRIBUTE_ARCH = "arch"; - - /** - * The name of the "editor" attribute within {@link #XML_ELEMENT_ATTRIBUTE} - * elements. - */ - @NotNull - public static final String XML_ATTRIBUTE_EDITOR = "editor"; - - /** - * The name of the "value" attribute within {@link #XML_ELEMENT_ATTRIBUTE} - * elements. - */ - @NotNull - public static final String XML_ATTRIBUTE_VALUE = "value"; - - /** - * The name of the "min" attribute within {@link #XML_ELEMENT_ATTRIBUTE} - * elements. - */ - @NotNull - public static final String XML_ATTRIBUTE_MIN = "min"; - - /** - * The name of the "max" attribute within {@link #XML_ELEMENT_ATTRIBUTE} - * elements. - */ - @NotNull - public static final String XML_ATTRIBUTE_MAX = "max"; - - /** - * The name of the "check_min" attribute within {@link - * #XML_ELEMENT_ATTRIBUTE} elements. - */ - @NotNull - public static final String XML_ATTRIBUTE_CHECK_MIN = "check_min"; - - /** - * The name of the "check_max" attribute within {@link - * #XML_ELEMENT_ATTRIBUTE} elements. - */ - @NotNull - public static final String XML_ATTRIBUTE_CHECK_MAX = "check_max"; - - /** - * The name of the "type" attribute within {@link #XML_ELEMENT_ATTRIBUTE} - * elements. - */ - @NotNull - public static final String XML_ATTRIBUTE_TYPE = "type"; - - /** - * The name of the "arch_begin" attribute within {@link - * #XML_ELEMENT_ATTRIBUTE} elements. - */ - @NotNull - public static final String XML_ATTRIBUTE_ARCH_BEGIN = "arch_begin"; - - /** - * The name of the "arch_end" attribute within {@link - * #XML_ELEMENT_ATTRIBUTE} elements. - */ - @NotNull - public static final String XML_ATTRIBUTE_ARCH_END = "arch_end"; - - /** - * The name of the "length" attribute within {@link #XML_ELEMENT_ATTRIBUTE} - * elements. - */ - @NotNull - public static final String XML_ATTRIBUTE_LENGTH = "length"; - - /** - * The name of the "true" attribute within {@link #XML_ELEMENT_ATTRIBUTE} - * elements. - */ - @NotNull - public static final String XML_ATTRIBUTE_TRUE = "true"; - - /** - * The name of the "false" attribute within {@link #XML_ELEMENT_ATTRIBUTE} - * elements. - */ - @NotNull - public static final String XML_ATTRIBUTE_FALSE = "false"; - - /** - * The name of the "marker" attribute within {@link #XML_ELEMENT_ATTRIBUTE} - * elements. - */ - @NotNull - public static final String XML_ATTRIBUTE_MARKER = "marker"; - - /** * The {@link ArchetypeAttributeFactory} for creating {@link * ArchetypeAttribute ArchetypeAttributes}. */ @@ -174,65 +70,65 @@ @SuppressWarnings("FeatureEnvy") public ArchetypeAttribute load(@NotNull final Element attributeElement, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final String typeName, @NotNull final String sectionName) throws MissingAttributeException { final String description = parseText(attributeElement); - final int inputLength = getAttributeIntValue(attributeElement, XML_ATTRIBUTE_LENGTH, 0, typeName, errorViewCollector); - final String attributeType = getAttributeValue(attributeElement, XML_ATTRIBUTE_TYPE); + final int inputLength = getAttributeIntValue(attributeElement, Constants.XML_ATTRIBUTE_LENGTH, 0, typeName, errorViewCollector); + final String attributeType = getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_TYPE); if (attributeType.equals("bool")) { - return archetypeAttributeFactory.newArchetypeAttributeBool(getAttributeValue(attributeElement, XML_ATTRIBUTE_ARCH), getAttributeValue(attributeElement, XML_ATTRIBUTE_EDITOR), description, inputLength, sectionName); + return archetypeAttributeFactory.newArchetypeAttributeBool(getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_ARCH), getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_EDITOR), description, inputLength, sectionName); } else if (attributeType.equals("bool_special")) { - return archetypeAttributeFactory.newArchetypeAttributeBoolSpec(getAttributeValue(attributeElement, XML_ATTRIBUTE_ARCH), getAttributeValue(attributeElement, XML_ATTRIBUTE_EDITOR), description, inputLength, sectionName, getAttributeValue(attributeElement, XML_ATTRIBUTE_TRUE), getAttributeValue(attributeElement, XML_ATTRIBUTE_FALSE)); + return archetypeAttributeFactory.newArchetypeAttributeBoolSpec(getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_ARCH), getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_EDITOR), description, inputLength, sectionName, getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_TRUE), getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_FALSE)); } else if (attributeType.equals("int")) { - final int minValue = getAttributeIntValue(attributeElement, XML_ATTRIBUTE_MIN, Integer.MIN_VALUE, typeName, errorViewCollector); - final int maxValue = getAttributeIntValue(attributeElement, XML_ATTRIBUTE_MAX, Integer.MAX_VALUE, typeName, errorViewCollector); - final int minCheckValue = getAttributeIntValue(attributeElement, XML_ATTRIBUTE_CHECK_MIN, minValue, typeName, errorViewCollector); - final int maxCheckValue = getAttributeIntValue(attributeElement, XML_ATTRIBUTE_CHECK_MAX, maxValue, typeName, errorViewCollector); + final int minValue = getAttributeIntValue(attributeElement, Constants.XML_ATTRIBUTE_MIN, Integer.MIN_VALUE, typeName, errorViewCollector); + final int maxValue = getAttributeIntValue(attributeElement, Constants.XML_ATTRIBUTE_MAX, Integer.MAX_VALUE, typeName, errorViewCollector); + final int minCheckValue = getAttributeIntValue(attributeElement, Constants.XML_ATTRIBUTE_CHECK_MIN, minValue, typeName, errorViewCollector); + final int maxCheckValue = getAttributeIntValue(attributeElement, Constants.XML_ATTRIBUTE_CHECK_MAX, maxValue, typeName, errorViewCollector); if (minValue > maxValue) { - errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, "type " + typeName + " has invalid " + XML_ATTRIBUTE_MIN + ".." + XML_ATTRIBUTE_MAX + " range: " + minValue + ".." + maxValue + "."); + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, "type " + typeName + " has invalid " + Constants.XML_ATTRIBUTE_MIN + ".." + Constants.XML_ATTRIBUTE_MAX + " range: " + minValue + ".." + maxValue + "."); return null; } if (minCheckValue > maxCheckValue) { - errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, "type " + typeName + " has invalid " + XML_ATTRIBUTE_CHECK_MIN + ".." + XML_ATTRIBUTE_CHECK_MAX + " range: " + minCheckValue + ".." + maxCheckValue + "."); + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, "type " + typeName + " has invalid " + Constants.XML_ATTRIBUTE_CHECK_MIN + ".." + Constants.XML_ATTRIBUTE_CHECK_MAX + " range: " + minCheckValue + ".." + maxCheckValue + "."); return null; } if (minCheckValue < minValue) { - errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, "type " + typeName + " has invalid " + XML_ATTRIBUTE_CHECK_MIN + " value: " + minCheckValue + " < " + XML_ATTRIBUTE_MIN + " = " + minValue + "."); + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, "type " + typeName + " has invalid " + Constants.XML_ATTRIBUTE_CHECK_MIN + " value: " + minCheckValue + " < " + Constants.XML_ATTRIBUTE_MIN + " = " + minValue + "."); return null; } if (maxCheckValue > maxValue) { - errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, "type " + typeName + " has invalid " + XML_ATTRIBUTE_CHECK_MAX + " value: " + maxCheckValue + " > " + XML_ATTRIBUTE_MAX + " = " + maxValue + "."); + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, "type " + typeName + " has invalid " + Constants.XML_ATTRIBUTE_CHECK_MAX + " value: " + maxCheckValue + " > " + Constants.XML_ATTRIBUTE_MAX + " = " + maxValue + "."); return null; } - return archetypeAttributeFactory.newArchetypeAttributeInt(getAttributeValue(attributeElement, XML_ATTRIBUTE_ARCH), getAttributeValue(attributeElement, XML_ATTRIBUTE_EDITOR), description, inputLength, sectionName, minValue, maxValue, minCheckValue, maxCheckValue); + return archetypeAttributeFactory.newArchetypeAttributeInt(getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_ARCH), getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_EDITOR), description, inputLength, sectionName, minValue, maxValue, minCheckValue, maxCheckValue); } else if (attributeType.equals("long")) { - return archetypeAttributeFactory.newArchetypeAttributeLong(getAttributeValue(attributeElement, XML_ATTRIBUTE_ARCH), getAttributeValue(attributeElement, XML_ATTRIBUTE_EDITOR), description, inputLength, sectionName); + return archetypeAttributeFactory.newArchetypeAttributeLong(getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_ARCH), getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_EDITOR), description, inputLength, sectionName); } else if (attributeType.equals("float")) { - return archetypeAttributeFactory.newArchetypeAttributeFloat(getAttributeValue(attributeElement, XML_ATTRIBUTE_ARCH), getAttributeValue(attributeElement, XML_ATTRIBUTE_EDITOR), description, inputLength, sectionName); + return archetypeAttributeFactory.newArchetypeAttributeFloat(getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_ARCH), getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_EDITOR), description, inputLength, sectionName); } else if (attributeType.equals("string")) { - return archetypeAttributeFactory.newArchetypeAttributeString(getAttributeValue(attributeElement, XML_ATTRIBUTE_ARCH), getAttributeValue(attributeElement, XML_ATTRIBUTE_EDITOR), description, inputLength, sectionName); + return archetypeAttributeFactory.newArchetypeAttributeString(getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_ARCH), getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_EDITOR), description, inputLength, sectionName); } else if (attributeType.equals("map_path")) { - return archetypeAttributeFactory.newArchetypeAttributeMapPath(getAttributeValue(attributeElement, XML_ATTRIBUTE_ARCH), getAttributeValue(attributeElement, XML_ATTRIBUTE_EDITOR), description, inputLength, sectionName); + return archetypeAttributeFactory.newArchetypeAttributeMapPath(getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_ARCH), getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_EDITOR), description, inputLength, sectionName); } else if (attributeType.equals("script_file")) { - return archetypeAttributeFactory.newArchetypeAttributeScriptFile(getAttributeValue(attributeElement, XML_ATTRIBUTE_ARCH), getAttributeValue(attributeElement, XML_ATTRIBUTE_EDITOR), description, inputLength, sectionName); + return archetypeAttributeFactory.newArchetypeAttributeScriptFile(getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_ARCH), getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_EDITOR), description, inputLength, sectionName); } else if (attributeType.equals("facename")) { - return archetypeAttributeFactory.newArchetypeAttributeFacename(getAttributeValue(attributeElement, XML_ATTRIBUTE_ARCH), getAttributeValue(attributeElement, XML_ATTRIBUTE_EDITOR), description, inputLength, sectionName); + return archetypeAttributeFactory.newArchetypeAttributeFacename(getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_ARCH), getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_EDITOR), description, inputLength, sectionName); } else if (attributeType.equals("animname")) { - return archetypeAttributeFactory.newArchetypeAttributeAnimname(getAttributeValue(attributeElement, XML_ATTRIBUTE_ARCH), getAttributeValue(attributeElement, XML_ATTRIBUTE_EDITOR), description, inputLength, sectionName); + return archetypeAttributeFactory.newArchetypeAttributeAnimname(getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_ARCH), getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_EDITOR), description, inputLength, sectionName); } else if (attributeType.equals("text")) { - return archetypeAttributeFactory.newArchetypeAttributeText(getAttributeValue(attributeElement, XML_ATTRIBUTE_ARCH_BEGIN), getAttributeValue(attributeElement, XML_ATTRIBUTE_ARCH_END), getAttributeValue(attributeElement, XML_ATTRIBUTE_EDITOR), description, inputLength, getAttributeValueOptional(attributeElement, XML_ATTRIBUTE_MARKER)); + return archetypeAttributeFactory.newArchetypeAttributeText(getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_ARCH_BEGIN), getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_ARCH_END), getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_EDITOR), description, inputLength, getAttributeValueOptional(attributeElement, Constants.XML_ATTRIBUTE_MARKER)); } else if (attributeType.equals("fixed")) { - return archetypeAttributeFactory.newArchetypeAttributeFixed(getAttributeValue(attributeElement, XML_ATTRIBUTE_ARCH), getAttributeValue(attributeElement, XML_ATTRIBUTE_VALUE), description, inputLength, sectionName); + return archetypeAttributeFactory.newArchetypeAttributeFixed(getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_ARCH), getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_VALUE), description, inputLength, sectionName); } else if (attributeType.equals("spell")) { - return archetypeAttributeFactory.newArchetypeAttributeSpell(getAttributeValue(attributeElement, XML_ATTRIBUTE_ARCH), getAttributeValue(attributeElement, XML_ATTRIBUTE_EDITOR), description, inputLength, sectionName); + return archetypeAttributeFactory.newArchetypeAttributeSpell(getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_ARCH), getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_EDITOR), description, inputLength, sectionName); } else if (attributeType.equals("nz_spell")) { - return archetypeAttributeFactory.newArchetypeAttributeZSpell(getAttributeValue(attributeElement, XML_ATTRIBUTE_ARCH), getAttributeValue(attributeElement, XML_ATTRIBUTE_EDITOR), description, inputLength, sectionName); + return archetypeAttributeFactory.newArchetypeAttributeZSpell(getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_ARCH), getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_EDITOR), description, inputLength, sectionName); } else if (attributeType.equals("inv_spell")) { - return archetypeAttributeFactory.newArchetypeAttributeInvSpell(getAttributeValue(attributeElement, XML_ATTRIBUTE_ARCH), getAttributeValue(attributeElement, XML_ATTRIBUTE_EDITOR), description, inputLength, sectionName); + return archetypeAttributeFactory.newArchetypeAttributeInvSpell(getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_ARCH), getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_EDITOR), description, inputLength, sectionName); } else if (attributeType.equals("inv_spell_optional")) { - return archetypeAttributeFactory.newArchetypeAttributeInvSpellOptional(getAttributeValue(attributeElement, XML_ATTRIBUTE_ARCH), getAttributeValue(attributeElement, XML_ATTRIBUTE_EDITOR), description, inputLength, sectionName); + return archetypeAttributeFactory.newArchetypeAttributeInvSpellOptional(getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_ARCH), getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_EDITOR), description, inputLength, sectionName); } else if (attributeType.startsWith("bitmask")) { // got a bitmask attribute final String bitmaskName = attributeType.substring(8).trim(); @@ -240,7 +136,7 @@ errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, "type " + typeName + ": Bitmask \"" + bitmaskName + "\" is undefined."); return null; } - return archetypeAttributeFactory.newArchetypeAttributeBitmask(getAttributeValue(attributeElement, XML_ATTRIBUTE_ARCH), getAttributeValue(attributeElement, XML_ATTRIBUTE_EDITOR), description, inputLength, sectionName, bitmaskName); + return archetypeAttributeFactory.newArchetypeAttributeBitmask(getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_ARCH), getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_EDITOR), description, inputLength, sectionName, bitmaskName); } else if (attributeType.startsWith("list_")) { // got a bitmask attribute final String listName = attributeType.substring(5).trim(); @@ -248,9 +144,9 @@ errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, "type " + typeName + ": List \"" + listName + "\" is undefined."); return null; } - return archetypeAttributeFactory.newArchetypeAttributeList(getAttributeValue(attributeElement, XML_ATTRIBUTE_ARCH), getAttributeValue(attributeElement, XML_ATTRIBUTE_EDITOR), description, inputLength, sectionName, listName); + return archetypeAttributeFactory.newArchetypeAttributeList(getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_ARCH), getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_EDITOR), description, inputLength, sectionName, listName); } else if (attributeType.equals("treasurelist")) { - return archetypeAttributeFactory.newArchetypeAttributeTreasure(getAttributeValue(attributeElement, XML_ATTRIBUTE_ARCH), getAttributeValue(attributeElement, XML_ATTRIBUTE_EDITOR), description, inputLength, sectionName); + return archetypeAttributeFactory.newArchetypeAttributeTreasure(getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_ARCH), getAttributeValue(attributeElement, Constants.XML_ATTRIBUTE_EDITOR), description, inputLength, sectionName); } else { // unknown type errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, "type " + typeName + " has an attribute with unknown type: '" + attributeType + "'."); Modified: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeParser.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeParser.java 2013-05-28 18:16:03 UTC (rev 9232) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeParser.java 2013-05-28 18:35:36 UTC (rev 9233) @@ -42,84 +42,6 @@ public class ArchetypeTypeParser { /** - * Attribute Element Name. - */ - @NotNull - private static final String XML_ELEMENT_ATTRIBUTE = "attribute"; - - /** - * Required Element Name. - */ - @NotNull - private static final String XML_ELEMENT_REQUIRED = "required"; - - /** - * Ignore Element Name. - */ - @NotNull - private static final String XML_ELEMENT_IGNORE = "ignore"; - - /** - * Ignore List Element Name. - */ - @NotNull - private static final String XML_ELEMENT_IGNORE_LIST = "ignore_list"; - - /** - * Import Type Element Name. - */ - @NotNull - private static final String XML_ELEMENT_IMPORT_TYPE = "import_type"; - - /** - * Section Element Name. - */ - @NotNull - private static final String XML_ELEMENT_SECTION = "section"; - - /** - * The "arch" attribute name of a {@link #XML_ELEMENT_ATTRIBUTE} element. - */ - @NotNull - private static final String XML_ATTRIBUTE_ARCH = "arch"; - - /** - * The "value" attribute name of a {@link #XML_ELEMENT_ATTRIBUTE} element. - */ - @NotNull - private static final String XML_ATTRIBUTE_VALUE = "value"; - - /** - * The "name" attribute name of a {@link #XML_ELEMENT_IGNORE_LIST} element. - */ - @NotNull - private static final String XML_IGNORE_LIST_NAME = "name"; - - /** - * The "name" attribute name of a {@link #XML_ELEMENT_IMPORT_TYPE} element. - */ - @NotNull - private static final String XML_IMPORT_TYPE_NAME = "name"; - - /** - * The "name" attribute name of a {@link #XML_ELEMENT_SECTION} element. - */ - @NotNull - private static final String XML_SECTION_NAME = "name"; - - /** - * Description Element Name. - */ - @NotNull - private static final String XML_DESCRIPTION = "description"; - - /** - * Use Element Name. - */ - @NotNull - private static final String XML_USE = "use"; - - /** * An empty array of <code>int</code>s. */ @NotNull @@ -141,8 +63,7 @@ /** * Parses an element which contains a list of {@link - * ArchetypeAttributeParser#XML_ELEMENT_ATTRIBUTE} elements from a types.xml - * file. + * Constants#XML_ELEMENT_ATTRIBUTE} elements from a types.xml file. * @param typeElement the xml 'type' element which is going to be parsed * @param errorViewCollector the error view collector for reporting errors * @param archetypeType the parent archetype type @@ -155,7 +76,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 String display = typeElement.getAttribute(Constants.XML_TYPE_DISPLAY); final boolean map = parseMap(typeElement); final int[] inv = parseInv(typeElement, typeName, errorViewCollector); final boolean allowsAllInv = parseAllowsAllInv(typeElement); @@ -163,7 +84,7 @@ final ArchetypeAttributesDefinition typeAttributes = isDefaultType ? new ArchetypeAttributesDefinition() : parseTypeAttributes(typeElement, typeName, errorViewCollector, ignoreTable, ignorelistsDefinition); final Collection<String> importTypes = new LinkedHashSet<String>(); - final Iterator<Element> importTypeIterator = new NodeListIterator<Element>(typeElement, XML_ELEMENT_IMPORT_TYPE); + final Iterator<Element> importTypeIterator = new NodeListIterator<Element>(typeElement, Constants.XML_ELEMENT_IMPORT_TYPE); while (importTypeIterator.hasNext()) { final Element importTypeElement = importTypeIterator.next(); final String importType = parseImportType(importTypeElement, typeName, errorViewCollector); @@ -244,9 +165,9 @@ } /** - * Parses the {@link #XML_ELEMENT_IMPORT_TYPE} of an {@link - * ArchetypeTypeSetParser#XML_ELEMENT_TYPE} or {@link - * ArchetypeTypeSetParser#XML_ELEMENT_DEFAULT_TYPE} {@link Element}. + * Parses the {@link Constants#XML_ELEMENT_IMPORT_TYPE} of an {@link + * Constants#XML_ELEMENT_TYPE} or {@link Constants#XML_ELEMENT_DEFAULT_TYPE} + * {@link Element}. * @param importTypeElement the element * @param typeName the type name for error messages * @param errorViewCollector the error view collector for error messages @@ -255,15 +176,15 @@ */ @Nullable private static String parseImportType(@NotNull final Element importTypeElement, @NotNull final String typeName, @NotNull final ErrorViewCollector errorViewCollector) { - final Attr nameAttribute = importTypeElement.getAttributeNode(XML_IMPORT_TYPE_NAME); + final Attr nameAttribute = importTypeElement.getAttributeNode(Constants.XML_IMPORT_TYPE_NAME); if (nameAttribute == null) { - errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, "type " + typeName + " has " + XML_ELEMENT_IMPORT_TYPE + " element without '" + XML_IMPORT_TYPE_NAME + "'."); + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, "type " + typeName + " has " + Constants.XML_ELEMENT_IMPORT_TYPE + " element without '" + Constants.XML_IMPORT_TYPE_NAME + "'."); return null; } final String name = nameAttribute.getValue(); if (name.isEmpty()) { - errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, "type " + typeName + " has " + XML_ELEMENT_IMPORT_TYPE + " element with empty '" + XML_IMPORT_TYPE_NAME + "'."); + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, "type " + typeName + " has " + Constants.XML_ELEMENT_IMPORT_TYPE + " element with empty '" + Constants.XML_IMPORT_TYPE_NAME + "'."); return null; } @@ -271,16 +192,15 @@ } /** - * Parses the type name of an {@link ArchetypeTypeSetParser#XML_ELEMENT_TYPE} - * or {@link ArchetypeTypeSetParser#XML_ELEMENT_DEFAULT_TYPE} {@link - * Element}. + * Parses the type name of an {@link Constants#XML_ELEMENT_TYPE} or {@link + * Constants#XML_ELEMENT_DEFAULT_TYPE} {@link Element}. * @param typeElement the element * @param isDefaultType whether the element is a "default_type" * @return the type name */ @NotNull private static String parseTypeName(@NotNull final Element typeElement, final boolean isDefaultType) { - return isDefaultType ? "default" : typeElement.getAttribute(ArchetypeTypeSetParser.XML_TYPE_NAME); + return isDefaultType ? "default" : typeElement.getAttribute(Constants.XML_TYPE_NAME); } /** @@ -296,7 +216,7 @@ return -1; } - final String number = typeElement.getAttribute(ArchetypeTypeSetParser.XML_TYPE_NUMBER); + final String number = typeElement.getAttribute(Constants.XML_TYPE_NUMBER); try { return Integer.parseInt(number); } catch (final NumberFormatException ignored) { @@ -311,7 +231,7 @@ * @return whether this archetype is allowed on maps */ private static boolean parseMap(@NotNull final Element typeElement) { - final String map = typeElement.getAttribute(ArchetypeTypeSetParser.XML_TYPE_MAP); + final String map = typeElement.getAttribute(Constants.XML_TYPE_MAP); return map.equals("yes"); } @@ -325,11 +245,11 @@ */ @Nullable private static int[] parseInv(@NotNull final Element typeElement, @NotNull final String typeName, @NotNull final ErrorViewCollector errorViewCollector) { - if (!typeElement.hasAttribute(ArchetypeTypeSetParser.XML_TYPE_INV)) { + if (!typeElement.hasAttribute(Constants.XML_TYPE_INV)) { return null; } - final String inv = typeElement.getAttribute(ArchetypeTypeSetParser.XML_TYPE_INV); + final String inv = typeElement.getAttribute(Constants.XML_TYPE_INV); if (inv.isEmpty()) { return EMPTY_INT_ARRAY; } @@ -356,7 +276,7 @@ * @return whether this archetype allows all inventory game objects */ private static boolean parseAllowsAllInv(@NotNull final Element typeElement) { - final String allowsAllInv = typeElement.getAttribute(ArchetypeTypeSetParser.XML_TYPE_ALLOWS_ALL_INV); + final String allowsAllInv = typeElement.getAttribute(Constants.XML_TYPE_ALLOWS_ALL_INV); return allowsAllInv.equals("yes"); } @@ -374,7 +294,7 @@ private static ArchetypeAttributesDefinition parseTypeAttributes(@NotNull final Element typeElement, @NotNull final String typeName, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final Collection<String> ignoreTable, @NotNull final IgnorelistsDefinition ignorelistsDefinition) { final ArchetypeAttributesDefinition typeAttributes = parseRequiredAttribute(typeElement, typeName, errorViewCollector); - final Element ignoreElement = NodeListIterator.getFirstChild(typeElement, XML_ELEMENT_IGNORE); + final Element ignoreElement = NodeListIterator.getFirstChild(typeElement, Constants.XML_ELEMENT_IGNORE); if (ignoreElement != null) { parseAttributeAttributes(ignoreElement, typeName, errorViewCollector, ignoreTable); parseIgnoreListAttribute(ignoreElement, typeName, errorViewCollector, ignoreTable, ignorelistsDefinition); @@ -384,7 +304,7 @@ } /** - * Parses the {@link #XML_ELEMENT_REQUIRED} child. + * Parses the {@link Constants#XML_ELEMENT_REQUIRED} child. * @param typeElement the root element * @param typeName the type name * @param errorViewCollector the error view collector for error messages @@ -393,31 +313,31 @@ @NotNull private static ArchetypeAttributesDefinition parseRequiredAttribute(@NotNull final Element typeElement, @NotNull final String typeName, @NotNull final ErrorViewCollector errorViewCollector) { final ArchetypeAttributesDefinition attributes = new ArchetypeAttributesDefinition(); - final Element requiredElement = NodeListIterator.getFirstChild(typeElement, XML_ELEMENT_REQUIRED); + final Element requiredElement = NodeListIterator.getFirstChild(typeElement, Constants.XML_ELEMENT_REQUIRED); if (requiredElement != null) { - final Iterator<Element> attributeIterator = new NodeListIterator<Element>(requiredElement, XML_ELEMENT_ATTRIBUTE); + final Iterator<Element> attributeIterator = new NodeListIterator<Element>(requiredElement, Constants.XML_ELEMENT_ATTRIBUTE); while (attributeIterator.hasNext()) { final Element attributeElement = attributeIterator.next(); - final Attr archAttribute = attributeElement.getAttributeNode(XML_ATTRIBUTE_ARCH); + final Attr archAttribute = attributeElement.getAttributeNode(Constants.XML_ATTRIBUTE_ARCH); if (archAttribute == null) { - errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, XML_ELEMENT_REQUIRED + ": element of type " + typeName + ": " + XML_ELEMENT_ATTRIBUTE + " missing '" + XML_ATTRIBUTE_ARCH + "'."); + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, Constants.XML_ELEMENT_REQUIRED + ": element of type " + typeName + ": " + Constants.XML_ELEMENT_ATTRIBUTE + " missing '" + Constants.XML_ATTRIBUTE_ARCH + "'."); continue; } final String attributeValue = archAttribute.getValue(); if (attributeValue.isEmpty()) { - errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, XML_ELEMENT_REQUIRED + ": element of type " + typeName + ": " + XML_ELEMENT_ATTRIBUTE + " empty '" + XML_ATTRIBUTE_ARCH + "'."); + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, Constants.XML_ELEMENT_REQUIRED + ": element of type " + typeName + ": " + Constants.XML_ELEMENT_ATTRIBUTE + " empty '" + Constants.XML_ATTRIBUTE_ARCH + "'."); continue; } - final Attr valueAttribute = attributeElement.getAttributeNode(XML_ATTRIBUTE_VALUE); + final Attr valueAttribute = attributeElement.getAttributeNode(Constants.XML_ATTRIBUTE_VALUE); if (valueAttribute == null) { - errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, XML_ELEMENT_REQUIRED + ": element of type " + typeName + ": " + XML_ELEMENT_ATTRIBUTE + " missing '" + XML_ATTRIBUTE_VALUE + "'."); + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, Constants.XML_ELEMENT_REQUIRED + ": element of type " + typeName + ": " + Constants.XML_ELEMENT_ATTRIBUTE + " missing '" + Constants.XML_ATTRIBUTE_VALUE + "'."); continue; } final String value = valueAttribute.getValue(); if (value.isEmpty()) { - errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, XML_ELEMENT_REQUIRED + ": element of type " + typeName + ": " + XML_ELEMENT_ATTRIBUTE + " empty '" + XML_ATTRIBUTE_VALUE + "'."); + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, Constants.XML_ELEMENT_REQUIRED + ": element of type " + typeName + ": " + Constants.XML_ELEMENT_ATTRIBUTE + " empty '" + Constants.XML_ATTRIBUTE_VALUE + "'."); continue; } @@ -428,26 +348,26 @@ } /** - * Parses the {@link #XML_ELEMENT_ATTRIBUTE} child. + * Parses the {@link Constants#XML_ELEMENT_ATTRIBUTE} child. * @param ignoreElement the ignore element to parse * @param typeName the type name for error messages * @param errorViewCollector the error view collector for error messages * @param ignoreTable the ignore table to add to */ private static void parseAttributeAttributes(@NotNull final Element ignoreElement, @NotNull final String typeName, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final Collection<String> ignoreTable) { - final Iterator<Element> attributeIterator = new NodeListIterator<Element>(ignoreElement, XML_ELEMENT_ATTRIBUTE); + final Iterator<Element> attributeIterator = new NodeListIterator<Element>(ignoreElement, Constants.XML_ELEMENT_ATTRIBUTE); while (attributeIterator.hasNext()) { final Element attributeElement = attributeIterator.next(); - final Attr archAttribute = attributeElement.getAttributeNode(XML_ATTRIBUTE_ARCH); + final Attr archAttribute = attributeElement.getAttributeNode(Constants.XML_ATTRIBUTE_ARCH); if (archAttribute == null) { - errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, XML_ELEMENT_IGNORE + ": section of type " + typeName + ": " + XML_ELEMENT_ATTRIBUTE + " missing '" + XML_ATTRIBUTE_ARCH + "'."); + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, Constants.XML_ELEMENT_IGNORE + ": section of type " + typeName + ": " + Constants.XML_ELEMENT_ATTRIBUTE + " missing '" + Constants.XML_ATTRIBUTE_ARCH + "'."); continue; } final String attributeValue = archAttribute.getValue(); if (attributeValue.isEmpty()) { - errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, XML_ELEMENT_IGNORE + ": section of type " + typeName + ": " + XML_ELEMENT_ATTRIBUTE + " empty '" + XML_ATTRIBUTE_ARCH + "'."); + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, Constants.XML_ELEMENT_IGNORE + ": section of type " + typeName + ": " + Constants.XML_ELEMENT_ATTRIBUTE + " empty '" + Constants.XML_ATTRIBUTE_ARCH + "'."); continue; } @@ -464,20 +384,20 @@ * @param ignorelistsDefinition the ignore lists to use */ private static void parseIgnoreListAttribute(@NotNull final Element ignoreElement, @NotNull final String typeName, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final Collection<String> ignoreTable, @NotNull final IgnorelistsDefinition ignorelistsDefinition) { - final Iterator<Element> ignoreListIterator = new NodeListIterator<Element>(ignoreElement, XML_ELEMENT_IGNORE_LIST); + final Iterator<Element> ignoreListIterator = new NodeListIterator<Element>(ignoreElement, Constants.XML_ELEMENT_IGNORE_LIST); while (ignoreListIterator.hasNext()) { final Element ignoreListElement = ignoreListIterator.next(); - final Attr nameAttribute = ignoreListElement.getAttributeNode(XML_IGNORE_LIST_NAME); + final Attr nameAttribute = ignoreListElement.getAttributeNode(Constants.XML_IGNORE_LIST_NAME); if (nameAttribute == null) { - errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, XML_ELEMENT_IGNORE + ": section of type " + typeName + ": " + XML_ELEMENT_IGNORE_LIST + " missing '" + XML_IGNORE_LIST_NAME + "'."); + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, Constants.XML_ELEMENT_IGNORE + ": section of type " + typeName + ": " + Constants.XML_ELEMENT_IGNORE_LIST + " missing '" + Constants.XML_IGNORE_LIST_NAME + "'."); continue; } final String name = nameAttribute.getValue(); final Iterable<String> ignoreList = ignorelistsDefinition.get(name); if (ignoreList == null) { - errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, XML_ELEMENT_IGNORE + ": section of type " + typeName + ": " + XML_ELEMENT_IGNORE_LIST + " with " + XML_IGNORE_LIST_NAME + " \"" + name + "\" is undefined."); + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, Constants.XML_ELEMENT_IGNORE + ": section of type " + typeName + ": " + Constants.XML_ELEMENT_IGNORE_LIST + " with " + Constants.XML_IGNORE_LIST_NAME + " \"" + name + "\" is undefined."); continue; } @@ -488,32 +408,32 @@ } /** - * Parses the {@link #XML_DESCRIPTION} child. + * Parses the {@link Constants#XML_DESCRIPTION} child. * @param root the root element * @return the description or <code>null</code> if no description is * present */ @Nullable private static String parseDescription(@NotNull final Element root) { - final Node elem = NodeListIterator.getFirstChild(root, XML_DESCRIPTION); + final Node elem = NodeListIterator.getFirstChild(root, Constants.XML_DESCRIPTION); return elem == null ? null : elem.getTextContent().trim(); } /** - * Parses the {@link #XML_USE} child. + * Parses the {@link Constants#XML_USE} child. * @param root the root element * @return the use or <code>null</code> if no use is present */ @Nullable private static String parseUse(@NotNull final Element root) { - final Node elem = NodeListIterator.getFirstChild(root, XML_USE); + final Node elem = NodeListIterator.getFirstChild(root, Constants.XML_USE); return elem == null ? null : elem.getTextContent().trim(); } /** - * Parses the {@link #XML_ELEMENT_ATTRIBUTE} and {@link - * #XML_ELEMENT_SECTION} children of a "type" or "default_type" element and - * adds all found attributes to an {@link ArchetypeAttribute}. + * Parses the {@link Constants#XML_ELEMENT_ATTRIBUTE} and {@link + * Constants#XML_ELEMENT_SECTION} children of a "type" or "default_type" + * element and adds all found attributes to an {@link ArchetypeAttribute}. * @param typeElement the type element to parse * @param attributeSection the archetype attributes to add to * @param errorViewCollector the error view collector for reporting errors @@ -529,24 +449,24 @@ final Element childElement = childIterator.next(); final String childName = childElement.getNodeName(); - if (childName.equals(XML_ELEMENT_ATTRIBUTE)) { + if (childName.equals(Constants.XML_ELEMENT_ATTRIBUTE)) { parseAttribute(childElement, errorViewCollector, typeName, sectionNames, defaultSectionName, archetypeTypeSet, attributeSection); - } else if (childName.equals(XML_ELEMENT_SECTION) && childElement.hasChildNodes()) { - final Attr nameAttribute = childElement.getAttributeNode(XML_SECTION_NAME); + } else if (childName.equals(Constants.XML_ELEMENT_SECTION) && childElement.hasChildNodes()) { + final Attr nameAttribute = childElement.getAttributeNode(Constants.XML_SECTION_NAME); if (nameAttribute == null) { - errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, "type " + typeName + " contains a " + XML_ELEMENT_SECTION + " missing '" + XML_SECTION_NAME + "'."); + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, "type " + typeName + " contains a " + Constants.XML_ELEMENT_SECTION + " missing '" + Constants.XML_SECTION_NAME + "'."); continue; } final String sectionName = nameAttribute.getValue(); if (sectionName.isEmpty()) { - errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, "type " + typeName + " contains a " + XML_ELEMENT_SECTION + " with empty '" + XML_SECTION_NAME + "'."); + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, "type " + typeName + " contains a " + Constants.XML_ELEMENT_SECTION + " with empty '" + Constants.XML_SECTION_NAME + "'."); continue; } sectionNames.defineSectionName(sectionName); - final Iterator<Element> attributeIterator = new NodeListIterator<Element>(childElement, XML_ELEMENT_ATTRIBUTE); + final Iterator<Element> attributeIterator = new NodeListIterator<Element>(childElement, Constants.XML_ELEMENT_ATTRIBUTE); while (attributeIterator.hasNext()) { parseAttribute(attributeIterator.next(), errorViewCollector, typeName, sectionNames, sectionName, archetypeTypeSet, attributeSection); } @@ -555,7 +475,7 @@ } /** - * Parses an {@link #XML_ELEMENT_ATTRIBUTE} element. + * Parses an {@link Constants#XML_ELEMENT_ATTRIBUTE} element. * @param attributeElement the attribute element to parse * @param errorViewCollector the error view collector for reporting errors * @param typeName the type name of the element being parsed Modified: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java 2013-05-28 18:16:03 UTC (rev 9232) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java 2013-05-28 18:35:36 UTC (rev 9233) @@ -45,185 +45,6 @@ public class ArchetypeTypeSetParser { /** - * The name of the "default_type" element. - */ - @NotNull - private static final String XML_ELEMENT_DEFAULT_TYPE = "default_type"; - - /** - * The name of the "bitmasks" element. - */ - @NotNull - private static final String XML_ELEMENT_BITMASKS = "bitmasks"; - - /** - * The name of the "bitmask" element. - */ - @NotNull - private static final String XML_ELEMENT_BITMASK = "bitmask"; - - /** - * The name of the "name" attribute within {@link #XML_ELEMENT_BITMASK} - * elements. - */ - @NotNull - private static final String XML_BITMASK_NAME = "name"; - - /** - * The name of the "is_named" attribute within {@link #XML_ELEMENT_BITMASK} - * elements. - */ - @NotNull - private static final String XML_BITMASK_IS_NAMED = "is_named"; - - /** - * The name of the "bmentry" element. - */ - @NotNull - private static final String XML_ELEMENT_BMENTRY = "bmentry"; - - /** - * The name of the "bit" attribute within {@link #XML_ELEMENT_BMENTRY} - * elements. - */ - @NotNull - private static final String XML_BMENTRY_BIT = "bit"; - - /** - * The name of the "name" attribute within {@link #XML_ELEMENT_BMENTRY} - * elements. - */ - @NotNull - private static final String XML_BMENTRY_NAME = "name"; - - /** - * The name of the "value" attribute within {@link #XML_ELEMENT_BMENTRY} - * elements. - */ - @NotNull - private static final String XML_BMENTRY_VALUE = "value"; - - /** - * The name of the "encoding" attribute within {@link #XML_ELEMENT_BMENTRY} - * elements. - */ - @NotNull - private static final String XML_BMENTRY_ENCODING = "encoding"; - - /** - * The name of the "lists" element. - */ - @NotNull - private static final String XML_ELEMENT_LISTS = "lists"; - - /** - * The name of the "list" element. - */ - @NotNull - private static final String XML_ELEMENT_LIST = "list"; - - /** - * The name of the "name" attribute within {@link #XML_ELEMENT_LIST} - * elements. - */ - @NotNull - private static final String XML_LIST_NAME = "name"; - - /** - * The name of the "listentry" element. - */ - @NotNull - private static final String XML_ELEMENT_LISTENTRY = "listentry"; - - /** - * The name of the "name" attribute within {@link #XML_ELEMENT_LISTENTRY} - * elements. - */ - @NotNull - private static final String XML_LISTENTRY_NAME = "name"; - - /** - * The name of the "value" attribute within {@link #XML_ELEMENT_LISTENTRY} - * elements. - */ - @NotNull - private static final String XML_LISTENTRY_VALUE = "value"; - - /** - * The name of the "type" element. - */ - @NotNull - private static final String XML_ELEMENT_TYPE = "type"; - - /** - * The name of the "available" attribute within {@link #XML_ELEMENT_TYPE} - * elements. - */ - @NotNull - private static final String XML_TYPE_AVAILABLE = "available"; - - /** - * The name of the "name" attribute within {@link #XML_ELEMENT_TYPE} or - * {@link #XML_ELEMENT_DEFAULT_TYPE} elements. - */ - @NotNull - public static final String XML_TYPE_NAME = "name"; - - /** - * The name of the "number" attribute within {@link #XML_ELEMENT_TYPE} - * elements. - */ - @NotNull - public static final String XML_TYPE_NUMBER = "number"; - - /** - * The name of the "map" attribute within {@link #XML_ELEMENT_TYPE} - * elements. - */ - @NotNull - public static final String XML_TYPE_MAP = "map"; - - /** - * The name of the "inv" attribute within {@link #XML_ELEMENT_TYPE} - * elements. - */ - @NotNull - public static final String XML_TYPE_INV = "inv"; - - /** - * The name of the "allows_all_inv" attribute within {@link - * #XML_ELEMENT_TYPE} elements. - */ - @NotNull - public static final String XML_TYPE_ALLOWS_ALL_INV = "allows_all_inv"; - - /** - * 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 - private static final String XML_ELEMENT_IGNORELISTS = "ignorelists"; - - /** - * The name of the "ignore_list" element. - */ - @NotNull - private static final String XML_ELEMENT_IGNORE_LIST = "ignore_list"; - - /** - * The name of the "name" attribute within {@link #XML_ELEMENT_IGNORE_LIST} - * elements. - */ - @NotNull - private static final String XML_IGNORE_LIST_NAME = "name"; - - /** * The logger for printing log messages. */ @NotNull @@ -294,12 +115,12 @@ */ public void loadTypesFromXML(@NotNull final ErrorViewCollector errorViewCollector, @NotNull final String filename, @NotNull final Document document) { final Element rootElement = document.getDocumentElement(); - parseBitmasks(XmlUtils.getChild(rootElement, XML_ELEMENT_BITMASKS), errorViewCollector); - parseLists(XmlUtils.getChild(rootElement, XML_ELEMENT_LISTS), errorViewCollector); - final IgnorelistsDefinition ignorelistsDefinition = parseIgnoreLists(XmlUtils.getChild(rootElement, XML_ELEMENT_IGNORELISTS), errorViewCollector); - parseDefaultType(XmlUtils.getChild(rootElement, XML_ELEMENT_DEFAULT_TYPE), errorViewCollector, ignorelistsDefinition); + parseBitmasks(XmlUtils.getChild(rootElement, Constants.XML_ELEMENT_BITMASKS), errorViewCollector); + parseLists(XmlUtils.getChild(rootElement, Constants.XML_ELEMENT_LISTS), errorViewCollector); + final IgnorelistsDefinition ignorelistsDefinition = parseIgnoreLists(XmlUtils.getChild(rootElement, Constants.XML_ELEMENT_IGNORELISTS), errorViewCollector); + parseDefaultType(XmlUtils.getChild(rootElement, Constants.XML_ELEMENT_DEFAULT_TYPE), errorViewCollector, ignorelistsDefinition); - final Iterator<Element> typeElements = new NodeListIterator<Element>(rootElement, XML_ELEMENT_TYPE); + final Iterator<Element> typeElements = new NodeListIterator<Element>(rootElement, Constants.XML_ELEMENT_TYPE); while (typeElements.hasNext()) { parseTypes(typeElements.next(), errorViewCollector, ignorelistsDefinition); } @@ -310,16 +131,16 @@ } /** - * Parses the {@link #XML_ELEMENT_BITMASKS} section of a types.xml file. + * Parses the {@link Constants#XML_ELEMENT_BITMASKS} section of a types.xml file. * @param bitmasksElement the element to parse * @param errorViewCollector the error view collector for reporting errors */ private void parseBitmasks(@NotNull final Element bitmasksElement, @NotNull final ErrorViewCollector errorViewCollector) { - final Iterator<Element> bitmaskIterator = new NodeListIterator<Element>(bitmasksElement, XML_ELEMENT_BITMASK); + final Iterator<Element> bitmaskIterator = new NodeListIterator<Element>(bitmasksElement, Constants.XML_ELEMENT_BITMASK); while (bitmaskIterator.hasNext()) { final Element bitmaskElement = bitmaskIterator.next(); - final String name = bitmaskElement.getAttribute(XML_BITMASK_NAME); + final String name = bitmaskElement.getAttribute(Constants.XML_BITMASK_NAME); final AttributeBitmask attributeBitmask = parseBitmask(bitmaskElement, name, errorViewCollector); if (attributeBitmask != null) { archetypeTypeSet.addBitmask(name, attributeBitmask); @@ -328,7 +149,7 @@ } /** - * Parses a {@link #XML_ELEMENT_BITMASK} section of a types.xml file. + * Parses a {@link Constants#XML_ELEMENT_BITMASK} section of a types.xml file. * @param bitmaskElement the element to parse * @param name the name of the bitmask element * @param errorViewCollector the error view collector for reporting errors @@ -337,15 +158,15 @@ */ @Nullable private static AttributeBitmask parseBitmask(@NotNull final Element bitmaskElement, @NotNull final String name, @NotNull final ErrorViewCollector errorViewCollector) { - final boolean isNamed = bitmaskElement.getAttribute(XML_BITMASK_IS_NAMED).equals("yes"); + final boolean isNamed = bitmaskElement.getAttribute(Constants.XML_BITMASK_IS_NAMED).equals("yes"); final AttributeBitmask attributeBitmask = new AttributeBitmask(isNamed); - final NodeListIterator<Element> entries = new NodeListIterator<Element>(bitmaskElement, XML_ELEMENT_BMENTRY); + final NodeListIterator<Element> entries = new NodeListIterator<Element>(bitmaskElement, Constants.XML_ELEMENT_BMENTRY); while (entries.hasNext()) { parseBmentry(entries.next(), errorViewCollector, name, isNamed, attributeBitmask); } if (attributeBitmask.getNumber() <= 0) { - errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, name + ": no '" + XML_BMENTRY_BIT + "' entries"); + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, name + ": no '" + Constants.XML_BMENTRY_BIT + "' entries"); return null; } @@ -362,7 +183,7 @@ } /** - * Parses a {@link #XML_ELEMENT_BMENTRY} section of a types.xml file. + * Parses a {@link Constants#XML_ELEMENT_BMENTRY} section of a types.xml file. * @param errorViewCollector the error view collector for reporting errors * @param bmentryElement the "bmentry" section to parse * @param bitmaskName the name of the parent's "bitmask" section for error @@ -371,26 +192,26 @@ * @param attributeBitmask the bitmask attribute to update */ private static void parseBmentry(@NotNull final Element bmentryElement, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final String bitmaskName, final boolean isNamed, @NotNull final AttributeBitmask attributeBitmask) { - final String bitAttribute = bmentryElement.getAttribute(XML_BMENTRY_BIT); + final String bitAttribute = bmentryElement.getAttribute(Constants.XML_BMENTRY_BIT); - final String valueAttribute = bmentryElement.getAttribute(XML_BMENTRY_VALUE); + final String valueAttribute = bmentryElement.getAttribute(Constants.XML_BMENTRY_VALUE); if (bitAttribute.length() != 0 && valueAttribute.length() != 0) { - errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, bitmaskName + ": element contains both '" + XML_BMENTRY_BIT + "' and '" + XML_BMENTRY_VALUE + "' attributes"); + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, bitmaskName + ": element contains both '" + Constants.XML_BMENTRY_BIT + "' and '" + Constants.XML_BMENTRY_VALUE + "' attributes"); return; } - final String name = bmentryElement.getAttribute(XML_BMENTRY_NAME); + final String name = bmentryElement.getAttribute(Constants.XML_BMENTRY_NAME); final int value; if (bitAttribute.length() == 0) { if (!isNamed) { - errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, bitmaskName + ": '" + XML_BMENTRY_VALUE + "' attribute allowed only in named bitmasks"); + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, bitmaskName + ": '" + Constants.XML_BMENTRY_VALUE + "' attribute allowed only in named bitmasks"); return; } try { value = Integer.parseInt(valueAttribute); } catch (final NumberFormatException ignored) { - errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, bitmaskName + ": invalid '" + XML_BMENTRY_VALUE + "' value: " + valueAttribute); + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, bitmaskName + ": invalid '" + Constants.XML_BMENTRY_VALUE + "' value: " + valueAttribute); return; } } else { @@ -398,15 +219,15 @@ try { bitValue = Integer.parseInt(bitAttribute); } catch (final NumberFormatException ignored) { - errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, bitmaskName + ": invalid '" + XML_BMENTRY_BIT + "' value: " + bitAttribute); + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, bitmaskName + ": invalid '" + Constants.XML_BMENTRY_BIT + "' value: " + bitAttribute); return; } if (bitValue < 0 || bitValue >= 32) { - errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, bitmaskName + ": invalid '" + XML_BMENTRY_BIT + "' value: " + bitValue); + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, bitmaskName + ": invalid '" + Constants.XML_BMENTRY_BIT + "' value: " + bitValue); return; } if (!attributeBitmask.addBitName(bitValue, name)) { - errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, bitmaskName + ": duplicate '" + XML_BMENTRY_BIT + "' value: " + bitValue); + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, bitmaskName + ": duplicate '" + Constants.XML_BMENTRY_BIT + "' value: " + bitValue); return; } value = 1 << bitValue; @@ -414,16 +235,16 @@ attributeBitmask.addName(name, value); - final String encoding = bmentryElement.getAttribute(XML_BMENTRY_ENCODING); + final String encoding = bmentryElement.getAttribute(Constants.XML_BMENTRY_ENCODING); if (isNamed) { if (encoding.length() == 0) { - errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, bitmaskName + ": missing '" + XML_BMENTRY_ENCODING + "' attribute"); + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, bitmaskName + ": missing '" + Constants.XML_BMENTRY_ENCODING + "' attribute"); return; } attributeBitmask.addNamedValue(encoding, value); } else { if (encoding.length() != 0) { - errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, bitmaskName + ": unused '" + XML_BMENTRY_ENCODING + "' attribute"); + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, bitmaskName + ": unused '" + Constants.XML_BMENTRY_ENCODING + "' attribute"); //noinspection UnnecessaryReturnStatement return; } @@ -431,43 +252,43 @@ } /** - * Parses the {@link #XML_ELEMENT_LISTS} section of a types.xml file. + * Parses the {@link Constants#XML_ELEMENT_LISTS} section of a types.xml file. * @param listsElement the element to parse * @param errorViewCollector the error view collector for reporting errors */ private void parseLists(@NotNull final Element listsElement, @NotNull final ErrorViewCollector errorViewCollector) { - final Iterator<Element> listIterator = new NodeListIterator<Element>(listsElement, XML_ELEMENT_LIST); + final Iterator<Element> listIterator = new NodeListIterator<Element>(listsElement, Constants.XML_ELEMENT_LIST); while (listIterator.hasNext()) { parseList(listIterator.next(), errorViewCollector); } } /** - * Parses an {@link #XML_ELEMENT_LIST} section of a types.xml file and adds + * Parses an {@link Constants#XML_ELEMENT_LIST} section of a types.xml file and adds * it to {@link #archetypeTypeSet}. * @param listElement the element to parse * @param errorViewCollector the error view collector for reporting errors */ private void parseList(@NotNull final Element listElement, @NotNull final ErrorViewCollector errorViewCollector) { final ArchetypeTypeList list = new ArchetypeTypeList(); - final Iterator<Element> listentryIterator = new NodeListIterator... [truncated message content] |
From: <aki...@us...> - 2013-05-28 18:16:05
|
Revision: 9232 http://sourceforge.net/p/gridarta/code/9232 Author: akirschbaum Date: 2013-05-28 18:16:03 +0000 (Tue, 28 May 2013) Log Message: ----------- Extract code into function. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java Modified: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java 2013-05-28 18:12:14 UTC (rev 9231) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java 2013-05-28 18:16:03 UTC (rev 9232) @@ -493,34 +493,43 @@ final Iterator<Element> ignoreListIterator = new NodeListIterator<Element>(ignorelistsElement, XML_ELEMENT_IGNORE_LIST); final IgnorelistsDefinition ignorelistsDefinition = new IgnorelistsDefinition(); while (ignoreListIterator.hasNext()) { - final Element ignoreListElement = ignoreListIterator.next(); - final String name = ignoreListElement.getAttribute(XML_IGNORE_LIST_NAME); - if (ignorelistsDefinition.containsKey(name)) { - errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, name + ": duplicate name"); - } + parseIgnoreList(ignoreListIterator.next(), errorViewCollector, ignorelistsDefinition); + } + return ignorelistsDefinition; + } - final Iterator<Element> attributeIterator = new NodeListIterator<Element>(ignoreListElement, ArchetypeAttributeParser.XML_ELEMENT_ATTRIBUTE); - while (attributeIterator.hasNext()) { - final Element attributeElement = attributeIterator.next(); - final Attr archAttribute = attributeElement.getAttributeNode(ArchetypeAttributeParser.XML_ATTRIBUTE_ARCH); - if (archAttribute != null) { - try { - ignorelistsDefinition.put(name, archAttribute.getValue()); - } catch (final IllegalArgumentException ex) { - errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, name + ": " + ex.getMessage() + "."); - } - } else { - errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, name + ": attribute missing '" + ArchetypeAttributeParser.XML_ATTRIBUTE_ARCH + "'."); - } + /** + * Parses the {@link #XML_ELEMENT_IGNORE_LIST} section of a types.xml file. + * @param ignoreListElement the element to parse + * @param errorViewCollector the error view collector for reporting errors + * @param ignorelistsDefinition the ignore lists definition to update + */ + private static void parseIgnoreList(@NotNull final Element ignoreListElement, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final IgnorelistsDefinition ignorelistsDefinition) { + final String name = ignoreListElement.getAttribute(XML_IGNORE_LIST_NAME); + if (ignorelistsDefinition.containsKey(name)) { + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, name + ": duplicate name"); + } + final Iterator<Element> attributeIterator = new NodeListIterator<Element>(ignoreListElement, ArchetypeAttributeParser.XML_ELEMENT_ATTRIBUTE); + while (attributeIterator.hasNext()) { + final Element attributeElement = attributeIterator.next(); + final Attr archAttribute = attributeElement.getAttributeNode(ArchetypeAttributeParser.XML_ATTRIBUTE_ARCH); + if (archAttribute != null) { try { - rejectAttributes(attributeElement, ArchetypeAttributeParser.XML_ATTRIBUTE_TYPE, ArchetypeAttributeParser.XML_ATTRIBUTE_ARCH_BEGIN, ArchetypeAttributeParser.XML_ATTRIBUTE_ARCH_END, ArchetypeAttributeParser.XML_ATTRIBUTE_EDITOR, ArchetypeAttributeParser.XML_ATTRIBUTE_VALUE, ArchetypeAttributeParser.XML_ATTRIBUTE_MIN, ArchetypeAttributeParser.XML_ATTRIBUTE_MAX, ArchetypeAttributeParser.XML_ATTRIBUTE_CHECK_MIN, ArchetypeAttributeParser.XML_ATTRIBUTE_CHECK_MAX, ArchetypeAttributeParser.XML_ATTRIBUTE_LENGTH, ArchetypeAttributeParser.XML_ATTRIBUTE_TRUE, ArchetypeAttributeParser.XML_ATTRIBUTE_FALSE, ArchetypeAttributeParser.XML_ATTRIBUTE_MARKER); - } catch (final SyntaxErrorException ex) { + ignorelistsDefinition.put(name, archAttribute.getValue()); + } catch (final IllegalArgumentException ex) { errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, name + ": " + ex.getMessage() + "."); } + } else { + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, name + ": attribute missing '" + ArchetypeAttributeParser.XML_ATTRIBUTE_ARCH + "'."); } + + try { + rejectAttributes(attributeElement, ArchetypeAttributeParser.XML_ATTRIBUTE_TYPE, ArchetypeAttributeParser.XML_ATTRIBUTE_ARCH_BEGIN, ArchetypeAttributeParser.XML_ATTRIBUTE_ARCH_END, ArchetypeAttributeParser.XML_ATTRIBUTE_EDITOR, ArchetypeAttributeParser.XML_ATTRIBUTE_VALUE, ArchetypeAttributeParser.XML_ATTRIBUTE_MIN, ArchetypeAttributeParser.XML_ATTRIBUTE_MAX, ArchetypeAttributeParser.XML_ATTRIBUTE_CHECK_MIN, ArchetypeAttributeParser.XML_ATTRIBUTE_CHECK_MAX, ArchetypeAttributeParser.XML_ATTRIBUTE_LENGTH, ArchetypeAttributeParser.XML_ATTRIBUTE_TRUE, ArchetypeAttributeParser.XML_ATTRIBUTE_FALSE, ArchetypeAttributeParser.XML_ATTRIBUTE_MARKER); + } catch (final SyntaxErrorException ex) { + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, name + ": " + ex.getMessage() + "."); + } } - return ignorelistsDefinition; } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-05-28 18:12:17
|
Revision: 9231 http://sourceforge.net/p/gridarta/code/9231 Author: akirschbaum Date: 2013-05-28 18:12:14 +0000 (Tue, 28 May 2013) Log Message: ----------- Change parameter order. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java Modified: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java 2013-05-28 18:10:56 UTC (rev 9230) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java 2013-05-28 18:12:14 UTC (rev 9231) @@ -438,21 +438,21 @@ private void parseLists(@NotNull final Element listsElement, @NotNull final ErrorViewCollector errorViewCollector) { final Iterator<Element> listIterator = new NodeListIterator<Element>(listsElement, XML_ELEMENT_LIST); while (listIterator.hasNext()) { - parseList(errorViewCollector, listIterator.next()); + parseList(listIterator.next(), errorViewCollector); } } /** * Parses an {@link #XML_ELEMENT_LIST} section of a types.xml file and adds * it to {@link #archetypeTypeSet}. + * @param listElement the element to parse * @param errorViewCollector the error view collector for reporting errors - * @param listElement the element to parse */ - private void parseList(@NotNull final ErrorViewCollector errorViewCollector, @NotNull final Element listElement) { + private void parseList(@NotNull final Element listElement, @NotNull final ErrorViewCollector errorViewCollector) { final ArchetypeTypeList list = new ArchetypeTypeList(); final Iterator<Element> listentryIterator = new NodeListIterator<Element>(listElement, XML_ELEMENT_LISTENTRY); while (listentryIterator.hasNext()) { - parseListEntry(errorViewCollector, list, listentryIterator.next()); + parseListEntry(listentryIterator.next(), errorViewCollector, list); } final String name = listElement.getAttribute(XML_LIST_NAME); archetypeTypeSet.addList(name, list); @@ -461,11 +461,11 @@ /** * Parses an {@link #XML_ELEMENT_LISTENTRY} section of a types.xml file and * adds it to an {@link ArchetypeTypeList}. + * @param listentryElement the element to parse * @param errorViewCollector the error view collector for reporting errors * @param list the archetype type list to add to - * @param listentryElement the element to parse */ - private static void parseListEntry(@NotNull final ErrorViewCollector errorViewCollector, @NotNull final ArchetypeTypeList list, @NotNull final Element listentryElement) { + private static void parseListEntry(@NotNull final Element listentryElement, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final ArchetypeTypeList list) { final String name = listentryElement.getAttribute(XML_LISTENTRY_NAME); final String valueString = listentryElement.getAttribute(XML_LISTENTRY_VALUE); final int value; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-05-28 18:11:01
|
Revision: 9230 http://sourceforge.net/p/gridarta/code/9230 Author: akirschbaum Date: 2013-05-28 18:10:56 +0000 (Tue, 28 May 2013) Log Message: ----------- Reorganize ArchetypeTypeSetParser code. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java Modified: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java 2013-05-28 17:56:59 UTC (rev 9229) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java 2013-05-28 18:10:56 UTC (rev 9230) @@ -438,46 +438,51 @@ private void parseLists(@NotNull final Element listsElement, @NotNull final ErrorViewCollector errorViewCollector) { final Iterator<Element> listIterator = new NodeListIterator<Element>(listsElement, XML_ELEMENT_LIST); while (listIterator.hasNext()) { - final Element listElement = listIterator.next(); - final ArchetypeTypeList list = parseList(errorViewCollector, listElement); - if (list.size() > 0) { - final String name = listElement.getAttribute(XML_LIST_NAME); - archetypeTypeSet.addList(name, list); - } + parseList(errorViewCollector, listIterator.next()); } } /** - * Parses an {@link #XML_ELEMENT_LIST} section of a types.xml file. + * Parses an {@link #XML_ELEMENT_LIST} section of a types.xml file and adds + * it to {@link #archetypeTypeSet}. * @param errorViewCollector the error view collector for reporting errors * @param listElement the element to parse - * @return the parsed archetype type list */ - @NotNull - private static ArchetypeTypeList parseList(@NotNull final ErrorViewCollector errorViewCollector, @NotNull final Element listElement) { + private void parseList(@NotNull final ErrorViewCollector errorViewCollector, @NotNull final Element listElement) { final ArchetypeTypeList list = new ArchetypeTypeList(); final Iterator<Element> listentryIterator = new NodeListIterator<Element>(listElement, XML_ELEMENT_LISTENTRY); while (listentryIterator.hasNext()) { - final Element listentryElement = listentryIterator.next(); - final String name = listentryElement.getAttribute(XML_LISTENTRY_NAME); - final String valueString = listentryElement.getAttribute(XML_LISTENTRY_VALUE); - final int value; - try { - value = Integer.valueOf(valueString); - } catch (final NumberFormatException ignore) { - errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, name + ": value '" + valueString + "' is not an integer."); - continue; - } - try { - list.add(value, name); - } catch (final IllegalArgumentException ex) { - errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, ex.getMessage() + "."); - } + parseListEntry(errorViewCollector, list, listentryIterator.next()); } - return list; + final String name = listElement.getAttribute(XML_LIST_NAME); + archetypeTypeSet.addList(name, list); } /** + * Parses an {@link #XML_ELEMENT_LISTENTRY} section of a types.xml file and + * adds it to an {@link ArchetypeTypeList}. + * @param errorViewCollector the error view collector for reporting errors + * @param list the archetype type list to add to + * @param listentryElement the element to parse + */ + private static void parseListEntry(@NotNull final ErrorViewCollector errorViewCollector, @NotNull final ArchetypeTypeList list, @NotNull final Element listentryElement) { + final String name = listentryElement.getAttribute(XML_LISTENTRY_NAME); + final String valueString = listentryElement.getAttribute(XML_LISTENTRY_VALUE); + final int value; + try { + value = Integer.valueOf(valueString); + } catch (final NumberFormatException ignore) { + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, name + ": value '" + valueString + "' is not an integer."); + return; + } + try { + list.add(value, name); + } catch (final IllegalArgumentException ex) { + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, ex.getMessage() + "."); + } + } + + /** * Parses the {@link #XML_ELEMENT_IGNORELISTS} section of a types.xml file. * @param ignorelistsElement the element to parse * @param errorViewCollector the error view collector for reporting errors This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-05-28 17:57:05
|
Revision: 9229 http://sourceforge.net/p/gridarta/code/9229 Author: akirschbaum Date: 2013-05-28 17:56:59 +0000 (Tue, 28 May 2013) Log Message: ----------- Extract XmlUtils from ArchetypeTypeSetParser. Modified Paths: -------------- trunk/build.xml trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java trunk/utils/utils.iml Added Paths: ----------- trunk/utils/src/app/net/sf/gridarta/utils/XmlUtils.java Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2013-05-25 17:23:39 UTC (rev 9228) +++ trunk/build.xml 2013-05-28 17:56:59 UTC (rev 9229) @@ -606,6 +606,7 @@ <path refid="path.lib.annotations"/> <path refid="path.lib.japi-swing-action"/> <path refid="path.lib.japi-util"/> + <path refid="path.lib.japi-xml"/> <path refid="path.lib.log4j"/> </classpath> <compilerarg line="${javac.args}"/> @@ -620,6 +621,7 @@ <path refid="path.lib.annotations"/> <path refid="path.lib.japi-swing-action"/> <path refid="path.lib.japi-util"/> + <path refid="path.lib.japi-xml"/> <path refid="path.lib.junit"/> </classpath> <compilerarg line="${javac.args}"/> Modified: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java 2013-05-25 17:23:39 UTC (rev 9228) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java 2013-05-28 17:56:59 UTC (rev 9229) @@ -25,6 +25,7 @@ import net.sf.gridarta.model.errorview.ErrorViewCategory; import net.sf.gridarta.model.errorview.ErrorViewCollector; import net.sf.gridarta.utils.SyntaxErrorException; +import net.sf.gridarta.utils.XmlUtils; import net.sf.japi.xml.NodeListIterator; import org.apache.log4j.Category; import org.apache.log4j.Logger; @@ -293,10 +294,10 @@ */ public void loadTypesFromXML(@NotNull final ErrorViewCollector errorViewCollector, @NotNull final String filename, @NotNull final Document document) { final Element rootElement = document.getDocumentElement(); - parseBitmasks(getChild(rootElement, XML_ELEMENT_BITMASKS), errorViewCollector); - parseLists(getChild(rootElement, XML_ELEMENT_LISTS), errorViewCollector); - final IgnorelistsDefinition ignorelistsDefinition = parseIgnoreLists(getChild(rootElement, XML_ELEMENT_IGNORELISTS), errorViewCollector); - parseDefaultType(getChild(rootElement, XML_ELEMENT_DEFAULT_TYPE), errorViewCollector, ignorelistsDefinition); + parseBitmasks(XmlUtils.getChild(rootElement, XML_ELEMENT_BITMASKS), errorViewCollector); + parseLists(XmlUtils.getChild(rootElement, XML_ELEMENT_LISTS), errorViewCollector); + final IgnorelistsDefinition ignorelistsDefinition = parseIgnoreLists(XmlUtils.getChild(rootElement, XML_ELEMENT_IGNORELISTS), errorViewCollector); + parseDefaultType(XmlUtils.getChild(rootElement, XML_ELEMENT_DEFAULT_TYPE), errorViewCollector, ignorelistsDefinition); final Iterator<Element> typeElements = new NodeListIterator<Element>(rootElement, XML_ELEMENT_TYPE); while (typeElements.hasNext()) { @@ -309,22 +310,6 @@ } /** - * Returns a child {@link Element} of a parent element. The child element - * must exist. - * @param parentElement the parent element - * @param childName the name of the child element - * @return the child element - */ - @NotNull - private static Element getChild(@NotNull final Element parentElement, @NotNull final String childName) { - final Element element = NodeListIterator.getFirstChild(parentElement, childName); - if (element == null) { - throw new IllegalArgumentException("child element '" + childName + "' does not exist"); - } - return element; - } - - /** * Parses the {@link #XML_ELEMENT_BITMASKS} section of a types.xml file. * @param bitmasksElement the element to parse * @param errorViewCollector the error view collector for reporting errors Added: trunk/utils/src/app/net/sf/gridarta/utils/XmlUtils.java =================================================================== --- trunk/utils/src/app/net/sf/gridarta/utils/XmlUtils.java (rev 0) +++ trunk/utils/src/app/net/sf/gridarta/utils/XmlUtils.java 2013-05-28 17:56:59 UTC (rev 9229) @@ -0,0 +1,54 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2011 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.utils; + +import net.sf.japi.xml.NodeListIterator; +import org.jetbrains.annotations.NotNull; +import org.w3c.dom.Element; + +/** + * XML related utility functions. + * @author Andreas Kirschbaum + */ +public class XmlUtils { + + /** + * Private constructor to prevent instantiation. + */ + private XmlUtils() { + } + + /** + * Returns a child {@link Element} of a parent element. The child element + * must exist. + * @param parentElement the parent element + * @param childName the name of the child element + * @return the child element + */ + @NotNull + public static Element getChild(@NotNull final Element parentElement, @NotNull final String childName) { + final Element element = NodeListIterator.getFirstChild(parentElement, childName); + if (element == null) { + throw new IllegalArgumentException("child element '" + childName + "' does not exist"); + } + return element; + } + +} Property changes on: trunk/utils/src/app/net/sf/gridarta/utils/XmlUtils.java ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +LF \ No newline at end of property Modified: trunk/utils/utils.iml =================================================================== --- trunk/utils/utils.iml 2013-05-25 17:23:39 UTC (rev 9228) +++ trunk/utils/utils.iml 2013-05-28 17:56:59 UTC (rev 9229) @@ -10,6 +10,7 @@ <orderEntry type="library" name="annotations" level="project" /> <orderEntry type="library" name="japi-lib-swing-action" level="project" /> <orderEntry type="library" name="japi-lib-util" level="project" /> + <orderEntry type="library" name="japi-lib-xml" level="project" /> <orderEntry type="library" name="junit" level="project" /> <orderEntry type="library" name="log4j" level="project" /> </component> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-05-25 17:23:43
|
Revision: 9228 http://sourceforge.net/p/gridarta/code/9228 Author: akirschbaum Date: 2013-05-25 17:23:39 +0000 (Sat, 25 May 2013) Log Message: ----------- Remove ArchetypeAttribute.getCapitalizedSectionName(). Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttribute.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeSection.java Modified: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttribute.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttribute.java 2013-05-25 16:27:38 UTC (rev 9227) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttribute.java 2013-05-25 17:23:39 UTC (rev 9228) @@ -121,18 +121,6 @@ } /** - * Returns the capitalized section name. - * @return the capitalized section name - */ - public String getCapitalizedSectionName() { - if (sectionName.length() <= 1) { - return sectionName; - } - - return sectionName.substring(0, 1).toUpperCase() + sectionName.substring(1); - } - - /** * Returns the archetype attribute name. * @return the archetype attribute name */ Modified: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeSection.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeSection.java 2013-05-25 16:27:38 UTC (rev 9227) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeSection.java 2013-05-25 17:23:39 UTC (rev 9228) @@ -91,7 +91,12 @@ public String getSectionName(final int sectionId) { for (final ArchetypeAttribute archetypeAttribute : archetypeAttributes) { if (archetypeAttribute.getSectionId() == sectionId) { - return archetypeAttribute.getCapitalizedSectionName(); + final String sectionName = archetypeAttribute.getSectionName(); + if (sectionName.length() <= 1) { + return sectionName; + } + + return sectionName.substring(0, 1).toUpperCase() + sectionName.substring(1); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-05-25 16:27:45
|
Revision: 9227 http://sourceforge.net/p/gridarta/code/9227 Author: akirschbaum Date: 2013-05-25 16:27:38 +0000 (Sat, 25 May 2013) Log Message: ----------- Rename ArchetypeAttributes to ArchetypeAttributeSection. 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/test/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetTest.java trunk/model/src/test/net/sf/gridarta/model/archetypetype/ArchetypeTypeTest.java Added Paths: ----------- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeSection.java Removed Paths: ------------- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributes.java Copied: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeSection.java (from rev 9225, trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributes.java) =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeSection.java (rev 0) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeSection.java 2013-05-25 16:27:38 UTC (rev 9227) @@ -0,0 +1,116 @@ +/* + * 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.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import org.jetbrains.annotations.NotNull; + +/** + * A set of {@link ArchetypeAttribute ArchetypeAttributes}. + * @author Andreas Kirschbaum + */ +public class ArchetypeAttributeSection implements Iterable<ArchetypeAttribute> { + + /** + * The {@link ArchetypeAttribute ArchetypeAttributes}. + */ + @NotNull + private final List<ArchetypeAttribute> archetypeAttributes = new ArrayList<ArchetypeAttribute>(); + + /** + * Adds an {@link ArchetypeAttribute}. + * @param archetypeAttribute the archetype attribute + */ + public void add(@NotNull final ArchetypeAttribute archetypeAttribute) { + archetypeAttributes.add(archetypeAttribute); + } + + /** + * Adds all {@link ArchetypeAttribute ArchetypeAttributes} of another + * archetype attributes to this archetype attributes. + * @param archetypeAttributeSection the other archetype attributes + */ + public void addAll(@NotNull final ArchetypeAttributeSection archetypeAttributeSection) { + this.archetypeAttributes.addAll(archetypeAttributeSection.archetypeAttributes); + } + + /** + * {@inheritDoc} + */ + @Override + public Iterator<ArchetypeAttribute> iterator() { + return Collections.unmodifiableList(archetypeAttributes).iterator(); + } + + /** + * Returns whether no {@link ArchetypeAttribute ArchetypeAttributes} exist. + * @return whether no archetype attributes exist + */ + public boolean isEmpty() { + return archetypeAttributes.isEmpty(); + } + + /** + * Updates the section names of all archetype attributes. + * @param sectionNames the section names to use + */ + public void setSectionNames(@NotNull final SectionNames sectionNames) { + for (final ArchetypeAttribute archetypeAttribute : archetypeAttributes) { + final String sectionName = archetypeAttribute.getSectionName(); + final int sectionId = sectionNames.defineSectionName(sectionName); + archetypeAttribute.setSectionId(sectionId); + } + } + + /** + * Looks up the section name from the ID. + * @param sectionId the ID of the section + * @return the name of that section + */ + @NotNull + public String getSectionName(final int sectionId) { + for (final ArchetypeAttribute archetypeAttribute : archetypeAttributes) { + if (archetypeAttribute.getSectionId() == sectionId) { + return archetypeAttribute.getCapitalizedSectionName(); + } + } + + return "???"; + } + + /** + * Returns whether an attribute key is defined. + * @param key the attribute key + * @return whether the attribute key is defined + */ + public boolean hasAttributeKey(@NotNull final Comparable<String> key) { + for (final ArchetypeAttribute attr : archetypeAttributes) { + if (attr.getArchetypeAttributeName().equals(key)) { + return true; + } + } + + return false; + } + +} Property changes on: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeSection.java ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +LF \ No newline at end of property Deleted: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributes.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributes.java 2013-05-25 14:21:46 UTC (rev 9226) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributes.java 2013-05-25 16:27:38 UTC (rev 9227) @@ -1,116 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package net.sf.gridarta.model.archetypetype; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; -import org.jetbrains.annotations.NotNull; - -/** - * A set of {@link ArchetypeAttribute ArchetypeAttributes}. - * @author Andreas Kirschbaum - */ -public class ArchetypeAttributes implements Iterable<ArchetypeAttribute> { - - /** - * The {@link ArchetypeAttribute ArchetypeAttributes}. - */ - @NotNull - private final List<ArchetypeAttribute> archetypeAttributes = new ArrayList<ArchetypeAttribute>(); - - /** - * Adds an {@link ArchetypeAttribute}. - * @param archetypeAttribute the archetype attribute - */ - public void add(@NotNull final ArchetypeAttribute archetypeAttribute) { - archetypeAttributes.add(archetypeAttribute); - } - - /** - * Adds all {@link ArchetypeAttribute ArchetypeAttributes} of another - * archetype attributes to this archetype attributes. - * @param archetypeAttributes the other archetype attributes - */ - public void addAll(@NotNull final ArchetypeAttributes archetypeAttributes) { - this.archetypeAttributes.addAll(archetypeAttributes.archetypeAttributes); - } - - /** - * {@inheritDoc} - */ - @Override - public Iterator<ArchetypeAttribute> iterator() { - return Collections.unmodifiableList(archetypeAttributes).iterator(); - } - - /** - * Returns whether no {@link ArchetypeAttribute ArchetypeAttributes} exist. - * @return whether no archetype attributes exist - */ - public boolean isEmpty() { - return archetypeAttributes.isEmpty(); - } - - /** - * Updates the section names of all archetype attributes. - * @param sectionNames the section names to use - */ - public void setSectionNames(@NotNull final SectionNames sectionNames) { - for (final ArchetypeAttribute archetypeAttribute : archetypeAttributes) { - final String sectionName = archetypeAttribute.getSectionName(); - final int sectionId = sectionNames.defineSectionName(sectionName); - archetypeAttribute.setSectionId(sectionId); - } - } - - /** - * Looks up the section name from the ID. - * @param sectionId the ID of the section - * @return the name of that section - */ - @NotNull - public String getSectionName(final int sectionId) { - for (final ArchetypeAttribute archetypeAttribute : archetypeAttributes) { - if (archetypeAttribute.getSectionId() == sectionId) { - return archetypeAttribute.getCapitalizedSectionName(); - } - } - - return "???"; - } - - /** - * Returns whether an attribute key is defined. - * @param key the attribute key - * @return whether the attribute key is defined - */ - public boolean hasAttributeKey(@NotNull final Comparable<String> key) { - for (final ArchetypeAttribute attr : archetypeAttributes) { - if (attr.getArchetypeAttributeName().equals(key)) { - return true; - } - } - - return false; - } - -} Modified: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeType.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeType.java 2013-05-25 14:21:46 UTC (rev 9226) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeType.java 2013-05-25 16:27:38 UTC (rev 9227) @@ -92,7 +92,7 @@ * The list of {@link ArchetypeAttribute ArchetypeAttributes}. */ @NotNull - private final ArchetypeAttributes archetypeAttributes; + private final ArchetypeAttributeSection archetypeAttributeSection; /** * The list of additional attributes that an object must have in order to be @@ -114,10 +114,10 @@ * @param description the description * @param use the usage notes * @param sectionNum the number of attribute sections - * @param archetypeAttributes the list of archetype attributes + * @param archetypeAttributeSection the list of archetype attributes * @param typeAttributes the list of additional attributes */ - public ArchetypeType(@NotNull final String typeName, final int typeNo, @NotNull final String display, final boolean map, @Nullable final int[] inv, final boolean allowsAllInv, @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, final boolean map, @Nullable final int[] inv, final boolean allowsAllInv, @Nullable final String description, @Nullable final String use, final int sectionNum, @NotNull final ArchetypeAttributeSection archetypeAttributeSection, @NotNull final ArchetypeAttributesDefinition typeAttributes) { this.typeName = typeName; this.typeNo = typeNo; this.display = display; @@ -127,7 +127,7 @@ this.description = description; this.use = use; this.sectionNum = sectionNum; - this.archetypeAttributes = archetypeAttributes; + this.archetypeAttributeSection = archetypeAttributeSection; this.typeAttributes = typeAttributes; } @@ -137,7 +137,7 @@ @NotNull @Override public Iterator<ArchetypeAttribute> iterator() { - return archetypeAttributes.iterator(); + return archetypeAttributeSection.iterator(); } /** @@ -146,7 +146,7 @@ * @return whether at least one archetype attribute exists */ public boolean hasAttribute() { - return !archetypeAttributes.isEmpty(); + return !archetypeAttributeSection.isEmpty(); } /** @@ -249,7 +249,7 @@ */ @NotNull public String getSectionName(final int sectionId) { - return archetypeAttributes.getSectionName(sectionId); + return archetypeAttributeSection.getSectionName(sectionId); } /** @@ -258,7 +258,7 @@ * @return whether the attribute key is defined */ public boolean hasAttributeKey(@NotNull final Comparable<String> key) { - return archetypeAttributes.hasAttributeKey(key); + return archetypeAttributeSection.hasAttributeKey(key); } /** @@ -287,7 +287,7 @@ sb.append('\n'); } sb.append(":\n"); - for (final ArchetypeAttribute archetypeAttribute : archetypeAttributes) { + for (final ArchetypeAttribute archetypeAttribute : archetypeAttributeSection) { sb.append(archetypeAttribute); sb.append('\n'); } Modified: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeParser.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeParser.java 2013-05-25 14:21:46 UTC (rev 9226) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeParser.java 2013-05-25 16:27:38 UTC (rev 9227) @@ -172,56 +172,56 @@ } } - final ArchetypeAttributes attributes = new ArchetypeAttributes(); + final ArchetypeAttributeSection attributeSection = new ArchetypeAttributeSection(); final SectionNames sectionNames = new SectionNames(); - addAttributeList(typeElement, attributes, errorViewCollector, typeName, typeNo == -1 ? SectionNames.GENERAL_SECTION : SectionNames.SPECIAL_SECTION, sectionNames, archetypeTypeSet); + addAttributeList(typeElement, attributeSection, errorViewCollector, typeName, typeNo == -1 ? SectionNames.GENERAL_SECTION : SectionNames.SPECIAL_SECTION, sectionNames, archetypeTypeSet); if (archetypeType != null) { final Collection<String> autoIgnoreTable = new HashSet<String>(); - for (final ArchetypeAttribute attribute : attributes) { + for (final ArchetypeAttribute attribute : attributeSection) { autoIgnoreTable.add(attribute.getArchetypeAttributeName()); } if (archetypeType.hasAttribute()) { for (final String importType : importTypes) { - addImportList(importType, attributes, errorViewCollector, typeName, archetypeTypeSet, autoIgnoreTable); + addImportList(importType, attributeSection, errorViewCollector, typeName, archetypeTypeSet, autoIgnoreTable); } } - addDefaultList(archetypeType, attributes, autoIgnoreTable, ignoreTable); + addDefaultList(archetypeType, attributeSection, autoIgnoreTable, ignoreTable); } - attributes.setSectionNames(sectionNames); + attributeSection.setSectionNames(sectionNames); - return new ArchetypeType(typeName, typeNo, display, map, inv, allowsAllInv, parseDescription(typeElement), parseUse(typeElement), sectionNames.getSectionNames(), attributes, typeAttributes); + return new ArchetypeType(typeName, typeNo, display, map, inv, allowsAllInv, parseDescription(typeElement), parseUse(typeElement), sectionNames.getSectionNames(), attributeSection, typeAttributes); } /** * Adds all attributes of am {@link ArchetypeType} to an {@link - * ArchetypeAttributes} that are not ignored. + * ArchetypeAttributeSection} that are not ignored. * @param archetypeType the archetype type - * @param attributes the archetype attributes to add to + * @param attributeSection the archetype attributes to add to * @param autoIgnoreTable the attributes to ignore * @param ignoreTable the attributes to ignore */ - private static void addDefaultList(@NotNull final Iterable<ArchetypeAttribute> archetypeType, @NotNull final ArchetypeAttributes attributes, @NotNull final Collection<String> autoIgnoreTable, @NotNull final Collection<String> ignoreTable) { + private static void addDefaultList(@NotNull final Iterable<ArchetypeAttribute> archetypeType, @NotNull final ArchetypeAttributeSection attributeSection, @NotNull final Collection<String> autoIgnoreTable, @NotNull final Collection<String> ignoreTable) { for (final ArchetypeAttribute archetypeAttribute : archetypeType) { // add all attributes from the default_type which are not in the ignoreTable if (!ignoreTable.contains(archetypeAttribute.getArchetypeAttributeName()) && !autoIgnoreTable.contains(archetypeAttribute.getArchetypeAttributeName())) { - attributes.add(archetypeAttribute.clone()); + attributeSection.add(archetypeAttribute.clone()); } } } /** - * Adds all imported attributes to an {@link ArchetypeAttributes}. + * Adds all imported attributes to an {@link ArchetypeAttributeSection}. * @param importName the name of the import list to import - * @param attributes the archetype attributes to add to + * @param attributeSection the archetype attributes to add to * @param errorViewCollector the error view collector for reporting errors * @param typeName the type name for error messages * @param archetypeTypeSet the archetype type set * @param autoIgnoreTable the attributes to ignore; imported attributes are * added */ - private static void addImportList(@NotNull final String importName, @NotNull final ArchetypeAttributes attributes, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final String typeName, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final Collection<String> autoIgnoreTable) { + private static void addImportList(@NotNull final String importName, @NotNull final ArchetypeAttributeSection attributeSection, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final String typeName, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final Collection<String> autoIgnoreTable) { final Iterable<ArchetypeAttribute> importType = archetypeTypeSet.getArchetypeType(importName); if (importType == null) { errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, typeName + ": import type \"" + importName + "\" not found!"); @@ -238,7 +238,7 @@ continue; } - attributes.add(archetypeAttribute.clone()); + attributeSection.add(archetypeAttribute.clone()); autoIgnoreTable.add(attributeName); } } @@ -515,7 +515,7 @@ * #XML_ELEMENT_SECTION} children of a "type" or "default_type" element and * adds all found attributes to an {@link ArchetypeAttribute}. * @param typeElement the type element to parse - * @param attributes the archetype attributes to add to + * @param attributeSection the archetype attributes to add to * @param errorViewCollector the error view collector for reporting errors * @param typeName the type name of the element being parsed * @param defaultSectionName the name of the section to add attributes in @@ -523,14 +523,14 @@ * @param sectionNames the defined section names * @param archetypeTypeSet archetype type list */ - private void addAttributeList(@NotNull final Element typeElement, @NotNull final ArchetypeAttributes attributes, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final String typeName, @NotNull final String defaultSectionName, @NotNull final SectionNames sectionNames, @NotNull final ArchetypeTypeSet archetypeTypeSet) { + private void addAttributeList(@NotNull final Element typeElement, @NotNull final ArchetypeAttributeSection attributeSection, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final String typeName, @NotNull final String defaultSectionName, @NotNull final SectionNames sectionNames, @NotNull final ArchetypeTypeSet archetypeTypeSet) { final Iterator<Element> childIterator = new NodeListIterator<Element>(typeElement, Node.ELEMENT_NODE); while (childIterator.hasNext()) { final Element childElement = childIterator.next(); final String childName = childElement.getNodeName(); if (childName.equals(XML_ELEMENT_ATTRIBUTE)) { - parseAttribute(childElement, errorViewCollector, typeName, sectionNames, defaultSectionName, archetypeTypeSet, attributes); + parseAttribute(childElement, errorViewCollector, typeName, sectionNames, defaultSectionName, archetypeTypeSet, attributeSection); } else if (childName.equals(XML_ELEMENT_SECTION) && childElement.hasChildNodes()) { final Attr nameAttribute = childElement.getAttributeNode(XML_SECTION_NAME); if (nameAttribute == null) { @@ -548,7 +548,7 @@ final Iterator<Element> attributeIterator = new NodeListIterator<Element>(childElement, XML_ELEMENT_ATTRIBUTE); while (attributeIterator.hasNext()) { - parseAttribute(attributeIterator.next(), errorViewCollector, typeName, sectionNames, sectionName, archetypeTypeSet, attributes); + parseAttribute(attributeIterator.next(), errorViewCollector, typeName, sectionNames, sectionName, archetypeTypeSet, attributeSection); } } } @@ -563,16 +563,16 @@ * @param sectionName the section name or <code>null</code> for top-level * attributes * @param archetypeTypeSet archetype type list - * @param attributes the attribute will be added to this + * @param attributeSection the attribute will be added to this */ - private void parseAttribute(@NotNull final Element attributeElement, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final String typeName, @NotNull final SectionNames sectionNames, @NotNull final String sectionName, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final ArchetypeAttributes attributes) { + private void parseAttribute(@NotNull final Element attributeElement, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final String typeName, @NotNull final SectionNames sectionNames, @NotNull final String sectionName, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final ArchetypeAttributeSection attributeSection) { final ArchetypeAttribute archetypeAttribute = parseAttribute(attributeElement, errorViewCollector, typeName, sectionName, archetypeTypeSet); if (archetypeAttribute == null) { return; } sectionNames.defineSectionName(archetypeAttribute.getSectionName()); - attributes.add(archetypeAttribute); + attributeSection.add(archetypeAttribute); } /** Modified: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java 2013-05-25 14:21:46 UTC (rev 9226) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java 2013-05-25 16:27:38 UTC (rev 9227) @@ -42,7 +42,7 @@ * matching any defined type. */ @NotNull - private ArchetypeType fallbackArchetypeType = new ArchetypeType("", 0, "", true, null, false, null, null, 2, new ArchetypeAttributes(), new ArchetypeAttributesDefinition()); + private ArchetypeType fallbackArchetypeType = new ArchetypeType("", 0, "", true, null, false, null, null, 2, new ArchetypeAttributeSection(), new ArchetypeAttributesDefinition()); /** * Lists with all defined {@link ArchetypeType ArchetypeTypes}. The ordering Modified: trunk/model/src/test/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetTest.java 2013-05-25 14:21:46 UTC (rev 9226) +++ trunk/model/src/test/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetTest.java 2013-05-25 16:27:38 UTC (rev 9227) @@ -36,7 +36,7 @@ @Test(expected = UnsupportedOperationException.class) public void testIteratorReadOnly() { final ArchetypeTypeSet archetypeTypeSet = new ArchetypeTypeSet(); - archetypeTypeSet.addArchetypeType(new ArchetypeType("name", 0, "", false, null, false, null, null, 0, new ArchetypeAttributes(), new ArchetypeAttributesDefinition())); + archetypeTypeSet.addArchetypeType(new ArchetypeType("name", 0, "", false, null, false, null, null, 0, new ArchetypeAttributeSection(), new ArchetypeAttributesDefinition())); final Iterator<ArchetypeType> iterator = archetypeTypeSet.iterator(); Assert.assertTrue(iterator.hasNext()); iterator.next(); Modified: trunk/model/src/test/net/sf/gridarta/model/archetypetype/ArchetypeTypeTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/archetypetype/ArchetypeTypeTest.java 2013-05-25 14:21:46 UTC (rev 9226) +++ trunk/model/src/test/net/sf/gridarta/model/archetypetype/ArchetypeTypeTest.java 2013-05-25 16:27:38 UTC (rev 9227) @@ -48,11 +48,11 @@ final FaceObjects faceObjects = new TestFaceObjects(); final FaceObjectProviders faceObjectProviders = new FaceObjectProviders(0, faceObjects, systemIcons); final AnimationObjects animationObjects = new TestAnimationObjects(); - final ArchetypeAttributes archetypeAttributes = new ArchetypeAttributes(); + final ArchetypeAttributeSection archetypeAttributeSection = new ArchetypeAttributeSection(); final ArchetypeAttributesDefinition typeAttributes = new ArchetypeAttributesDefinition(); final BaseObject<?, ?, ?, ?> archetype = new TestDefaultArchetype("base", faceObjectProviders, animationObjects); - final ArchetypeType archetypeType1 = new ArchetypeType("name1", 1, "", true, null, false, "description", "use", 1, archetypeAttributes, typeAttributes); + final ArchetypeType archetypeType1 = new ArchetypeType("name1", 1, "", true, null, false, "description", "use", 1, archetypeAttributeSection, typeAttributes); Assert.assertEquals("name1 (1)", archetypeType1.getDisplayName(archetype)); } @@ -66,11 +66,11 @@ final FaceObjects faceObjects = new TestFaceObjects(); final FaceObjectProviders faceObjectProviders = new FaceObjectProviders(0, faceObjects, systemIcons); final AnimationObjects animationObjects = new TestAnimationObjects(); - final ArchetypeAttributes archetypeAttributes = new ArchetypeAttributes(); + final ArchetypeAttributeSection archetypeAttributeSection = new ArchetypeAttributeSection(); final ArchetypeAttributesDefinition typeAttributes = new ArchetypeAttributesDefinition(); final BaseObject<?, ?, ?, ?> archetype = new TestDefaultArchetype("base", faceObjectProviders, animationObjects); - final ArchetypeType archetypeType2 = new ArchetypeType("name2", 1, "a=${a}${a}", true, null, false, "description", "use", 1, archetypeAttributes, typeAttributes); + final ArchetypeType archetypeType2 = new ArchetypeType("name2", 1, "a=${a}${a}", true, null, false, "description", "use", 1, archetypeAttributeSection, typeAttributes); Assert.assertEquals("name2 (1) [a=]", archetypeType2.getDisplayName(archetype)); archetype.setObjectText("a xyz\n"); @@ -80,10 +80,10 @@ Assert.assertEquals("name2 (1) [a=${a}${a}]", archetypeType2.getDisplayName(archetype)); // syntax errors are not fatal - final ArchetypeType archetypeType3 = new ArchetypeType("name", 1, "${}", true, null, false, "description", "use", 1, archetypeAttributes, typeAttributes); + final ArchetypeType archetypeType3 = new ArchetypeType("name", 1, "${}", true, null, false, "description", "use", 1, archetypeAttributeSection, typeAttributes); Assert.assertEquals("name (1) []", archetypeType3.getDisplayName(archetype)); - final ArchetypeType archetypeType4 = new ArchetypeType("name", 1, "${a", true, null, false, "description", "use", 1, archetypeAttributes, typeAttributes); + final ArchetypeType archetypeType4 = new ArchetypeType("name", 1, "${a", true, null, false, "description", "use", 1, archetypeAttributeSection, typeAttributes); Assert.assertEquals("name (1) [${a]", archetypeType4.getDisplayName(archetype)); } @@ -97,11 +97,11 @@ final FaceObjects faceObjects = new TestFaceObjects(); final FaceObjectProviders faceObjectProviders = new FaceObjectProviders(0, faceObjects, systemIcons); final AnimationObjects animationObjects = new TestAnimationObjects(); - final ArchetypeAttributes archetypeAttributes = new ArchetypeAttributes(); + final ArchetypeAttributeSection archetypeAttributeSection = new ArchetypeAttributeSection(); final ArchetypeAttributesDefinition typeAttributes = new ArchetypeAttributesDefinition(); final BaseObject<?, ?, ?, ?> archetype = new TestDefaultArchetype("base", faceObjectProviders, animationObjects); - final ArchetypeType archetypeType2 = new ArchetypeType("name2", 1, "a=${a?True:False}", true, null, false, "description", "use", 1, archetypeAttributes, typeAttributes); + final ArchetypeType archetypeType2 = new ArchetypeType("name2", 1, "a=${a?True:False}", true, null, false, "description", "use", 1, archetypeAttributeSection, typeAttributes); Assert.assertEquals("name2 (1) [a=False]", archetypeType2.getDisplayName(archetype)); archetype.setObjectText("a xyz\n"); @@ -111,33 +111,33 @@ Assert.assertEquals("name2 (1) [a=False]", archetypeType2.getDisplayName(archetype)); // empty replacements are allowed - final ArchetypeType archetypeType3 = new ArchetypeType("name", 1, "${a?:}", true, null, false, "description", "use", 1, archetypeAttributes, typeAttributes); + final ArchetypeType archetypeType3 = new ArchetypeType("name", 1, "${a?:}", true, null, false, "description", "use", 1, archetypeAttributeSection, 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}", true, null, false, "description", "use", 1, archetypeAttributes, typeAttributes); + final ArchetypeType archetypeType4 = new ArchetypeType("name", 1, "${a?b:c:d}", true, null, false, "description", "use", 1, archetypeAttributeSection, 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, "${?", true, null, false, "description", "use", 1, archetypeAttributes, typeAttributes); + final ArchetypeType archetypeType5 = new ArchetypeType("name", 1, "${?", true, null, false, "description", "use", 1, archetypeAttributeSection, 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?", true, null, false, "description", "use", 1, archetypeAttributes, typeAttributes); + final ArchetypeType archetypeType6 = new ArchetypeType("name", 1, "${a?", true, null, false, "description", "use", 1, archetypeAttributeSection, 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?:", true, null, false, "description", "use", 1, archetypeAttributes, typeAttributes); + final ArchetypeType archetypeType7 = new ArchetypeType("name", 1, "${a?:", true, null, false, "description", "use", 1, archetypeAttributeSection, typeAttributes); archetype.setObjectText("a 0\n"); Assert.assertEquals("name (1) [${a?:]", archetypeType7.getDisplayName(archetype)); archetype.setObjectText("a 1\n"); @@ -150,9 +150,9 @@ */ @Test(expected = UnsupportedOperationException.class) public void testIteratorReadOnly() { - final ArchetypeAttributes archetypeAttributes = new ArchetypeAttributes(); - archetypeAttributes.add(new ArchetypeAttributeInt("name", "name", "", 1, "section", 0, 0, 0, 0)); - final ArchetypeType archetypeType = new ArchetypeType("name", 0, "", false, null, false, null, null, 0, archetypeAttributes, new ArchetypeAttributesDefinition()); + final ArchetypeAttributeSection archetypeAttributeSection = new ArchetypeAttributeSection(); + archetypeAttributeSection.add(new ArchetypeAttributeInt("name", "name", "", 1, "section", 0, 0, 0, 0)); + final ArchetypeType archetypeType = new ArchetypeType("name", 0, "", false, null, false, null, null, 0, archetypeAttributeSection, new ArchetypeAttributesDefinition()); final Iterator<ArchetypeAttribute> iterator = archetypeType.iterator(); Assert.assertTrue(iterator.hasNext()); iterator.next(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-05-25 14:21:51
|
Revision: 9226 http://sourceforge.net/p/gridarta/code/9226 Author: akirschbaum Date: 2013-05-25 14:21:46 +0000 (Sat, 25 May 2013) Log Message: ----------- Simplify code. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeParser.java Modified: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeParser.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeParser.java 2013-05-24 20:46:55 UTC (rev 9225) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeParser.java 2013-05-25 14:21:46 UTC (rev 9226) @@ -174,7 +174,7 @@ final ArchetypeAttributes attributes = new ArchetypeAttributes(); final SectionNames sectionNames = new SectionNames(); - addAttributeList(typeElement, attributes, errorViewCollector, typeName, typeNo, sectionNames, archetypeTypeSet); + addAttributeList(typeElement, attributes, errorViewCollector, typeName, typeNo == -1 ? SectionNames.GENERAL_SECTION : SectionNames.SPECIAL_SECTION, sectionNames, archetypeTypeSet); if (archetypeType != null) { final Collection<String> autoIgnoreTable = new HashSet<String>(); for (final ArchetypeAttribute attribute : attributes) { @@ -518,18 +518,19 @@ * @param attributes the archetype attributes to add to * @param errorViewCollector the error view collector for reporting errors * @param typeName the type name of the element being parsed - * @param typeNo the type number of the element being parsed + * @param defaultSectionName the name of the section to add attributes in + * the default section * @param sectionNames the defined section names * @param archetypeTypeSet archetype type list */ - private void addAttributeList(@NotNull final Element typeElement, @NotNull final ArchetypeAttributes attributes, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final String typeName, final int typeNo, @NotNull final SectionNames sectionNames, @NotNull final ArchetypeTypeSet archetypeTypeSet) { + private void addAttributeList(@NotNull final Element typeElement, @NotNull final ArchetypeAttributes attributes, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final String typeName, @NotNull final String defaultSectionName, @NotNull final SectionNames sectionNames, @NotNull final ArchetypeTypeSet archetypeTypeSet) { final Iterator<Element> childIterator = new NodeListIterator<Element>(typeElement, Node.ELEMENT_NODE); while (childIterator.hasNext()) { final Element childElement = childIterator.next(); final String childName = childElement.getNodeName(); if (childName.equals(XML_ELEMENT_ATTRIBUTE)) { - parseAttribute(childElement, errorViewCollector, typeName, typeNo, sectionNames, null, archetypeTypeSet, attributes); + parseAttribute(childElement, errorViewCollector, typeName, sectionNames, defaultSectionName, archetypeTypeSet, attributes); } else if (childName.equals(XML_ELEMENT_SECTION) && childElement.hasChildNodes()) { final Attr nameAttribute = childElement.getAttributeNode(XML_SECTION_NAME); if (nameAttribute == null) { @@ -547,7 +548,7 @@ final Iterator<Element> attributeIterator = new NodeListIterator<Element>(childElement, XML_ELEMENT_ATTRIBUTE); while (attributeIterator.hasNext()) { - parseAttribute(attributeIterator.next(), errorViewCollector, typeName, typeNo, sectionNames, sectionName, archetypeTypeSet, attributes); + parseAttribute(attributeIterator.next(), errorViewCollector, typeName, sectionNames, sectionName, archetypeTypeSet, attributes); } } } @@ -558,15 +559,14 @@ * @param attributeElement the attribute element to parse * @param errorViewCollector the error view collector for reporting errors * @param typeName the type name of the element being parsed - * @param typeNo the type number of the element being parsed * @param sectionNames the defined section names * @param sectionName the section name or <code>null</code> for top-level * attributes * @param archetypeTypeSet archetype type list * @param attributes the attribute will be added to this */ - private void parseAttribute(@NotNull final Element attributeElement, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final String typeName, final int typeNo, @NotNull final SectionNames sectionNames, @Nullable final String sectionName, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final ArchetypeAttributes attributes) { - final ArchetypeAttribute archetypeAttribute = parseAttribute(attributeElement, errorViewCollector, typeName, typeNo, sectionName, archetypeTypeSet); + private void parseAttribute(@NotNull final Element attributeElement, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final String typeName, @NotNull final SectionNames sectionNames, @NotNull final String sectionName, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final ArchetypeAttributes attributes) { + final ArchetypeAttribute archetypeAttribute = parseAttribute(attributeElement, errorViewCollector, typeName, sectionName, archetypeTypeSet); if (archetypeAttribute == null) { return; } @@ -583,25 +583,15 @@ * @param attributeElement the XML attribute element * @param errorViewCollector the error view collector for reporting errors * @param typeName the archetype type's name - * @param typeNo the archetype type's type number * @param sectionName name of the section or <code>null</code> for top-level * attribute definitions * @param archetypeTypeSet archetype type set * @return the parsed attribute or <code>null</code> if an error occurs */ @Nullable - private ArchetypeAttribute parseAttribute(@NotNull final Element attributeElement, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final String typeName, final int typeNo, @Nullable final String sectionName, @NotNull final ArchetypeTypeSet archetypeTypeSet) { - final String effectiveSectionName; - if (sectionName != null) { - effectiveSectionName = sectionName; - } else if (typeNo == -1) { - effectiveSectionName = SectionNames.GENERAL_SECTION; - } else { - effectiveSectionName = SectionNames.SPECIAL_SECTION; - } - + private ArchetypeAttribute parseAttribute(@NotNull final Element attributeElement, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final String typeName, @NotNull final String sectionName, @NotNull final ArchetypeTypeSet archetypeTypeSet) { try { - return archetypeAttributeParser.load(attributeElement, errorViewCollector, archetypeTypeSet, typeName, effectiveSectionName); + return archetypeAttributeParser.load(attributeElement, errorViewCollector, archetypeTypeSet, typeName, sectionName); } catch (final MissingAttributeException ex) { errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, "type " + typeName + ": " + ex.getMessage()); return null; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-05-24 20:46:58
|
Revision: 9225 http://sourceforge.net/p/gridarta/code/9225 Author: akirschbaum Date: 2013-05-24 20:46:55 +0000 (Fri, 24 May 2013) Log Message: ----------- Move code from ArchetypeType to ArchetypeAttributes. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributes.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeType.java Modified: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributes.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributes.java 2013-05-24 20:42:35 UTC (rev 9224) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributes.java 2013-05-24 20:46:55 UTC (rev 9225) @@ -82,4 +82,35 @@ } } + /** + * Looks up the section name from the ID. + * @param sectionId the ID of the section + * @return the name of that section + */ + @NotNull + public String getSectionName(final int sectionId) { + for (final ArchetypeAttribute archetypeAttribute : archetypeAttributes) { + if (archetypeAttribute.getSectionId() == sectionId) { + return archetypeAttribute.getCapitalizedSectionName(); + } + } + + return "???"; + } + + /** + * Returns whether an attribute key is defined. + * @param key the attribute key + * @return whether the attribute key is defined + */ + public boolean hasAttributeKey(@NotNull final Comparable<String> key) { + for (final ArchetypeAttribute attr : archetypeAttributes) { + if (attr.getArchetypeAttributeName().equals(key)) { + return true; + } + } + + return false; + } + } Modified: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeType.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeType.java 2013-05-24 20:42:35 UTC (rev 9224) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeType.java 2013-05-24 20:46:55 UTC (rev 9225) @@ -249,13 +249,7 @@ */ @NotNull public String getSectionName(final int sectionId) { - for (final ArchetypeAttribute archetypeAttribute : archetypeAttributes) { - if (archetypeAttribute.getSectionId() == sectionId) { - return archetypeAttribute.getCapitalizedSectionName(); - } - } - - return "???"; + return archetypeAttributes.getSectionName(sectionId); } /** @@ -264,13 +258,7 @@ * @return whether the attribute key is defined */ public boolean hasAttributeKey(@NotNull final Comparable<String> key) { - for (final ArchetypeAttribute attr : archetypeAttributes) { - if (attr.getArchetypeAttributeName().equals(key)) { - return true; - } - } - - return false; + return archetypeAttributes.hasAttributeKey(key); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-05-24 20:42:38
|
Revision: 9224 http://sourceforge.net/p/gridarta/code/9224 Author: akirschbaum Date: 2013-05-24 20:42:35 +0000 (Fri, 24 May 2013) Log Message: ----------- Suppress compiler warning. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java Modified: trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2013-05-24 20:39:59 UTC (rev 9223) +++ trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2013-05-24 20:42:35 UTC (rev 9224) @@ -847,7 +847,7 @@ if (faceName != null && !faceName.equals(archetype.getFaceName())) { return false; } - //noinspection ConstantConditions + //noinspection ConstantConditions,SimplifiableIfStatement if (animName != null && !animName.equals(archetype.getAnimName())) { return false; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-05-24 20:40:02
|
Revision: 9223 http://sourceforge.net/p/gridarta/code/9223 Author: akirschbaum Date: 2013-05-24 20:39:59 +0000 (Fri, 24 May 2013) Log Message: ----------- Simplify code. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeType.java Modified: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeType.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeType.java 2013-05-24 20:38:21 UTC (rev 9222) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeType.java 2013-05-24 20:39:59 UTC (rev 9223) @@ -231,11 +231,7 @@ * @return whether the base object matches */ public boolean matches(@NotNull final BaseObject<?, ?, ?, ?> baseObject) { - if (typeNo != baseObject.getTypeNo()) { - return false; - } - - return typeAttributes.matches(baseObject); + return typeNo == baseObject.getTypeNo() && typeAttributes.matches(baseObject); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-05-24 20:38:24
|
Revision: 9222 http://sourceforge.net/p/gridarta/code/9222 Author: akirschbaum Date: 2013-05-24 20:38:21 +0000 (Fri, 24 May 2013) Log Message: ----------- Rename function names. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/GameObject.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java trunk/model/src/test/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetTest.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/GameObjectAttributesDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/TypesBoxItemListener.java trunk/src/app/net/sf/gridarta/gui/panel/gameobjecttexteditor/GameObjectTextEditor.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java 2013-05-24 20:33:54 UTC (rev 9221) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java 2013-05-24 20:38:21 UTC (rev 9222) @@ -74,7 +74,7 @@ @Override public void addLast(@NotNull final GameObject gameObject) { // force type change when a MONSTER is put in a spawn point - if (archetypeTypeSet.getArchetypeType(this).getTypeNo() == Archetype.TYPE_SPAWN_POINT && archetypeTypeSet.getArchetypeType(gameObject).getTypeNo() == Archetype.TYPE_MOB) { + if (archetypeTypeSet.getArchetypeTypeByBaseObject(this).getTypeNo() == Archetype.TYPE_SPAWN_POINT && archetypeTypeSet.getArchetypeTypeByBaseObject(gameObject).getTypeNo() == Archetype.TYPE_MOB) { gameObject.setAttributeInt(TYPE, Archetype.TYPE_SPAWN_POINT_MOB); // change to SPAWN_POINT_MOB } super.addLast(gameObject); @@ -86,7 +86,7 @@ @Override public void addFirst(@NotNull final GameObject gameObject) { // force type change when a MONSTER is put in a spawn point - if (archetypeTypeSet.getArchetypeType(this).getTypeNo() == Archetype.TYPE_SPAWN_POINT && archetypeTypeSet.getArchetypeType(gameObject).getTypeNo() == Archetype.TYPE_MOB) { + if (archetypeTypeSet.getArchetypeTypeByBaseObject(this).getTypeNo() == Archetype.TYPE_SPAWN_POINT && archetypeTypeSet.getArchetypeTypeByBaseObject(gameObject).getTypeNo() == Archetype.TYPE_MOB) { gameObject.setAttributeInt(TYPE, Archetype.TYPE_SPAWN_POINT_MOB); // change to SPAWN_POINT_MOB } super.addFirst(gameObject); Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/GameObject.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/GameObject.java 2013-05-24 20:33:54 UTC (rev 9221) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/GameObject.java 2013-05-24 20:38:21 UTC (rev 9222) @@ -81,7 +81,7 @@ @Override public void addLast(@NotNull final GameObject gameObject) { // force type change when a MONSTER is put in a spawn point - if (archetypeTypeSet.getArchetypeType(this).getTypeNo() == Archetype.TYPE_SPAWN_POINT && archetypeTypeSet.getArchetypeType(gameObject).getTypeNo() == Archetype.TYPE_MOB) { + if (archetypeTypeSet.getArchetypeTypeByBaseObject(this).getTypeNo() == Archetype.TYPE_SPAWN_POINT && archetypeTypeSet.getArchetypeTypeByBaseObject(gameObject).getTypeNo() == Archetype.TYPE_MOB) { gameObject.setAttributeInt(TYPE, Archetype.TYPE_SPAWN_POINT_MOB); // change to SPAWN_POINT_MOB } super.addLast(gameObject); @@ -93,7 +93,7 @@ @Override public void addFirst(@NotNull final GameObject gameObject) { // force type change when a MONSTER is put in a spawn point - if (archetypeTypeSet.getArchetypeType(this).getTypeNo() == Archetype.TYPE_SPAWN_POINT && archetypeTypeSet.getArchetypeType(gameObject).getTypeNo() == Archetype.TYPE_MOB) { + if (archetypeTypeSet.getArchetypeTypeByBaseObject(this).getTypeNo() == Archetype.TYPE_SPAWN_POINT && archetypeTypeSet.getArchetypeTypeByBaseObject(gameObject).getTypeNo() == Archetype.TYPE_MOB) { gameObject.setAttributeInt(TYPE, Archetype.TYPE_SPAWN_POINT_MOB); // change to SPAWN_POINT_MOB } super.addFirst(gameObject); Modified: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java 2013-05-24 20:33:54 UTC (rev 9221) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java 2013-05-24 20:38:21 UTC (rev 9222) @@ -76,7 +76,7 @@ * Adds an {@link ArchetypeType} instance. * @param archetypeType the archetype type instance */ - public void add(@NotNull final ArchetypeType archetypeType) { + public void addArchetypeType(@NotNull final ArchetypeType archetypeType) { archetypeTypeList.add(archetypeType); final String typeName = archetypeType.getTypeName(); archetypeTypeNames.put(typeName, archetypeType); @@ -106,7 +106,7 @@ * ("Misc") type if no match is found */ @NotNull - public ArchetypeType getTypeByName(@NotNull final String typeName) { + public ArchetypeType getArchetypeTypeByName(@NotNull final String typeName) { final ArchetypeType type = archetypeTypeNames.get(typeName.trim()); if (type != null) { return type; @@ -122,7 +122,7 @@ * if no match was found */ @NotNull - public ArchetypeType getArchetypeType(@NotNull final BaseObject<?, ?, ?, ?> baseObject) { + public ArchetypeType getArchetypeTypeByBaseObject(@NotNull final BaseObject<?, ?, ?, ?> baseObject) { for (final ArchetypeType archetypeType : archetypeTypeList) { if (archetypeType.matches(baseObject)) { return archetypeType; @@ -155,7 +155,7 @@ * counted. * @return the number of archetype types in the list */ - public int getLength() { + public int getArchetypeTypeCount() { return archetypeTypeList.size(); } @@ -215,7 +215,7 @@ */ @NotNull public String getDisplayName(@NotNull final BaseObject<?, ?, ?, ?> baseObject) { - return getArchetypeType(baseObject).getDisplayName(baseObject); + return getArchetypeTypeByBaseObject(baseObject).getDisplayName(baseObject); } /** Modified: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java 2013-05-24 20:33:54 UTC (rev 9221) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java 2013-05-24 20:38:21 UTC (rev 9222) @@ -304,7 +304,7 @@ } if (log.isInfoEnabled()) { - log.info("Loaded " + archetypeTypeSet.getLength() + " types from '" + filename + "\'"); + log.info("Loaded " + archetypeTypeSet.getArchetypeTypeCount() + " types from '" + filename + "\'"); } } @@ -552,7 +552,7 @@ */ private void parseTypes(@NotNull final Element typeElement, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final IgnorelistsDefinition ignorelistsDefinition) { if (!typeElement.getAttribute(XML_TYPE_AVAILABLE).equals("no")) { - archetypeTypeSet.add(archetypeTypeParser.loadAttributeList(typeElement, errorViewCollector, defaultArchetypeType, archetypeTypeSet, ignorelistsDefinition, false)); + archetypeTypeSet.addArchetypeType(archetypeTypeParser.loadAttributeList(typeElement, errorViewCollector, defaultArchetypeType, archetypeTypeSet, ignorelistsDefinition, false)); } } Modified: trunk/model/src/test/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetTest.java 2013-05-24 20:33:54 UTC (rev 9221) +++ trunk/model/src/test/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetTest.java 2013-05-24 20:38:21 UTC (rev 9222) @@ -36,7 +36,7 @@ @Test(expected = UnsupportedOperationException.class) public void testIteratorReadOnly() { final ArchetypeTypeSet archetypeTypeSet = new ArchetypeTypeSet(); - archetypeTypeSet.add(new ArchetypeType("name", 0, "", false, null, false, null, null, 0, new ArchetypeAttributes(), new ArchetypeAttributesDefinition())); + archetypeTypeSet.addArchetypeType(new ArchetypeType("name", 0, "", false, null, false, null, null, 0, new ArchetypeAttributes(), new ArchetypeAttributesDefinition())); final Iterator<ArchetypeType> iterator = archetypeTypeSet.iterator(); Assert.assertTrue(iterator.hasNext()); iterator.next(); Modified: trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/GameObjectAttributesDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/GameObjectAttributesDialog.java 2013-05-24 20:33:54 UTC (rev 9221) +++ trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/GameObjectAttributesDialog.java 2013-05-24 20:38:21 UTC (rev 9222) @@ -788,7 +788,7 @@ mapManager.addMapManagerListener(mapManagerListener); // first split top-left and -right - final ArchetypeType archetypeType = archetypeTypeSet.getArchetypeType(gameObject); + final ArchetypeType archetypeType = archetypeTypeSet.getArchetypeTypeByBaseObject(gameObject); final JComponent leftPane = buildHeader(archetypeTypeSet.getArchetypeTypeIndex(archetypeType), archetypeType); // Now split horizontally @@ -860,7 +860,7 @@ */ @NotNull private Component buildTypesBox(final int type, @NotNull final ArchetypeType archetypeType) { - final String[] nameList = new String[archetypeTypeSet.getLength()]; + final String[] nameList = new String[archetypeTypeSet.getArchetypeTypeCount()]; // read all type names int i = 0; @@ -1175,7 +1175,7 @@ * @return true if the settings were applied, false if error occurred */ private boolean applySettings2() { - final ArchetypeType tmpArchetypeType = archetypeTypeSet.getArchetypeType(gameObject); // the type structure for this gameObject + final ArchetypeType tmpArchetypeType = archetypeTypeSet.getArchetypeTypeByBaseObject(gameObject); // the type structure for this gameObject final StringBuilder newArchText = new StringBuilder(); final String[] newMsg = new String[1]; Modified: trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/TypesBoxItemListener.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/TypesBoxItemListener.java 2013-05-24 20:33:54 UTC (rev 9221) +++ trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/TypesBoxItemListener.java 2013-05-24 20:38:21 UTC (rev 9222) @@ -130,7 +130,7 @@ if (e.getStateChange() == ItemEvent.DESELECTED) { deselected = ((String) e.getItem()).trim(); } else if (e.getStateChange() == ItemEvent.SELECTED && !e.getItem().equals(deselected)) { - final ArchetypeType newType = archetypeTypeSet.getTypeByName((String) e.getItem()); + final ArchetypeType newType = archetypeTypeSet.getArchetypeTypeByName((String) e.getItem()); typeComboBox.hidePopup(); gameObjectAttributesDialog.update(gameObjectAttributesDialog.getGraphics()); Modified: trunk/src/app/net/sf/gridarta/gui/panel/gameobjecttexteditor/GameObjectTextEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/panel/gameobjecttexteditor/GameObjectTextEditor.java 2013-05-24 20:33:54 UTC (rev 9221) +++ trunk/src/app/net/sf/gridarta/gui/panel/gameobjecttexteditor/GameObjectTextEditor.java 2013-05-24 20:38:21 UTC (rev 9222) @@ -124,7 +124,7 @@ try { final Document document = archEdit.getDocument(); - final ArchetypeType typeStruct = archetypeTypeSet.getArchetypeType(gameObject); + final ArchetypeType typeStruct = archetypeTypeSet.getArchetypeTypeByBaseObject(gameObject); final String errorText = GameObjectUtils.getSyntaxErrors(gameObject, typeStruct); final String objectText = gameObject.getObjectText(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-05-24 20:34:02
|
Revision: 9221 http://sourceforge.net/p/gridarta/code/9221 Author: akirschbaum Date: 2013-05-24 20:33:54 +0000 (Fri, 24 May 2013) Log Message: ----------- Reorder code. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java Modified: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java 2013-05-24 20:30:30 UTC (rev 9220) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java 2013-05-24 20:33:54 UTC (rev 9221) @@ -52,6 +52,13 @@ private final List<ArchetypeType> archetypeTypeList = new ArrayList<ArchetypeType>(); /** + * Table with type archetype type name as keys ({@link String}), and {@link + * ArchetypeType} object as values (<code>ArchetypeType</code>). + */ + @NotNull + private final Map<String, ArchetypeType> archetypeTypeNames = new HashMap<String, ArchetypeType>(); + + /** * Table with {@link List} objects for lists (value) accessible by name * (key). */ @@ -66,58 +73,27 @@ private final Map<String, AttributeBitmask> bitmaskTable = new HashMap<String, AttributeBitmask>(); /** - * Table with type archetype type name as keys ({@link String}), and {@link - * ArchetypeType} object as values (<code>ArchetypeType</code>). - */ - @NotNull - private final Map<String, ArchetypeType> archetypeTypeNames = new HashMap<String, ArchetypeType>(); - - /** - * Returns a list type definition. - * @param listName the list name - * @return the list type definition or <code>null</code> if the list does - * not exist - */ - @Nullable - public ArchetypeTypeList getList(@NotNull final String listName) { - return listTable.get(listName); - } - - /** - * {@inheritDoc} - */ - @NotNull - @Override - public Iterator<ArchetypeType> iterator() { - return Collections.unmodifiableList(archetypeTypeList).iterator(); - } - - /** - * Returns the index of an {@link ArchetypeType} instance. + * Adds an {@link ArchetypeType} instance. * @param archetypeType the archetype type instance - * @return the index */ - public int getArchetypeTypeIndex(@NotNull final ArchetypeType archetypeType) { - return archetypeTypeList.indexOf(archetypeType); + public void add(@NotNull final ArchetypeType archetypeType) { + archetypeTypeList.add(archetypeType); + final String typeName = archetypeType.getTypeName(); + archetypeTypeNames.put(typeName, archetypeType); + if (typeName.equals("Misc")) { + fallbackArchetypeType = archetypeType; + } } /** - * Returns the number of ArchetypeTypes in the list. The default type is not - * counted. - * @return the number of archetype types in the list + * 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 + * does not exist */ - public int getLength() { - return archetypeTypeList.size(); - } - - /** - * Returns a bitmask type by name. - * @param bitmaskName the bitmask name to look up - * @return the bitmask type or <code>null</code> if the name does not exist - */ @Nullable - public AttributeBitmask getBitmask(@NotNull final String bitmaskName) { - return bitmaskTable.get(bitmaskName); + public Iterable<ArchetypeAttribute> getArchetypeType(@NotNull final String typeName) { + return archetypeTypeNames.get(typeName); } /** @@ -157,40 +133,43 @@ } /** - * Returns a description of this type. - * @param baseObject the base object to describe - * @return the description + * {@inheritDoc} */ @NotNull - public String getDisplayName(@NotNull final BaseObject<?, ?, ?, ?> baseObject) { - return getArchetypeType(baseObject).getDisplayName(baseObject); + @Override + public Iterator<ArchetypeType> iterator() { + return Collections.unmodifiableList(archetypeTypeList).iterator(); } /** - * 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 - * does not exist + * Returns the index of an {@link ArchetypeType} instance. + * @param archetypeType the archetype type instance + * @return the index */ - @Nullable - public Iterable<ArchetypeAttribute> getArchetypeType(@NotNull final String typeName) { - return archetypeTypeNames.get(typeName); + public int getArchetypeTypeIndex(@NotNull final ArchetypeType archetypeType) { + return archetypeTypeList.indexOf(archetypeType); } /** - * Adds an {@link ArchetypeType} instance. - * @param archetypeType the archetype type instance + * Returns the number of ArchetypeTypes in the list. The default type is not + * counted. + * @return the number of archetype types in the list */ - public void add(@NotNull final ArchetypeType archetypeType) { - archetypeTypeList.add(archetypeType); - final String typeName = archetypeType.getTypeName(); - archetypeTypeNames.put(typeName, archetypeType); - if (typeName.equals("Misc")) { - fallbackArchetypeType = archetypeType; - } + public int getLength() { + return archetypeTypeList.size(); } /** + * Returns whether a given {@link ArchetypeType} is the fallback archetype + * type used for game objects not matching any defined archetype type. + * @param archetypeType the archetype type to check + * @return whether the given archetype type is the fallback archetype type + */ + public boolean isFallbackArchetypeType(@NotNull final ArchetypeType archetypeType) { + return archetypeType == fallbackArchetypeType; + } + + /** * Adds a list definition. * @param attribute the attribute name * @param list the list definition @@ -200,6 +179,17 @@ } /** + * Returns a list type definition. + * @param listName the list name + * @return the list type definition or <code>null</code> if the list does + * not exist + */ + @Nullable + public ArchetypeTypeList getList(@NotNull final String listName) { + return listTable.get(listName); + } + + /** * Adds a bitmask definition. * @param attribute the attribute name * @param attributeBitmask the list definition @@ -209,6 +199,26 @@ } /** + * Returns a bitmask type by name. + * @param bitmaskName the bitmask name to look up + * @return the bitmask type or <code>null</code> if the name does not exist + */ + @Nullable + public AttributeBitmask getBitmask(@NotNull final String bitmaskName) { + return bitmaskTable.get(bitmaskName); + } + + /** + * 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); + } + + /** * {@inheritDoc} */ @NotNull @@ -236,14 +246,4 @@ sb.append('\n'); } - /** - * Returns whether a given {@link ArchetypeType} is the fallback archetype - * type used for game objects not matching any defined archetype type. - * @param archetypeType the archetype type to check - * @return whether the given archetype type is the fallback archetype type - */ - public boolean isFallbackArchetypeType(@NotNull final ArchetypeType archetypeType) { - return archetypeType == fallbackArchetypeType; - } - } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-05-24 20:30:39
|
Revision: 9220 http://sourceforge.net/p/gridarta/code/9220 Author: akirschbaum Date: 2013-05-24 20:30:30 +0000 (Fri, 24 May 2013) Log Message: ----------- Accelerate archetype type lookups. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java Modified: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java 2013-05-24 20:28:32 UTC (rev 9219) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java 2013-05-24 20:30:30 UTC (rev 9220) @@ -174,12 +174,7 @@ */ @Nullable public Iterable<ArchetypeAttribute> getArchetypeType(@NotNull final String typeName) { - for (final ArchetypeType archetypeType : archetypeTypeList) { - if (archetypeType.getTypeName().equals(typeName)) { - return archetypeType; - } - } - return null; + return archetypeTypeNames.get(typeName); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-05-24 20:28:36
|
Revision: 9219 http://sourceforge.net/p/gridarta/code/9219 Author: akirschbaum Date: 2013-05-24 20:28:32 +0000 (Fri, 24 May 2013) Log Message: ----------- Update comments. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java Modified: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java 2013-05-24 20:26:58 UTC (rev 9218) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java 2013-05-24 20:28:32 UTC (rev 9219) @@ -45,10 +45,11 @@ private ArchetypeType fallbackArchetypeType = new ArchetypeType("", 0, "", true, null, false, null, null, 2, new ArchetypeAttributes(), new ArchetypeAttributesDefinition()); /** - * Lists with all defined {@link ArchetypeType ArchetypeTypes}. + * Lists with all defined {@link ArchetypeType ArchetypeTypes}. The ordering + * is the same as in the "types.xml" file. */ @NotNull - private final List<ArchetypeType> archetypeTypeList = new ArrayList<ArchetypeType>(); // All but the default ArchetypeType + private final List<ArchetypeType> archetypeTypeList = new ArrayList<ArchetypeType>(); /** * Table with {@link List} objects for lists (value) accessible by name This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-05-24 20:27:01
|
Revision: 9218 http://sourceforge.net/p/gridarta/code/9218 Author: akirschbaum Date: 2013-05-24 20:26:58 +0000 (Fri, 24 May 2013) Log Message: ----------- Add missing serialVersionUID field. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/utils/JFileField.java Modified: trunk/src/app/net/sf/gridarta/gui/utils/JFileField.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/JFileField.java 2013-05-24 20:21:06 UTC (rev 9217) +++ trunk/src/app/net/sf/gridarta/gui/utils/JFileField.java 2013-05-24 20:26:58 UTC (rev 9218) @@ -43,6 +43,11 @@ public class JFileField extends JComponent { /** + * The serial version UID. + */ + private static final long serialVersionUID = 1L; + + /** * The {@link ActionBuilder}. */ @NotNull This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-05-24 20:21:09
|
Revision: 9217 http://sourceforge.net/p/gridarta/code/9217 Author: akirschbaum Date: 2013-05-24 20:21:06 +0000 (Fri, 24 May 2013) Log Message: ----------- Merge duplicated code. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/GameObject.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/GameObjectAttributesDialog.java trunk/src/app/net/sf/gridarta/gui/panel/gameobjecttexteditor/GameObjectTextEditor.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java 2013-05-24 20:14:36 UTC (rev 9216) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java 2013-05-24 20:21:06 UTC (rev 9217) @@ -74,7 +74,7 @@ @Override public void addLast(@NotNull final GameObject gameObject) { // force type change when a MONSTER is put in a spawn point - if (archetypeTypeSet.getTypeOfArch(this).getTypeNo() == Archetype.TYPE_SPAWN_POINT && archetypeTypeSet.getTypeOfArch(gameObject).getTypeNo() == Archetype.TYPE_MOB) { + if (archetypeTypeSet.getArchetypeType(this).getTypeNo() == Archetype.TYPE_SPAWN_POINT && archetypeTypeSet.getArchetypeType(gameObject).getTypeNo() == Archetype.TYPE_MOB) { gameObject.setAttributeInt(TYPE, Archetype.TYPE_SPAWN_POINT_MOB); // change to SPAWN_POINT_MOB } super.addLast(gameObject); @@ -86,7 +86,7 @@ @Override public void addFirst(@NotNull final GameObject gameObject) { // force type change when a MONSTER is put in a spawn point - if (archetypeTypeSet.getTypeOfArch(this).getTypeNo() == Archetype.TYPE_SPAWN_POINT && archetypeTypeSet.getTypeOfArch(gameObject).getTypeNo() == Archetype.TYPE_MOB) { + if (archetypeTypeSet.getArchetypeType(this).getTypeNo() == Archetype.TYPE_SPAWN_POINT && archetypeTypeSet.getArchetypeType(gameObject).getTypeNo() == Archetype.TYPE_MOB) { gameObject.setAttributeInt(TYPE, Archetype.TYPE_SPAWN_POINT_MOB); // change to SPAWN_POINT_MOB } super.addFirst(gameObject); Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/GameObject.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/GameObject.java 2013-05-24 20:14:36 UTC (rev 9216) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/GameObject.java 2013-05-24 20:21:06 UTC (rev 9217) @@ -81,7 +81,7 @@ @Override public void addLast(@NotNull final GameObject gameObject) { // force type change when a MONSTER is put in a spawn point - if (archetypeTypeSet.getTypeOfArch(this).getTypeNo() == Archetype.TYPE_SPAWN_POINT && archetypeTypeSet.getTypeOfArch(gameObject).getTypeNo() == Archetype.TYPE_MOB) { + if (archetypeTypeSet.getArchetypeType(this).getTypeNo() == Archetype.TYPE_SPAWN_POINT && archetypeTypeSet.getArchetypeType(gameObject).getTypeNo() == Archetype.TYPE_MOB) { gameObject.setAttributeInt(TYPE, Archetype.TYPE_SPAWN_POINT_MOB); // change to SPAWN_POINT_MOB } super.addLast(gameObject); @@ -93,7 +93,7 @@ @Override public void addFirst(@NotNull final GameObject gameObject) { // force type change when a MONSTER is put in a spawn point - if (archetypeTypeSet.getTypeOfArch(this).getTypeNo() == Archetype.TYPE_SPAWN_POINT && archetypeTypeSet.getTypeOfArch(gameObject).getTypeNo() == Archetype.TYPE_MOB) { + if (archetypeTypeSet.getArchetypeType(this).getTypeNo() == Archetype.TYPE_SPAWN_POINT && archetypeTypeSet.getArchetypeType(gameObject).getTypeNo() == Archetype.TYPE_MOB) { gameObject.setAttributeInt(TYPE, Archetype.TYPE_SPAWN_POINT_MOB); // change to SPAWN_POINT_MOB } super.addFirst(gameObject); Modified: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java 2013-05-24 20:14:36 UTC (rev 9216) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java 2013-05-24 20:21:06 UTC (rev 9217) @@ -110,25 +110,6 @@ } /** - * Find and return the type-structure (<code>ArchetypeType</code>) that - * matches for the given base object. This is not only a comparison between - * type numbers - special type-attributes must also be dealt with. <p/> - * @param baseObject the base object to find the type for - * @return the <code>ArchetypeType</code> which belongs to this base object, - * or the first (misc) type if no match is found. - */ - @NotNull - public ArchetypeType getTypeOfArch(@NotNull final BaseObject<?, ?, ?, ?> baseObject) { - for (final ArchetypeType tmp : archetypeTypeList) { - if (tmp.matches(baseObject)) { - return tmp; - } - } - - return fallbackArchetypeType; - } - - /** * Returns a bitmask type by name. * @param bitmaskName the bitmask name to look up * @return the bitmask type or <code>null</code> if the name does not exist Modified: trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/GameObjectAttributesDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/GameObjectAttributesDialog.java 2013-05-24 20:14:36 UTC (rev 9216) +++ trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/GameObjectAttributesDialog.java 2013-05-24 20:21:06 UTC (rev 9217) @@ -1175,7 +1175,7 @@ * @return true if the settings were applied, false if error occurred */ private boolean applySettings2() { - final ArchetypeType tmpArchetypeType = archetypeTypeSet.getTypeOfArch(gameObject); // the type structure for this gameObject + final ArchetypeType tmpArchetypeType = archetypeTypeSet.getArchetypeType(gameObject); // the type structure for this gameObject final StringBuilder newArchText = new StringBuilder(); final String[] newMsg = new String[1]; Modified: trunk/src/app/net/sf/gridarta/gui/panel/gameobjecttexteditor/GameObjectTextEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/panel/gameobjecttexteditor/GameObjectTextEditor.java 2013-05-24 20:14:36 UTC (rev 9216) +++ trunk/src/app/net/sf/gridarta/gui/panel/gameobjecttexteditor/GameObjectTextEditor.java 2013-05-24 20:21:06 UTC (rev 9217) @@ -124,7 +124,7 @@ try { final Document document = archEdit.getDocument(); - final ArchetypeType typeStruct = archetypeTypeSet.getTypeOfArch(gameObject); + final ArchetypeType typeStruct = archetypeTypeSet.getArchetypeType(gameObject); final String errorText = GameObjectUtils.getSyntaxErrors(gameObject, typeStruct); final String objectText = gameObject.getObjectText(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-05-24 20:14:40
|
Revision: 9216 http://sourceforge.net/p/gridarta/code/9216 Author: akirschbaum Date: 2013-05-24 20:14:36 +0000 (Fri, 24 May 2013) Log Message: ----------- Simplify code. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/GameObjectAttributesDialog.java Modified: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java 2013-05-24 20:08:51 UTC (rev 9215) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java 2013-05-24 20:14:36 UTC (rev 9216) @@ -92,16 +92,6 @@ } /** - * Returns an {@link ArchetypeType} instance by index. - * @param n the index - * @return the archetype type instance - */ - @Nullable - public ArchetypeType getArchetypeType(final int n) { - return archetypeTypeList.get(n); - } - - /** * Returns the index of an {@link ArchetypeType} instance. * @param archetypeType the archetype type instance * @return the index @@ -269,4 +259,14 @@ sb.append('\n'); } + /** + * Returns whether a given {@link ArchetypeType} is the fallback archetype + * type used for game objects not matching any defined archetype type. + * @param archetypeType the archetype type to check + * @return whether the given archetype type is the fallback archetype type + */ + public boolean isFallbackArchetypeType(@NotNull final ArchetypeType archetypeType) { + return archetypeType == fallbackArchetypeType; + } + } Modified: trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/GameObjectAttributesDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/GameObjectAttributesDialog.java 2013-05-24 20:08:51 UTC (rev 9215) +++ trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/GameObjectAttributesDialog.java 2013-05-24 20:14:36 UTC (rev 9216) @@ -1229,15 +1229,11 @@ // deal with syntax errors now if (errors != null) { - final boolean keepErrors; - if (tmpArchetypeType == archetypeTypeSet.getArchetypeType(0)) { - // for generic (misc) type, all errors are automatically kept. - // "misc" is no real type - it is more a default mask for unknown types - keepErrors = true; - } else { - // open a popup dialog and ask user to decide what to do with his errors - keepErrors = ConfirmErrorsDialog.askConfirmErrors(errors, this); - } + // For the fallback archetype type, all errors are automatically + // kept. "Misc" is no real type - it is more a default mask for + // unknown types. For all other archetype types, a popup dialog is + // opened and the user may decide what to do with his errors. + final boolean keepErrors = archetypeTypeSet.isFallbackArchetypeType(tmpArchetypeType) || ConfirmErrorsDialog.askConfirmErrors(errors, this); if (keepErrors) { gameObject.addObjectText(errors.trim()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-05-24 20:08:54
|
Revision: 9215 http://sourceforge.net/p/gridarta/code/9215 Author: akirschbaum Date: 2013-05-24 20:08:51 +0000 (Fri, 24 May 2013) Log Message: ----------- Remove ArchetypeTypeSet.defineFallbackArchetypeType(). Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java Modified: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java 2013-05-24 20:01:25 UTC (rev 9214) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java 2013-05-24 20:08:51 UTC (rev 9215) @@ -41,8 +41,8 @@ * The default (fallback) {@link ArchetypeType} used for game objects not * matching any defined type. */ - @Nullable - private ArchetypeType fallbackArchetypeType; + @NotNull + private ArchetypeType fallbackArchetypeType = new ArchetypeType("", 0, "", true, null, false, null, null, 2, new ArchetypeAttributes(), new ArchetypeAttributesDefinition()); /** * Lists with all defined {@link ArchetypeType ArchetypeTypes}. @@ -135,9 +135,6 @@ } } - if (fallbackArchetypeType == null) { - throw new IllegalStateException(); - } return fallbackArchetypeType; } @@ -167,9 +164,6 @@ return type; } - if (fallbackArchetypeType == null) { - throw new IllegalStateException(); - } return fallbackArchetypeType; } @@ -187,9 +181,6 @@ } } - if (fallbackArchetypeType == null) { - throw new IllegalStateException(); - } return fallbackArchetypeType; } @@ -225,7 +216,11 @@ */ public void add(@NotNull final ArchetypeType archetypeType) { archetypeTypeList.add(archetypeType); - archetypeTypeNames.put(archetypeType.getTypeName(), archetypeType); + final String typeName = archetypeType.getTypeName(); + archetypeTypeNames.put(typeName, archetypeType); + if (typeName.equals("Misc")) { + fallbackArchetypeType = archetypeType; + } } /** @@ -247,16 +242,6 @@ } /** - * Initializes the fallback {@link ArchetypeType}. - */ - public void defineFallbackArchetypeType() { - fallbackArchetypeType = archetypeTypeNames.get("Misc"); - if (fallbackArchetypeType == null) { - fallbackArchetypeType = new ArchetypeType("", 0, "", true, null, false, null, null, 2, new ArchetypeAttributes(), new ArchetypeAttributesDefinition()); - } - } - - /** * {@inheritDoc} */ @NotNull Modified: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java 2013-05-24 20:01:25 UTC (rev 9214) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java 2013-05-24 20:08:51 UTC (rev 9215) @@ -306,8 +306,6 @@ if (log.isInfoEnabled()) { log.info("Loaded " + archetypeTypeSet.getLength() + " types from '" + filename + "\'"); } - - archetypeTypeSet.defineFallbackArchetypeType(); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-05-24 20:01:30
|
Revision: 9214 http://sourceforge.net/p/gridarta/code/9214 Author: akirschbaum Date: 2013-05-24 20:01:25 +0000 (Fri, 24 May 2013) Log Message: ----------- Update comment. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java Modified: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java 2013-05-24 19:56:48 UTC (rev 9213) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java 2013-05-24 20:01:25 UTC (rev 9214) @@ -45,10 +45,7 @@ private ArchetypeType fallbackArchetypeType; /** - * Lists with all {@link ArchetypeType ArchetypeTypes}. Contains all but the - * default archetype type. - * @todo verify whether the default ArchetypeType really is not included in - * this list. + * Lists with all defined {@link ArchetypeType ArchetypeTypes}. */ @NotNull private final List<ArchetypeType> archetypeTypeList = new ArrayList<ArchetypeType>(); // All but the default ArchetypeType This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-05-24 19:56:58
|
Revision: 9213 http://sourceforge.net/p/gridarta/code/9213 Author: akirschbaum Date: 2013-05-24 19:56:48 +0000 (Fri, 24 May 2013) Log Message: ----------- Remove redundant field initializations. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/ArchetypeParser.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/maparchobject/MapArchObject.java trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/io/ArchetypeParserTest.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/maparchobject/MapArchObject.java trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/io/ArchetypeParserTest.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/mappropertiesdialog/MapPropertiesDialog.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/io/ArchetypeParser.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/maparchobject/MapArchObject.java trunk/gridarta.ipr trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeBuilder.java trunk/model/src/app/net/sf/gridarta/model/archetypechooser/ArchetypeChooserFolder.java trunk/model/src/app/net/sf/gridarta/model/archetypechooser/ArchetypeChooserModel.java trunk/model/src/app/net/sf/gridarta/model/archetypeset/DefaultArchetypeSet.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java trunk/model/src/app/net/sf/gridarta/model/baseobject/GameObjectContainer.java trunk/model/src/app/net/sf/gridarta/model/data/NamedTreeNode.java trunk/model/src/app/net/sf/gridarta/model/exitconnector/AbstractExitConnectorModel.java trunk/model/src/app/net/sf/gridarta/model/face/DoubleImageFilter.java trunk/model/src/app/net/sf/gridarta/model/face/FaceObjectProviders.java trunk/model/src/app/net/sf/gridarta/model/face/FilterFaceProvider.java trunk/model/src/app/net/sf/gridarta/model/filter/AbstractFilterConfig.java trunk/model/src/app/net/sf/gridarta/model/filter/FilterParser.java trunk/model/src/app/net/sf/gridarta/model/filter/NamedFilterConfig.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/MultiArchData.java trunk/model/src/app/net/sf/gridarta/model/index/AbstractIndex.java trunk/model/src/app/net/sf/gridarta/model/index/MapsIndexer.java trunk/model/src/app/net/sf/gridarta/model/io/FlatFileIterator.java trunk/model/src/app/net/sf/gridarta/model/maparchobject/AbstractMapArchObject.java trunk/model/src/app/net/sf/gridarta/model/mapgrid/MapGrid.java trunk/model/src/app/net/sf/gridarta/model/mapmanager/AbstractMapManager.java trunk/model/src/app/net/sf/gridarta/model/mapmodel/DefaultMapModel.java trunk/model/src/app/net/sf/gridarta/model/match/ViewGameObjectMatcherManager.java trunk/model/src/app/net/sf/gridarta/model/resource/AbstractResources.java trunk/model/src/app/net/sf/gridarta/model/settings/DefaultGlobalSettings.java trunk/model/src/app/net/sf/gridarta/model/undo/UndoModel.java trunk/model/src/app/net/sf/gridarta/model/undo/UndoState.java trunk/model/src/app/net/sf/gridarta/model/validation/checks/MapCheckerScriptChecker.java trunk/model/src/test/net/sf/gridarta/model/archetype/TestDefaultArchetype.java trunk/model/src/test/net/sf/gridarta/model/baseobject/AbstractBaseObjectTest.java trunk/model/src/test/net/sf/gridarta/model/errorview/TestErrorView.java trunk/model/src/test/net/sf/gridarta/model/io/ArchetypeParserTest.java trunk/model/src/test/net/sf/gridarta/model/mapcursor/MapCursorTest.java trunk/model/src/test/net/sf/gridarta/model/match/NamedGameObjectMatcherTest.java trunk/plugin/src/app/net/sf/gridarta/plugin/BshThread.java trunk/plugin/src/app/net/sf/gridarta/plugin/Plugin.java trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/ArchParameter.java trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/DoubleParameter.java trunk/preferences/src/app/net/sf/gridarta/preferences/FilePreferencesFactory.java trunk/src/app/net/sf/gridarta/commands/Collector.java trunk/src/app/net/sf/gridarta/gui/autovalidator/AutoValidator.java trunk/src/app/net/sf/gridarta/gui/delayedmapmodel/DelayedMapModelListenerManager.java trunk/src/app/net/sf/gridarta/gui/dialog/bookmarks/BookmarkActions.java trunk/src/app/net/sf/gridarta/gui/dialog/bookmarks/ManageBookmarksDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/bookmarks/MapMenuEntryIcons.java trunk/src/app/net/sf/gridarta/gui/dialog/errorview/ConsoleErrorView.java trunk/src/app/net/sf/gridarta/gui/dialog/errorview/DefaultErrorView.java trunk/src/app/net/sf/gridarta/gui/dialog/find/FindDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/find/FindDialogManager.java trunk/src/app/net/sf/gridarta/gui/dialog/findarchetypes/FindArchetypesDialogManager.java trunk/src/app/net/sf/gridarta/gui/dialog/findarchetypes/TableModel.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBitmask.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/GameObjectAttributesDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/TypesBoxItemListener.java trunk/src/app/net/sf/gridarta/gui/dialog/gomap/GoMapDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/newmap/AbstractNewMapDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/ClosingIcon.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/PluginManagerFactory.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/PluginView.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/PluginViewPane.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/ArchComboBoxEditor.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/ArchComboBoxModel.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/MapParameterComboBoxModel.java trunk/src/app/net/sf/gridarta/gui/dialog/prefs/ResPreferences.java trunk/src/app/net/sf/gridarta/gui/dialog/replace/ReplaceDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/replace/ReplaceDialogManager.java trunk/src/app/net/sf/gridarta/gui/dialog/shortcuts/ShortcutsDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/shrinkmapsize/ShrinkMapSizeDialog.java trunk/src/app/net/sf/gridarta/gui/exitconnector/ExitConnectorController.java trunk/src/app/net/sf/gridarta/gui/filter/MenuItemCreator.java trunk/src/app/net/sf/gridarta/gui/mainwindow/GameObjectTextEditorTab.java trunk/src/app/net/sf/gridarta/gui/map/MapPreviewAccessory.java trunk/src/app/net/sf/gridarta/gui/map/event/MouseOpEvent.java trunk/src/app/net/sf/gridarta/gui/map/maptilepane/TilePanel.java trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewManager.java trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViews.java trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFile.java trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTree.java trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTreeActions.java trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenu.java trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuEntryTreeCellRenderer.java trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuManager.java trunk/src/app/net/sf/gridarta/gui/mapmenu/TreeDragSource.java trunk/src/app/net/sf/gridarta/gui/misc/About.java trunk/src/app/net/sf/gridarta/gui/misc/DefaultFileControl.java trunk/src/app/net/sf/gridarta/gui/misc/MainViewActions.java trunk/src/app/net/sf/gridarta/gui/misc/ShiftProcessor.java trunk/src/app/net/sf/gridarta/gui/misc/StatusBar.java trunk/src/app/net/sf/gridarta/gui/panel/archetypechooser/ArchetypePanel.java trunk/src/app/net/sf/gridarta/gui/panel/connectionview/View.java trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/AbstractGameObjectAttributesTab.java trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/ErrorListView.java trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/EventsTab.java trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/FaceTab.java trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/GameObjectAttributesControl.java trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/GameObjectAttributesModel.java trunk/src/app/net/sf/gridarta/gui/panel/objectchooser/DefaultObjectChooser.java trunk/src/app/net/sf/gridarta/gui/panel/pickmapchooser/PickmapChooserControl.java trunk/src/app/net/sf/gridarta/gui/panel/pickmapchooser/PickmapChooserView.java trunk/src/app/net/sf/gridarta/gui/panel/selectedsquare/ModelUpdater.java trunk/src/app/net/sf/gridarta/gui/panel/tools/DeletionTool.java trunk/src/app/net/sf/gridarta/gui/panel/tools/SelectionTool.java trunk/src/app/net/sf/gridarta/gui/scripts/DefaultScriptArchEditor.java trunk/src/app/net/sf/gridarta/gui/treasurelist/CFTreasureListTree.java trunk/src/app/net/sf/gridarta/gui/undo/UndoControl.java trunk/src/app/net/sf/gridarta/gui/utils/DirectionComponent.java trunk/src/app/net/sf/gridarta/gui/utils/DirectionLayout.java trunk/src/app/net/sf/gridarta/gui/utils/GList.java trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/BorderSplitPane.java trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/Tab.java trunk/src/app/net/sf/gridarta/gui/utils/tristate/TristateCheckBox.java trunk/src/app/net/sf/gridarta/mainactions/MainActions.java trunk/src/app/net/sf/gridarta/mainactions/RandomFillDialog.java trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java trunk/src/test/net/sf/gridarta/actions/ExitConnectorActionsTest.java trunk/textedit/src/app/net/sf/gridarta/textedit/scripteditor/CFPythonPopup.java trunk/textedit/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditControl.java trunk/textedit/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditUndoActions.java trunk/textedit/src/app/net/sf/gridarta/textedit/textarea/InputHandler.java trunk/textedit/src/app/net/sf/gridarta/textedit/textarea/ScrollLayout.java trunk/textedit/src/app/net/sf/gridarta/textedit/textarea/SyntaxStyle.java trunk/textedit/src/app/net/sf/gridarta/textedit/textarea/TextAreaPainter.java trunk/textedit/src/app/net/sf/gridarta/textedit/textarea/actions/Replace.java trunk/textedit/src/app/net/sf/gridarta/textedit/textarea/tokenmarker/CTokenMarker.java trunk/textedit/src/app/net/sf/gridarta/textedit/textarea/tokenmarker/HTMLTokenMarker.java trunk/utils/src/app/net/sf/gridarta/utils/CopyReader.java trunk/utils/src/app/net/sf/gridarta/utils/ProcessRunner.java trunk/utils/src/app/net/sf/gridarta/utils/SystemIcons.java trunk/utils/src/app/net/sf/gridarta/utils/WrappingStringBuilder.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -106,7 +106,7 @@ * @serial */ @Nullable - private Window dialog = null; + private Window dialog; /** * The message text. Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/ArchetypeParser.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/ArchetypeParser.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/ArchetypeParser.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -69,7 +69,7 @@ /** * The multi-shape ID of the currently parsed archetype. */ - private int multiShapeID = 0; + private int multiShapeID; /** * Creates an ArchetypeParser. Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/maparchobject/MapArchObject.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/maparchobject/MapArchObject.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/maparchobject/MapArchObject.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -47,79 +47,79 @@ * No save map. * @serial */ - private boolean noSave = false; + private boolean noSave; /** * No magic spells. * @serial */ - private boolean noMagic = false; + private boolean noMagic; /** * No prayers. * @serial */ - private boolean noPriest = false; + private boolean noPriest; /** * No harmful spells allowed. * @serial */ - private boolean noHarm = false; + private boolean noHarm; /** * No summoning allowed. * @serial */ - private boolean noSummon = false; + private boolean noSummon; /** * Check map reset status after re-login. * @serial */ - private boolean fixedLogin = false; + private boolean fixedLogin; /** * Unique map. * @serial */ - private boolean unique = false; + private boolean unique; /** * Fixed reset time. * @serial */ - private boolean fixedResetTime = false; + private boolean fixedResetTime; /** * Players cannot save on this map. * @serial */ - private boolean playerNoSave = false; + private boolean playerNoSave; /** * Player vs Player combat allowed. * @serial */ - private boolean pvp = false; + private boolean pvp; /** * The tileset id. 0 means no available tileset id * @serial */ - private int tilesetId = 0; + private int tilesetId; /** * The tileset x coordinate. * @serial */ - private int tilesetX = 0; + private int tilesetX; /** * The tileset y coordinate. * @serial */ - private int tilesetY = 0; + private int tilesetY; /** * The name of the background music. Set to empty string if unset. Modified: trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/io/ArchetypeParserTest.java =================================================================== --- trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/io/ArchetypeParserTest.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/io/ArchetypeParserTest.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -61,7 +61,7 @@ * The loaded archetypes. */ @Nullable - private ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet = null; + private ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet; /** * Checks that mpart_id fields are parsed correctly. Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -107,7 +107,7 @@ * loading large and/or multiple maps. */ @Nullable - private SoftReference<BufferedImage> backBufferRef = null; + private SoftReference<BufferedImage> backBufferRef; /** * The map view settings instance. Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -98,7 +98,7 @@ * @serial */ @Nullable - private Window dialog = null; + private Window dialog; /** * The {@link GridBagConstraints} for label fields before text input 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 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -143,7 +143,7 @@ * The {@link SmoothFaces} instance. */ @Nullable - private SmoothFaces smoothFaces = null; + private SmoothFaces smoothFaces; /** * {@inheritDoc} Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/maparchobject/MapArchObject.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/maparchobject/MapArchObject.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/maparchobject/MapArchObject.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -53,55 +53,55 @@ * If set, this entire map is unique. * @serial */ - private boolean unique = false; + private boolean unique; /** * If set, this entire map is a template map. * @serial */ - private boolean template = false; + private boolean template; /** * If set, this entire map is no smooth. * @serial */ - private boolean noSmooth = false; + private boolean noSmooth; /** * Weather variable: temperature. * @serial */ - private int temperature = 0; + private int temperature; /** * Weather variable: pressure. * @serial */ - private int pressure = 0; + private int pressure; /** * Weather variable: humidity (water in the air). * @serial */ - private int humidity = 0; + private int humidity; /** * Weather variable: wind speed. * @serial */ - private int windSpeed = 0; + private int windSpeed; /** * Weather variable: wind direction. * @serial */ - private int windDirection = 0; + private int windDirection; /** * Weather variable: sky settings. * @serial */ - private int sky = 0; + private int sky; /** * The item spec for the shop, if there is one. @@ -121,19 +121,19 @@ * The greed of the shop. * @serial */ - private double shopGreed = 0.0; + private double shopGreed; /** * The minimum price the shop will trade for. * @serial */ - private int shopMin = 0; + private int shopMin; /** * The maximum price the shop will trade for. * @serial */ - private int shopMax = 0; + private int shopMax; /** * The region the map is in. Modified: trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/io/ArchetypeParserTest.java =================================================================== --- trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/io/ArchetypeParserTest.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/io/ArchetypeParserTest.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -59,7 +59,7 @@ * The loaded archetypes. */ @Nullable - private ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet = null; + private ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet; /** * Checks that inventory game objects are recognized. Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/mappropertiesdialog/MapPropertiesDialog.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/mappropertiesdialog/MapPropertiesDialog.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/mappropertiesdialog/MapPropertiesDialog.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -114,7 +114,7 @@ * @serial */ @Nullable - private Window dialog = null; + private Window dialog; /** * The message text. Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/io/ArchetypeParser.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/io/ArchetypeParser.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/io/ArchetypeParser.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -61,7 +61,7 @@ /** * The multi-shape ID of the currently parsed archetype. */ - private int multiShapeID = 0; + private int multiShapeID; /** * Creates an ArchetypeParser. Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/maparchobject/MapArchObject.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/maparchobject/MapArchObject.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/maparchobject/MapArchObject.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -47,79 +47,79 @@ * No save map. * @serial */ - private boolean noSave = false; + private boolean noSave; /** * No magic spells. * @serial */ - private boolean noMagic = false; + private boolean noMagic; /** * No prayers. * @serial */ - private boolean noPriest = false; + private boolean noPriest; /** * No harmful spells allowed. * @serial */ - private boolean noHarm = false; + private boolean noHarm; /** * No summoning allowed. * @serial */ - private boolean noSummon = false; + private boolean noSummon; /** * Check map reset status after re-login. * @serial */ - private boolean fixedLogin = false; + private boolean fixedLogin; /** * Permanent death with revivable corpses. * @serial */ - private boolean permDeath = false; + private boolean permDeath; /** * Permanent death with corpses temporarily available. * @serial */ - private boolean ultraDeath = false; + private boolean ultraDeath; /** * Permanent death with instant character deletion. * @serial */ - private boolean ultimateDeath = false; + private boolean ultimateDeath; /** * Player vs Player combat allowed. * @serial */ - private boolean pvp = false; + private boolean pvp; /** * The tileset id. 0 means no available tileset id * @serial */ - private int tilesetId = 0; + private int tilesetId; /** * The tileset x coordinate. * @serial */ - private int tilesetX = 0; + private int tilesetX; /** * The tileset y coordinate. * @serial */ - private int tilesetY = 0; + private int tilesetY; /** * The name of the background music. Set to empty string if unset. Modified: trunk/gridarta.ipr =================================================================== --- trunk/gridarta.ipr 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/gridarta.ipr 2013-05-24 19:56:48 UTC (rev 9213) @@ -688,6 +688,7 @@ <option name="ignoreObjectConstruction" value="false" /> <option name="ignoreTypeCasts" value="false" /> </inspection_tool> + <inspection_tool class="RedundantFieldInitialization" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="RedundantImplements" enabled="true" level="WARNING" enabled_by_default="true"> <option name="ignoreSerializable" value="false" /> <option name="ignoreCloneable" value="false" /> Modified: trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -54,14 +54,14 @@ * objects. * @serial */ - private int multiX = 0; + private int multiX; /** * The y-distance of this part to the head part. Set to zero for single-part * objects. * @serial */ - private int multiY = 0; + private int multiY; /** * Set if this part of a multi-part object is the lowest part. The lowest @@ -75,20 +75,20 @@ * The multi shape id. * @serial */ - private int multiShapeID = 0; + private int multiShapeID; /** * The multi part id. * @serial */ - private int multiPartNr = 0; + private int multiPartNr; /** * The location in the archetype selector. * @serial */ @Nullable - private String editorFolder = null; + private String editorFolder; /** * If this flag is set, this Archetype is not a "real" Archetype but comes @@ -97,7 +97,7 @@ * for editor and server. * @serial */ - private boolean artifact = false; + private boolean artifact; /** * Creates a new instance. Modified: trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeBuilder.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeBuilder.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeBuilder.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -50,14 +50,14 @@ * The {@link ErrorViewCollector} for reporting errors. */ @Nullable - private ErrorViewCollector errorViewCollector = null; + private ErrorViewCollector errorViewCollector; /** * The {@link Archetype} being built. Set to <code>null</code> when not * building an archetype. */ @Nullable - private R archetype = null; + private R archetype; /** * Collected attributes. Modified: trunk/model/src/app/net/sf/gridarta/model/archetypechooser/ArchetypeChooserFolder.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypechooser/ArchetypeChooserFolder.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/model/src/app/net/sf/gridarta/model/archetypechooser/ArchetypeChooserFolder.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -61,7 +61,7 @@ * It must be part of {@link #archetypes}. */ @Nullable - private R selectedArchetype = null; + private R selectedArchetype; /** * The registered listeners. Modified: trunk/model/src/app/net/sf/gridarta/model/archetypechooser/ArchetypeChooserModel.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypechooser/ArchetypeChooserModel.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/model/src/app/net/sf/gridarta/model/archetypechooser/ArchetypeChooserModel.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -53,14 +53,14 @@ * #panels}. Set to <code>null</code> only if no panels do exist. */ @Nullable - private ArchetypeChooserPanel<G, A, R> selectedPanel = null; + private ArchetypeChooserPanel<G, A, R> selectedPanel; /** * The default direction for game objects created from archetypes. Set to * <code>null</code> for default direction. */ @Nullable - private Integer direction = null; + private Integer direction; /** * The registered listeners. Modified: trunk/model/src/app/net/sf/gridarta/model/archetypeset/DefaultArchetypeSet.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypeset/DefaultArchetypeSet.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/model/src/app/net/sf/gridarta/model/archetypeset/DefaultArchetypeSet.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -70,7 +70,7 @@ * @val <code>false</code> when Archetypes were loaded from individual * .arc-files */ - private boolean loadedFromArchive = false; + private boolean loadedFromArchive; /** * The archetypes used for game objects which reference undefined Modified: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -42,7 +42,7 @@ * matching any defined type. */ @Nullable - private ArchetypeType fallbackArchetypeType = null; + private ArchetypeType fallbackArchetypeType; /** * Lists with all {@link ArchetypeType ArchetypeTypes}. Contains all but the Modified: trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -68,7 +68,7 @@ * @serial */ @Nullable - private String faceObjName = null; + private String faceObjName; /** * The state where the face comes from. @@ -82,7 +82,7 @@ * @serial */ @Nullable - private ImageIcon normalFace = null; + private ImageIcon normalFace; /** * The {@link FaceObjectProviders} for looking up faces. @@ -106,19 +106,19 @@ * @serial */ @Nullable - private StringBuilder msgText = null; + private StringBuilder msgText; /** * The map x position if on map. * @serial */ - private int mapX = 0; + private int mapX; /** * The map y position if on map. * @serial */ - private int mapY = 0; + private int mapY; /** * Data for multi-part objects. Stays <code>null</code> for single-part @@ -126,7 +126,7 @@ * @serial */ @Nullable - private MultiArchData<G, A, R, T> multi = null; + private MultiArchData<G, A, R, T> multi; /** * Edit Type. @@ -146,20 +146,20 @@ * @serial */ @Nullable - private String faceName = null; + private String faceName; /** * The object type. * @serial */ - private int typeNo = 0; + private int typeNo; /** * The object's animation animation. * @serial */ @Nullable - private String animName = null; + private String animName; /** * The direction determines to which direction the GameObject's face is @@ -167,7 +167,7 @@ * animated objects might even have 8 or 9 (8 + still) facings. * @serial */ - private int direction = 0; + private int direction; /** * The map lore. Modified: trunk/model/src/app/net/sf/gridarta/model/baseobject/GameObjectContainer.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/baseobject/GameObjectContainer.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/model/src/app/net/sf/gridarta/model/baseobject/GameObjectContainer.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -123,7 +123,7 @@ /** Current element (last element returned by {@link #next()}). */ @Nullable - private G current = null; + private G current; @Override public boolean hasNext() { Modified: trunk/model/src/app/net/sf/gridarta/model/data/NamedTreeNode.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/data/NamedTreeNode.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/model/src/app/net/sf/gridarta/model/data/NamedTreeNode.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -58,7 +58,7 @@ * @serial */ @Nullable - private NamedTreeNode<?>[] childNodeArray = null; + private NamedTreeNode<?>[] childNodeArray; /** * The parent node, which may be <code>null</code> for the root node. Modified: trunk/model/src/app/net/sf/gridarta/model/exitconnector/AbstractExitConnectorModel.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/exitconnector/AbstractExitConnectorModel.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/model/src/app/net/sf/gridarta/model/exitconnector/AbstractExitConnectorModel.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -39,7 +39,7 @@ * location has been remembered. */ @Nullable - private ExitLocation exitLocation = null; + private ExitLocation exitLocation; /** * Whether the exit's name should be set when pasted. Modified: trunk/model/src/app/net/sf/gridarta/model/face/DoubleImageFilter.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/face/DoubleImageFilter.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/model/src/app/net/sf/gridarta/model/face/DoubleImageFilter.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -42,12 +42,12 @@ /** * The image width. */ - private int width = 0; + private int width; /** * The destination image's pixels. */ - private int[] raster = null; + private int[] raster; /** * Creates a new instance. Modified: trunk/model/src/app/net/sf/gridarta/model/face/FaceObjectProviders.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/face/FaceObjectProviders.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/model/src/app/net/sf/gridarta/model/face/FaceObjectProviders.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -130,7 +130,7 @@ * The face provider for normal faces. */ @Nullable - private FaceProvider normalFaceProvider = null; + private FaceProvider normalFaceProvider; /** * The face provider for alpha faces. Modified: trunk/model/src/app/net/sf/gridarta/model/face/FilterFaceProvider.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/face/FilterFaceProvider.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/model/src/app/net/sf/gridarta/model/face/FilterFaceProvider.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -37,7 +37,7 @@ * The FaceProvider to get the original icon from. */ @Nullable - private FaceProvider parent = null; + private FaceProvider parent; /** * The Filter to apply. Modified: trunk/model/src/app/net/sf/gridarta/model/filter/AbstractFilterConfig.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/filter/AbstractFilterConfig.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/model/src/app/net/sf/gridarta/model/filter/AbstractFilterConfig.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -40,7 +40,7 @@ /** * Whether the filter is enabled. */ - private boolean enabled = false; + private boolean enabled; /** * The registered listeners. Modified: trunk/model/src/app/net/sf/gridarta/model/filter/FilterParser.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/filter/FilterParser.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/model/src/app/net/sf/gridarta/model/filter/FilterParser.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -36,7 +36,7 @@ * The {@link Element} instance being converted. */ @Nullable - private Element element = null; + private Element element; /** * The {@link FilterConfigVisitor} for converting {@link FilterConfig} Modified: trunk/model/src/app/net/sf/gridarta/model/filter/NamedFilterConfig.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/filter/NamedFilterConfig.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/model/src/app/net/sf/gridarta/model/filter/NamedFilterConfig.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -39,7 +39,7 @@ * (<code>false></code>). */ // TODO fix potential concurrency issues - private boolean inverted = false; + private boolean inverted; @NotNull private final Map<String, FilterConfig<?, ?>> map = new HashMap<String, FilterConfig<?, ?>>(); Modified: trunk/model/src/app/net/sf/gridarta/model/gameobject/AbstractGameObject.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/gameobject/AbstractGameObject.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/model/src/app/net/sf/gridarta/model/gameobject/AbstractGameObject.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -58,7 +58,7 @@ * @serial */ @Nullable - private GameObjectContainer<G, A, R> container = null; + private GameObjectContainer<G, A, R> container; /** * Creates a new instance. Modified: trunk/model/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/model/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -110,21 +110,21 @@ * @serial */ @Nullable - private ImageIcon transFace = null; + private ImageIcon transFace; /** * The double face. * @serial */ @Nullable - private ImageIcon doubleFace = null; + private ImageIcon doubleFace; /** * The transparent double face. * @serial */ @Nullable - private ImageIcon transDoubleFace = null; + private ImageIcon transDoubleFace; /** * Creates a new instance. Modified: trunk/model/src/app/net/sf/gridarta/model/gameobject/MultiArchData.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/gameobject/MultiArchData.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/model/src/app/net/sf/gridarta/model/gameobject/MultiArchData.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -49,25 +49,25 @@ * The maximum coordinate of any part; it is never negative. * @serial */ - private int maxX = 0; + private int maxX; /** * The maximum coordinate of any part; it is never negative. * @serial */ - private int maxY = 0; + private int maxY; /** * The minimum coordinate of any part; it is never positive. * @serial */ - private int minX = 0; + private int minX; /** * The minimum coordinate of any part; it is never positive. * @serial */ - private int minY = 0; + private int minY; /** * The shape ID of this object. Modified: trunk/model/src/app/net/sf/gridarta/model/index/AbstractIndex.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/index/AbstractIndex.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/model/src/app/net/sf/gridarta/model/index/AbstractIndex.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -79,12 +79,12 @@ * Whether the state ({@link #timestamps} or {@link #names}) was modified * since last save. */ - private boolean modified = false; + private boolean modified; /** * Whether a transaction is active. */ - private boolean transaction = false; + private boolean transaction; /** * The values to delete at the end of the current transaction. Empty if no Modified: trunk/model/src/app/net/sf/gridarta/model/index/MapsIndexer.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/index/MapsIndexer.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/model/src/app/net/sf/gridarta/model/index/MapsIndexer.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -96,14 +96,14 @@ * The currently indexed maps directory. */ @Nullable - private File mapsDirectory = null; + private File mapsDirectory; /** * The maps directory to index. If <code>null</code>, {@link #mapsDirectory} * is valid. */ @Nullable - private File newMapsDirectory = null; + private File newMapsDirectory; /** * The object for synchronizing access to {@link #state}. Modified: trunk/model/src/app/net/sf/gridarta/model/io/FlatFileIterator.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/io/FlatFileIterator.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/model/src/app/net/sf/gridarta/model/io/FlatFileIterator.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -47,7 +47,7 @@ /** * The current index into {@link #files}. */ - private int pos = 0; + private int pos; /** * Creates a new instance. Modified: trunk/model/src/app/net/sf/gridarta/model/maparchobject/AbstractMapArchObject.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/maparchobject/AbstractMapArchObject.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/model/src/app/net/sf/gridarta/model/maparchobject/AbstractMapArchObject.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -85,44 +85,44 @@ /** * The x coordinate for entering the map. */ - private int enterX = 0; + private int enterX; /** * The y coordinate for entering the map. */ - private int enterY = 0; + private int enterY; /** * If set, this is an outdoor map. */ - private boolean outdoor = false; + private boolean outdoor; /** * The number of ticks that need to elapse before this map will be reset. */ - private int resetTimeout = 0; + private int resetTimeout; /** * The number of ticks that must elapse after tha map has not been used * before it gets swapped out. */ - private int swapTime = 0; + private int swapTime; /** * The map difficulty. If zero, server calculates something. */ - private int difficulty = 0; + private int difficulty; /** * If nonzero, the map reset time will not be updated when someone enters / * exits the map. */ - private boolean fixedReset = false; + private boolean fixedReset; /** * The light / darkness of map (overall). Zero means fully bright. */ - private int darkness = 0; + private int darkness; /** * The map tile paths used for map tiling. 0 = north, 1 = east, 2 = south, 3 @@ -143,19 +143,19 @@ * nesting level. * @invariant transactionDepth >= 0 */ - private int transactionDepth = 0; + private int transactionDepth; /** * The thread that performs the current transaction. * @invariant transactionDepth > 0 || transactionThread == null */ @Nullable - private transient Thread transactionThread = null; + private transient Thread transactionThread; /** * Set if any attribute has changed inside the current transaction. */ - private boolean attributeHasChanged = false; + private boolean attributeHasChanged; /** * Creates a new instance. Modified: trunk/model/src/app/net/sf/gridarta/model/mapgrid/MapGrid.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/mapgrid/MapGrid.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/model/src/app/net/sf/gridarta/model/mapgrid/MapGrid.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -76,14 +76,14 @@ /** * If set, {@link #cachedSelectedRec} is up-to-date. */ - private boolean cachedSelectedRecValid = false; + private boolean cachedSelectedRecValid; /** * The return value for {@link #getSelectedRec()}. Only valid if {@link * #cachedSelectedRecValid} is set. */ @Nullable - private Rectangle cachedSelectedRec = null; + private Rectangle cachedSelectedRec; /** * Selection - marks all selected squares. @@ -164,14 +164,14 @@ * nesting level. * @invariant transactionDepth >= 0 */ - private int transactionDepth = 0; + private int transactionDepth; /** * The thread that performs the current transaction. * @invariant transactionDepth > 0 || transactionThread == null */ @Nullable - private Thread transactionThread = null; + private Thread transactionThread; /** * Creates a new instance. Modified: trunk/model/src/app/net/sf/gridarta/model/mapmanager/AbstractMapManager.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/mapmanager/AbstractMapManager.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/model/src/app/net/sf/gridarta/model/mapmanager/AbstractMapManager.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -96,7 +96,7 @@ * The current top map we are working with. */ @Nullable - private MapControl<G, A, R> currentMapControl = null; + private MapControl<G, A, R> currentMapControl; /** * Create a new map manager. Modified: trunk/model/src/app/net/sf/gridarta/model/mapmodel/DefaultMapModel.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/mapmodel/DefaultMapModel.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/model/src/app/net/sf/gridarta/model/mapmodel/DefaultMapModel.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -117,14 +117,14 @@ * nesting level. * @invariant transactionDepth >= 0 */ - private int transactionDepth = 0; + private int transactionDepth; /** * The thread that performs the current transaction. * @invariant transactionDepth > 0 || transactionThread == null */ @Nullable - private transient Thread transactionThread = null; + private transient Thread transactionThread; /** * The ArrayList with changed squares. @@ -161,7 +161,7 @@ * Contains the edit types that have already been (requested and) calculated * (edit types get calculated only when needed to save time). */ - private int activeEditType = 0; + private int activeEditType; /** * The {@link GameObjectFactory} for creating {@link GameObject @@ -187,7 +187,7 @@ * been saved. */ @Nullable - private File mapFile = null; + private File mapFile; /** * Set if the map has changed since last save. Modified: trunk/model/src/app/net/sf/gridarta/model/match/ViewGameObjectMatcherManager.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/match/ViewGameObjectMatcherManager.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/model/src/app/net/sf/gridarta/model/match/ViewGameObjectMatcherManager.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -149,7 +149,7 @@ /** * Selected state. */ - private boolean selected = false; + private boolean selected; /** * A {@link MutableOrGameObjectMatcher} to add / remove {@link Modified: trunk/model/src/app/net/sf/gridarta/model/resource/AbstractResources.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/resource/AbstractResources.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/model/src/app/net/sf/gridarta/model/resource/AbstractResources.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -61,12 +61,12 @@ /** * Whether the resources have been loaded. */ - private boolean loaded = false; + private boolean loaded; /** * Whether the resources have been loaded from individual files. */ - private boolean loadedFromFiles = false; + private boolean loadedFromFiles; /** * Creates a new instance. Modified: trunk/model/src/app/net/sf/gridarta/model/settings/DefaultGlobalSettings.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/settings/DefaultGlobalSettings.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/model/src/app/net/sf/gridarta/model/settings/DefaultGlobalSettings.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -175,7 +175,7 @@ /** * Time for an automated documentation popup. */ - private boolean autoPopupDocumentation = false; + private boolean autoPopupDocumentation; /** * The the default directory for saving maps. Modified: trunk/model/src/app/net/sf/gridarta/model/undo/UndoModel.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/undo/UndoModel.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/model/src/app/net/sf/gridarta/model/undo/UndoModel.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -63,7 +63,7 @@ * 0</code>, "undo" is not possible; if <code>undoStackIndex == * undoStack.size()</code>, "redo" is not possible. */ - private int undoStackIndex = 0; + private int undoStackIndex; /** * The type for recording undo information. Modified: trunk/model/src/app/net/sf/gridarta/model/undo/UndoState.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/undo/UndoState.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/model/src/app/net/sf/gridarta/model/undo/UndoState.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -51,7 +51,7 @@ * operation started. */ @Nullable - private SavedSquares<G, A, R> savedSquares = null; + private SavedSquares<G, A, R> savedSquares; /** * Create a new instance. Modified: trunk/model/src/app/net/sf/gridarta/model/validation/checks/MapCheckerScriptChecker.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/validation/checks/MapCheckerScriptChecker.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/model/src/app/net/sf/gridarta/model/validation/checks/MapCheckerScriptChecker.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -107,7 +107,7 @@ * until created. */ @Nullable - private File tmpFile = null; + private File tmpFile; /** * Creates a new instance. @@ -408,7 +408,7 @@ * Otherwise points to <code>{@link #args}[0]</code>. */ @Nullable - private File cachedCommand = null; + private File cachedCommand; /** * Returns the command to execute. Returns or updates {@link Modified: trunk/model/src/test/net/sf/gridarta/model/archetype/TestDefaultArchetype.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/archetype/TestDefaultArchetype.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/model/src/test/net/sf/gridarta/model/archetype/TestDefaultArchetype.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -40,7 +40,7 @@ /** * The return value of {@link #usesDirection()}. */ - private boolean usesDirection = false; + private boolean usesDirection; /** * Creates a new instance. Modified: trunk/model/src/test/net/sf/gridarta/model/baseobject/AbstractBaseObjectTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/baseobject/AbstractBaseObjectTest.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/model/src/test/net/sf/gridarta/model/baseobject/AbstractBaseObjectTest.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -52,7 +52,7 @@ * The {@link SystemIcons} instance. */ @Nullable - private SystemIcons systemIcons = null; + private SystemIcons systemIcons; /** * Checks that setting the face name does work. Modified: trunk/model/src/test/net/sf/gridarta/model/errorview/TestErrorView.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/errorview/TestErrorView.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/model/src/test/net/sf/gridarta/model/errorview/TestErrorView.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -37,12 +37,12 @@ /** * Whether errors have been collected. */ - private boolean hasErrors = false; + private boolean hasErrors; /** * Whether warnings have been collected. */ - private boolean hasWarnings = false; + private boolean hasWarnings; /** * {@inheritDoc} Modified: trunk/model/src/test/net/sf/gridarta/model/io/ArchetypeParserTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/io/ArchetypeParserTest.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/model/src/test/net/sf/gridarta/model/io/ArchetypeParserTest.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -52,7 +52,7 @@ * The loaded archetypes. */ @Nullable - private ArchetypeSet<TestGameObject, TestMapArchObject, TestArchetype> archetypeSet = null; + private ArchetypeSet<TestGameObject, TestMapArchObject, TestArchetype> archetypeSet; /** * Checks that a missing "object" line is detected. Modified: trunk/model/src/test/net/sf/gridarta/model/mapcursor/MapCursorTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/mapcursor/MapCursorTest.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/model/src/test/net/sf/gridarta/model/mapcursor/MapCursorTest.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -483,12 +483,12 @@ /** * The number of calls to {@link #mapCursorChangedPos(Point)}. */ - private int changedPosCounter = 0; + private int changedPosCounter; /** * The number of calls to {@link #mapCursorChangedMode()}. */ - private int changedModeCounter = 0; + private int changedModeCounter; @Override public void mapCursorChangedPos(@Nullable final Point location) { Modified: trunk/model/src/test/net/sf/gridarta/model/match/NamedGameObjectMatcherTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/match/NamedGameObjectMatcherTest.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/model/src/test/net/sf/gridarta/model/match/NamedGameObjectMatcherTest.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -48,7 +48,7 @@ * The {@link SystemIcons} instance. */ @Nullable - private SystemIcons systemIcons = null; + private SystemIcons systemIcons; /** * Checks that a {@link NamedGameObjectMatcher} works correctly when not Modified: trunk/plugin/src/app/net/sf/gridarta/plugin/BshThread.java =================================================================== --- trunk/plugin/src/app/net/sf/gridarta/plugin/BshThread.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/plugin/src/app/net/sf/gridarta/plugin/BshThread.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -45,7 +45,7 @@ /** * Whether the plugin has been executed successfully. */ - private boolean success = false; + private boolean success; /** * Creates a new instance. Modified: trunk/plugin/src/app/net/sf/gridarta/plugin/Plugin.java =================================================================== --- trunk/plugin/src/app/net/sf/gridarta/plugin/Plugin.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/plugin/src/app/net/sf/gridarta/plugin/Plugin.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -93,17 +93,17 @@ /** * Whether this plugin is run whenever the editor starts. */ - private boolean autoBoot = false; + private boolean autoBoot; /** * Whether this plugin is a filter. */ - private boolean filter = false; + private boolean filter; /** * Whether this plugin is a stand-alone plugin. */ - private boolean script = false; + private boolean script; /** * The {@link ChangeListener ChangeListeners} to inform about changes. @@ -116,12 +116,12 @@ * plugin has no associated location. */ @Nullable - private File file = null; + private File file; /** * Whether the plugin contents has been modified since last save. */ - private boolean modified = false; + private boolean modified; /** * Creates a new instance. Modified: trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/ArchParameter.java =================================================================== --- trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/ArchParameter.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/ArchParameter.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -44,7 +44,7 @@ @NotNull private final ArchetypeSet<G, A, R> archetypeSet; - private String valueString = null; + private String valueString; /** * Creates a new instance. Modified: trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/DoubleParameter.java =================================================================== --- trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/DoubleParameter.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/DoubleParameter.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -38,7 +38,7 @@ /** * The minimal allowed value. */ - private double min = 0.0; + private double min; /** * The maximal allowed value. We do not use the {@link Double#MAX_VALUE} or Modified: trunk/preferences/src/app/net/sf/gridarta/preferences/FilePreferencesFactory.java =================================================================== --- trunk/preferences/src/app/net/sf/gridarta/preferences/FilePreferencesFactory.java 2013-05-24 19:37:16 UTC (rev 9212) +++ trunk/preferences/src/app/net/sf/gridarta/preferences/FilePreferencesFactory.java 2013-05-24 19:56:48 UTC (rev 9213) @@ -35,12 +35,12 @@ /** * The user preferences as returned by {@link #userRoot()}. */ - private static Preferences userRoot = null; + private static Preferences userRoot; /** * The system preferences as returned by {@link #userRoot()}. */ - private static Preferences systemRoot = null; + private static Preferences systemRoot; /** * Initialize the module. This function must be called before an instance is Modified: trunk/src/app/net/sf/gridarta/commands/Collector.java =================================================================== --- trunk/src/app/net... [truncated message content] |
From: <aki...@us...> - 2013-05-24 19:37:21
|
Revision: 9212 http://sourceforge.net/p/gridarta/code/9212 Author: akirschbaum Date: 2013-05-24 19:37:16 +0000 (Fri, 24 May 2013) Log Message: ----------- Remove ArchetypeTypeSet.defaultArchetypeType as this field belongs to the parser, not the model. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java trunk/model/src/test/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParserTest.java Modified: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java 2013-05-24 09:24:13 UTC (rev 9211) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java 2013-05-24 19:37:16 UTC (rev 9212) @@ -38,12 +38,6 @@ public class ArchetypeTypeSet implements Iterable<ArchetypeType> { /** - * The default {@link ArchetypeType}. - */ - @Nullable - private ArchetypeType defaultArchetypeType = null; - - /** * The default (fallback) {@link ArchetypeType} used for game objects not * matching any defined type. */ @@ -161,23 +155,6 @@ } /** - * Returns the default archetype type. - * @return the default archetype type - */ - @Nullable - public ArchetypeType getDefaultArchetypeType() { - return defaultArchetypeType; - } - - /** - * Sets the default archetype type. - * @param defaultArchetypeType the default archetype type - */ - public void setDefaultArchetypeType(@Nullable final ArchetypeType defaultArchetypeType) { - this.defaultArchetypeType = defaultArchetypeType; - } - - /** * Finds and returns the type-structure (<code>ArchetypeType</code>) that * matches the given 'typeName'. These type-names are "artificial" names, * defined in "types.xml". They appear in the type selection box in the @@ -289,9 +266,6 @@ @Override public String toString() { final StringBuilder sb = new StringBuilder(); - if (defaultArchetypeType != null) { - format(sb, defaultArchetypeType, "default_type"); - } final Map<String, ArchetypeType> sortedArchetypeTypes = new TreeMap<String, ArchetypeType>(archetypeTypeNames); for (final ArchetypeType archetypeType : sortedArchetypeTypes.values()) { format(sb, archetypeType, "type"); Modified: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java 2013-05-24 09:24:13 UTC (rev 9211) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java 2013-05-24 19:37:16 UTC (rev 9212) @@ -247,6 +247,12 @@ private final ArchetypeTypeParser archetypeTypeParser; /** + * The default {@link ArchetypeType}. + */ + @Nullable + private ArchetypeType defaultArchetypeType; + + /** * Creates a new instance. * @param documentBuilder the document builder to use * @param archetypeTypeSet the archetype type set to update @@ -537,8 +543,7 @@ * @param ignorelistsDefinition the contents of the "ignorelists" section */ private void parseDefaultType(@NotNull final Element defaultTypeElement, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final IgnorelistsDefinition ignorelistsDefinition) { - final ArchetypeType defaultType = archetypeTypeParser.loadAttributeList(defaultTypeElement, errorViewCollector, null, archetypeTypeSet, ignorelistsDefinition, true); - archetypeTypeSet.setDefaultArchetypeType(defaultType); + defaultArchetypeType = archetypeTypeParser.loadAttributeList(defaultTypeElement, errorViewCollector, null, archetypeTypeSet, ignorelistsDefinition, true); } /** @@ -549,7 +554,7 @@ */ private void parseTypes(@NotNull final Element typeElement, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final IgnorelistsDefinition ignorelistsDefinition) { if (!typeElement.getAttribute(XML_TYPE_AVAILABLE).equals("no")) { - archetypeTypeSet.add(archetypeTypeParser.loadAttributeList(typeElement, errorViewCollector, archetypeTypeSet.getDefaultArchetypeType(), archetypeTypeSet, ignorelistsDefinition, false)); + archetypeTypeSet.add(archetypeTypeParser.loadAttributeList(typeElement, errorViewCollector, defaultArchetypeType, archetypeTypeSet, ignorelistsDefinition, false)); } } Modified: trunk/model/src/test/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParserTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParserTest.java 2013-05-24 09:24:13 UTC (rev 9211) +++ trunk/model/src/test/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParserTest.java 2013-05-24 19:37:16 UTC (rev 9212) @@ -67,11 +67,6 @@ typesXml.append("<attribute arch=\"f\" value=\"v\" type=\"fixed\"/>\n"); typesXml.append("</type>\n"); final StringBuilder expectedResult = new StringBuilder(); - expectedResult.append("default_type:-1,default\n"); - expectedResult.append(":\n"); - expectedResult.append(":\n"); - expectedResult.append("string/name[name_editor] section=0/General\n"); - expectedResult.append("\n"); expectedResult.append("type:123,name 123\n"); expectedResult.append(":\n"); expectedResult.append(":\n"); @@ -109,12 +104,6 @@ typesXml.append("<attribute arch=\"default_attr2\" editor=\"name2\" type=\"string\">description</attribute>\n"); typesXml.append("</type>\n"); final StringBuilder expectedResult = new StringBuilder(); - expectedResult.append("default_type:-1,default\n"); - expectedResult.append(":\n"); - expectedResult.append(":\n"); - expectedResult.append("string/default_attr1[default] section=0/General\n"); - expectedResult.append("string/default_attr2[default] section=0/General\n"); - expectedResult.append("\n"); expectedResult.append("type:1,name1\n"); expectedResult.append(":\n"); expectedResult.append(":\n"); @@ -195,21 +184,6 @@ typesXml.append("<attribute arch=\"attrF\" editor=\"name3\" type=\"string\">description</attribute>\n"); typesXml.append("</type>\n"); final StringBuilder expectedResult = new StringBuilder(); - expectedResult.append("default_type:-1,default\n"); - expectedResult.append(":\n"); - expectedResult.append(":\n"); - /* attributes */ - expectedResult.append("string/attr1[default] section=0/General\n"); - expectedResult.append("string/attr3[default] section=0/General\n"); - expectedResult.append("string/attr5[default] section=0/General\n"); - expectedResult.append("string/attr7[default] section=0/General\n"); - expectedResult.append("string/attr9[default] section=0/General\n"); - expectedResult.append("string/attrB[default] section=0/General\n"); - expectedResult.append("string/attrD[default] section=0/General\n"); - expectedResult.append("string/attrF[default] section=0/General\n"); - /* defaults */ - /* imports */ - expectedResult.append("\n"); expectedResult.append("type:1,name1\n"); expectedResult.append(":\n"); expectedResult.append(":\n"); @@ -295,12 +269,6 @@ typesXml.append("<description>description1</description>\n"); typesXml.append("</type>\n"); final StringBuilder expectedResult = new StringBuilder(); - expectedResult.append("default_type:-1,default\n"); - expectedResult.append(":\n"); - expectedResult.append(":\n"); - expectedResult.append("string/default_attr1[default] section=0/General\n"); - expectedResult.append("string/default_attr2[default] section=0/General\n"); - expectedResult.append("\n"); expectedResult.append("type:1,name1\n"); expectedResult.append(":\n"); expectedResult.append(":\n"); @@ -339,11 +307,6 @@ typesXml.append("<description>description2</description>\n"); typesXml.append("</type>\n"); final StringBuilder expectedResult = new StringBuilder(); - expectedResult.append("default_type:-1,default\n"); - expectedResult.append(":\n"); - expectedResult.append(":\n"); - expectedResult.append("string/default_attr1[default] section=0/General\n"); - expectedResult.append("\n"); expectedResult.append("type:1,name1\n"); expectedResult.append(":\n"); expectedResult.append(":\n"); @@ -385,10 +348,6 @@ typesXml.append("<attribute arch=\"name1_attr2\" editor=\"name1\" type=\"string\">description</attribute>\n"); typesXml.append("</type>\n"); final StringBuilder expectedResult = new StringBuilder(); - expectedResult.append("default_type:-1,default\n"); - expectedResult.append(":\n"); - expectedResult.append(":\n"); - expectedResult.append("\n"); expectedResult.append("type:1,name1\n"); expectedResult.append(":\n"); expectedResult.append(":\n"); @@ -419,11 +378,6 @@ typesXml.append("<description>description</description>\n"); typesXml.append("</type>\n"); final StringBuilder expectedResult = new StringBuilder(); - expectedResult.append("default_type:-1,default\n"); - expectedResult.append(":\n"); - expectedResult.append(":\n"); - expectedResult.append("text/msg[default] section=2/default\n"); - expectedResult.append("\n"); expectedResult.append("type:1,name1\n"); expectedResult.append(":\n"); expectedResult.append(":\n"); @@ -454,11 +408,6 @@ typesXml.append("<attribute arch_begin=\"msg\" arch_end=\"endmsg\" editor=\"name1\" type=\"text\">msg2</attribute>\n"); typesXml.append("</type>\n"); final StringBuilder expectedResult = new StringBuilder(); - expectedResult.append("default_type:-1,default\n"); - expectedResult.append(":\n"); - expectedResult.append(":\n"); - expectedResult.append("text/msg[default] section=2/default\n"); - expectedResult.append("\n"); expectedResult.append("type:1,name1\n"); expectedResult.append(":\n"); expectedResult.append(":\n"); @@ -491,11 +440,6 @@ typesXml.append("<description>description</description>\n"); typesXml.append("</type>\n"); final StringBuilder expectedResult = new StringBuilder(); - expectedResult.append("default_type:-1,default\n"); - expectedResult.append(":\n"); - expectedResult.append(":\n"); - expectedResult.append("text/msg[default] section=2/default\n"); - expectedResult.append("\n"); expectedResult.append("type:1,name1\n"); expectedResult.append(":\n"); expectedResult.append(":\n"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2013-05-24 09:24:16
|
Revision: 9211 http://sourceforge.net/p/gridarta/code/9211 Author: akirschbaum Date: 2013-05-24 09:24:13 +0000 (Fri, 24 May 2013) Log Message: ----------- Weaken type. Modified Paths: -------------- trunk/plugin/src/app/net/sf/gridarta/plugin/Plugin.java Modified: trunk/plugin/src/app/net/sf/gridarta/plugin/Plugin.java =================================================================== --- trunk/plugin/src/app/net/sf/gridarta/plugin/Plugin.java 2013-05-23 21:08:39 UTC (rev 9210) +++ trunk/plugin/src/app/net/sf/gridarta/plugin/Plugin.java 2013-05-24 09:24:13 UTC (rev 9211) @@ -41,6 +41,7 @@ import net.sf.gridarta.plugin.parameter.StringParameter; import org.apache.log4j.Category; import org.apache.log4j.Logger; +import org.jdom.Content; import org.jdom.Element; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -468,7 +469,7 @@ * @return the plugin parameter in XML representation */ @NotNull - public Element toXML(@NotNull final PluginParameter<G, A, R> pluginParameter) { + public Content toXML(@NotNull final PluginParameter<G, A, R> pluginParameter) { return codec.toXML(pluginParameter); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |