1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/samples/componentinjection/anagram-plain/build.xml Sat Jun 14 10:06:39 2008 +0200
1.3 @@ -0,0 +1,69 @@
1.4 +<?xml version="1.0" encoding="UTF-8"?>
1.5 +<!-- You may freely edit this file. See commented blocks below for -->
1.6 +<!-- some examples of how to customize the build. -->
1.7 +<!-- (If you delete it and reopen the project it will be recreated.) -->
1.8 +<project name="anagram-plain" default="default" basedir=".">
1.9 + <description>Builds, tests, and runs the project anagram-plain.</description>
1.10 + <import file="nbproject/build-impl.xml"/>
1.11 + <!--
1.12 +
1.13 + There exist several targets which are by default empty and which can be
1.14 + used for execution of your tasks. These targets are usually executed
1.15 + before and after some main targets. They are:
1.16 +
1.17 + -pre-init: called before initialization of project properties
1.18 + -post-init: called after initialization of project properties
1.19 + -pre-compile: called before javac compilation
1.20 + -post-compile: called after javac compilation
1.21 + -pre-compile-single: called before javac compilation of single file
1.22 + -post-compile-single: called after javac compilation of single file
1.23 + -pre-compile-test: called before javac compilation of JUnit tests
1.24 + -post-compile-test: called after javac compilation of JUnit tests
1.25 + -pre-compile-test-single: called before javac compilation of single JUnit test
1.26 + -post-compile-test-single: called after javac compilation of single JUunit test
1.27 + -pre-jar: called before JAR building
1.28 + -post-jar: called after JAR building
1.29 + -post-clean: called after cleaning build products
1.30 +
1.31 + (Targets beginning with '-' are not intended to be called on their own.)
1.32 +
1.33 + Example of inserting an obfuscator after compilation could look like this:
1.34 +
1.35 + <target name="-post-compile">
1.36 + <obfuscate>
1.37 + <fileset dir="${build.classes.dir}"/>
1.38 + </obfuscate>
1.39 + </target>
1.40 +
1.41 + For list of available properties check the imported
1.42 + nbproject/build-impl.xml file.
1.43 +
1.44 +
1.45 + Another way to customize the build is by overriding existing main targets.
1.46 + The targets of interest are:
1.47 +
1.48 + -init-macrodef-javac: defines macro for javac compilation
1.49 + -init-macrodef-junit: defines macro for junit execution
1.50 + -init-macrodef-debug: defines macro for class debugging
1.51 + -init-macrodef-java: defines macro for class execution
1.52 + -do-jar-with-manifest: JAR building (if you are using a manifest)
1.53 + -do-jar-without-manifest: JAR building (if you are not using a manifest)
1.54 + run: execution of project
1.55 + -javadoc-build: Javadoc generation
1.56 + test-report: JUnit report generation
1.57 +
1.58 + An example of overriding the target for project execution could look like this:
1.59 +
1.60 + <target name="run" depends="anagram-plain-impl.jar">
1.61 + <exec dir="bin" executable="launcher.exe">
1.62 + <arg file="${dist.jar}"/>
1.63 + </exec>
1.64 + </target>
1.65 +
1.66 + Notice that the overridden target depends on the jar target and not only on
1.67 + the compile target as the regular run target does. Again, for a list of available
1.68 + properties which you can use, check the target you are overriding in the
1.69 + nbproject/build-impl.xml file.
1.70 +
1.71 + -->
1.72 +</project>
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2 +++ b/samples/componentinjection/anagram-plain/manifest.mf Sat Jun 14 10:06:39 2008 +0200
2.3 @@ -0,0 +1,3 @@
2.4 +Manifest-Version: 1.0
2.5 +X-COMMENT: Main-Class will be added automatically by build
2.6 +
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
3.2 +++ b/samples/componentinjection/anagram-plain/nbproject/build-impl.xml Sat Jun 14 10:06:39 2008 +0200
3.3 @@ -0,0 +1,627 @@
3.4 +<?xml version="1.0" encoding="UTF-8"?>
3.5 +<!--
3.6 +*** GENERATED FROM project.xml - DO NOT EDIT ***
3.7 +*** EDIT ../build.xml INSTEAD ***
3.8 +
3.9 +For the purpose of easier reading the script
3.10 +is divided into following sections:
3.11 +
3.12 + - initialization
3.13 + - compilation
3.14 + - jar
3.15 + - execution
3.16 + - debugging
3.17 + - javadoc
3.18 + - junit compilation
3.19 + - junit execution
3.20 + - junit debugging
3.21 + - applet
3.22 + - cleanup
3.23 +
3.24 + -->
3.25 +<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject2="http://www.netbeans.org/ns/j2se-project/2" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="anagram-plain-impl">
3.26 + <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
3.27 + <!--
3.28 + ======================
3.29 + INITIALIZATION SECTION
3.30 + ======================
3.31 + -->
3.32 + <target name="-pre-init">
3.33 + <!-- Empty placeholder for easier customization. -->
3.34 + <!-- You can override this target in the ../build.xml file. -->
3.35 + </target>
3.36 + <target depends="-pre-init" name="-init-private">
3.37 + <property file="nbproject/private/config.properties"/>
3.38 + <property file="nbproject/private/configs/${config}.properties"/>
3.39 + <property file="nbproject/private/private.properties"/>
3.40 + </target>
3.41 + <target depends="-pre-init,-init-private" name="-init-user">
3.42 + <property file="${user.properties.file}"/>
3.43 + <!-- The two properties below are usually overridden -->
3.44 + <!-- by the active platform. Just a fallback. -->
3.45 + <property name="default.javac.source" value="1.4"/>
3.46 + <property name="default.javac.target" value="1.4"/>
3.47 + </target>
3.48 + <target depends="-pre-init,-init-private,-init-user" name="-init-project">
3.49 + <property file="nbproject/configs/${config}.properties"/>
3.50 + <property file="nbproject/project.properties"/>
3.51 + </target>
3.52 + <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
3.53 + <available file="${manifest.file}" property="manifest.available"/>
3.54 + <condition property="manifest.available+main.class">
3.55 + <and>
3.56 + <isset property="manifest.available"/>
3.57 + <isset property="main.class"/>
3.58 + <not>
3.59 + <equals arg1="${main.class}" arg2="" trim="true"/>
3.60 + </not>
3.61 + </and>
3.62 + </condition>
3.63 + <condition property="manifest.available+main.class+mkdist.available">
3.64 + <and>
3.65 + <istrue value="${manifest.available+main.class}"/>
3.66 + <isset property="libs.CopyLibs.classpath"/>
3.67 + </and>
3.68 + </condition>
3.69 + <condition property="have.tests">
3.70 + <or>
3.71 + <available file="${test.src.dir}"/>
3.72 + </or>
3.73 + </condition>
3.74 + <condition property="have.sources">
3.75 + <or>
3.76 + <available file="${src.dir}"/>
3.77 + </or>
3.78 + </condition>
3.79 + <condition property="netbeans.home+have.tests">
3.80 + <and>
3.81 + <isset property="netbeans.home"/>
3.82 + <isset property="have.tests"/>
3.83 + </and>
3.84 + </condition>
3.85 + <condition property="no.javadoc.preview">
3.86 + <and>
3.87 + <isset property="javadoc.preview"/>
3.88 + <isfalse value="${javadoc.preview}"/>
3.89 + </and>
3.90 + </condition>
3.91 + <property name="run.jvmargs" value=""/>
3.92 + <property name="javac.compilerargs" value=""/>
3.93 + <property name="work.dir" value="${basedir}"/>
3.94 + <condition property="no.deps">
3.95 + <and>
3.96 + <istrue value="${no.dependencies}"/>
3.97 + </and>
3.98 + </condition>
3.99 + <property name="javac.debug" value="true"/>
3.100 + <property name="javadoc.preview" value="true"/>
3.101 + <property name="application.args" value=""/>
3.102 + <property name="source.encoding" value="${file.encoding}"/>
3.103 + <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
3.104 + <and>
3.105 + <isset property="javadoc.encoding"/>
3.106 + <not>
3.107 + <equals arg1="${javadoc.encoding}" arg2=""/>
3.108 + </not>
3.109 + </and>
3.110 + </condition>
3.111 + <property name="javadoc.encoding.used" value="${source.encoding}"/>
3.112 + <property name="includes" value="**"/>
3.113 + <property name="excludes" value=""/>
3.114 + <property name="do.depend" value="false"/>
3.115 + <condition property="do.depend.true">
3.116 + <istrue value="${do.depend}"/>
3.117 + </condition>
3.118 + <condition else="" property="javac.compilerargs.jaxws" value="-Djava.endorsed.dirs='${jaxws.endorsed.dir}'">
3.119 + <and>
3.120 + <isset property="jaxws.endorsed.dir"/>
3.121 + <available file="nbproject/jaxws-build.xml"/>
3.122 + </and>
3.123 + </condition>
3.124 + </target>
3.125 + <target name="-post-init">
3.126 + <!-- Empty placeholder for easier customization. -->
3.127 + <!-- You can override this target in the ../build.xml file. -->
3.128 + </target>
3.129 + <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check">
3.130 + <fail unless="src.dir">Must set src.dir</fail>
3.131 + <fail unless="test.src.dir">Must set test.src.dir</fail>
3.132 + <fail unless="build.dir">Must set build.dir</fail>
3.133 + <fail unless="dist.dir">Must set dist.dir</fail>
3.134 + <fail unless="build.classes.dir">Must set build.classes.dir</fail>
3.135 + <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
3.136 + <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
3.137 + <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
3.138 + <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
3.139 + <fail unless="dist.jar">Must set dist.jar</fail>
3.140 + </target>
3.141 + <target name="-init-macrodef-property">
3.142 + <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
3.143 + <attribute name="name"/>
3.144 + <attribute name="value"/>
3.145 + <sequential>
3.146 + <property name="@{name}" value="${@{value}}"/>
3.147 + </sequential>
3.148 + </macrodef>
3.149 + </target>
3.150 + <target name="-init-macrodef-javac">
3.151 + <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
3.152 + <attribute default="${src.dir}" name="srcdir"/>
3.153 + <attribute default="${build.classes.dir}" name="destdir"/>
3.154 + <attribute default="${javac.classpath}" name="classpath"/>
3.155 + <attribute default="${includes}" name="includes"/>
3.156 + <attribute default="${excludes}" name="excludes"/>
3.157 + <attribute default="${javac.debug}" name="debug"/>
3.158 + <attribute default="" name="sourcepath"/>
3.159 + <element name="customize" optional="true"/>
3.160 + <sequential>
3.161 + <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}">
3.162 + <classpath>
3.163 + <path path="@{classpath}"/>
3.164 + </classpath>
3.165 + <compilerarg line="${javac.compilerargs} ${javac.compilerargs.jaxws}"/>
3.166 + <customize/>
3.167 + </javac>
3.168 + </sequential>
3.169 + </macrodef>
3.170 + <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
3.171 + <attribute default="${src.dir}" name="srcdir"/>
3.172 + <attribute default="${build.classes.dir}" name="destdir"/>
3.173 + <attribute default="${javac.classpath}" name="classpath"/>
3.174 + <sequential>
3.175 + <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
3.176 + <classpath>
3.177 + <path path="@{classpath}"/>
3.178 + </classpath>
3.179 + </depend>
3.180 + </sequential>
3.181 + </macrodef>
3.182 + <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
3.183 + <attribute default="${build.classes.dir}" name="destdir"/>
3.184 + <sequential>
3.185 + <fail unless="javac.includes">Must set javac.includes</fail>
3.186 + <pathconvert pathsep="," property="javac.includes.binary">
3.187 + <path>
3.188 + <filelist dir="@{destdir}" files="${javac.includes}"/>
3.189 + </path>
3.190 + <globmapper from="*.java" to="*.class"/>
3.191 + </pathconvert>
3.192 + <delete>
3.193 + <files includes="${javac.includes.binary}"/>
3.194 + </delete>
3.195 + </sequential>
3.196 + </macrodef>
3.197 + </target>
3.198 + <target name="-init-macrodef-junit">
3.199 + <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
3.200 + <attribute default="${includes}" name="includes"/>
3.201 + <attribute default="${excludes}" name="excludes"/>
3.202 + <attribute default="**" name="testincludes"/>
3.203 + <sequential>
3.204 + <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true">
3.205 + <batchtest todir="${build.test.results.dir}">
3.206 + <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
3.207 + <filename name="@{testincludes}"/>
3.208 + </fileset>
3.209 + </batchtest>
3.210 + <classpath>
3.211 + <path path="${run.test.classpath}"/>
3.212 + </classpath>
3.213 + <syspropertyset>
3.214 + <propertyref prefix="test-sys-prop."/>
3.215 + <mapper from="test-sys-prop.*" to="*" type="glob"/>
3.216 + </syspropertyset>
3.217 + <formatter type="brief" usefile="false"/>
3.218 + <formatter type="xml"/>
3.219 + <jvmarg line="${run.jvmargs}"/>
3.220 + </junit>
3.221 + </sequential>
3.222 + </macrodef>
3.223 + </target>
3.224 + <target name="-init-macrodef-nbjpda">
3.225 + <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
3.226 + <attribute default="${main.class}" name="name"/>
3.227 + <attribute default="${debug.classpath}" name="classpath"/>
3.228 + <attribute default="" name="stopclassname"/>
3.229 + <sequential>
3.230 + <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="dt_socket">
3.231 + <classpath>
3.232 + <path path="@{classpath}"/>
3.233 + </classpath>
3.234 + </nbjpdastart>
3.235 + </sequential>
3.236 + </macrodef>
3.237 + <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
3.238 + <attribute default="${build.classes.dir}" name="dir"/>
3.239 + <sequential>
3.240 + <nbjpdareload>
3.241 + <fileset dir="@{dir}" includes="${fix.includes}*.class"/>
3.242 + </nbjpdareload>
3.243 + </sequential>
3.244 + </macrodef>
3.245 + </target>
3.246 + <target name="-init-debug-args">
3.247 + <property name="version-output" value="java version "${ant.java.version}"/>
3.248 + <condition property="have-jdk-older-than-1.4">
3.249 + <or>
3.250 + <contains string="${version-output}" substring="java version "1.0"/>
3.251 + <contains string="${version-output}" substring="java version "1.1"/>
3.252 + <contains string="${version-output}" substring="java version "1.2"/>
3.253 + <contains string="${version-output}" substring="java version "1.3"/>
3.254 + </or>
3.255 + </condition>
3.256 + <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
3.257 + <istrue value="${have-jdk-older-than-1.4}"/>
3.258 + </condition>
3.259 + </target>
3.260 + <target depends="-init-debug-args" name="-init-macrodef-debug">
3.261 + <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
3.262 + <attribute default="${main.class}" name="classname"/>
3.263 + <attribute default="${debug.classpath}" name="classpath"/>
3.264 + <element name="customize" optional="true"/>
3.265 + <sequential>
3.266 + <java classname="@{classname}" dir="${work.dir}" fork="true">
3.267 + <jvmarg line="${debug-args-line}"/>
3.268 + <jvmarg value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
3.269 + <jvmarg line="${run.jvmargs}"/>
3.270 + <classpath>
3.271 + <path path="@{classpath}"/>
3.272 + </classpath>
3.273 + <syspropertyset>
3.274 + <propertyref prefix="run-sys-prop."/>
3.275 + <mapper from="run-sys-prop.*" to="*" type="glob"/>
3.276 + </syspropertyset>
3.277 + <customize/>
3.278 + </java>
3.279 + </sequential>
3.280 + </macrodef>
3.281 + </target>
3.282 + <target name="-init-macrodef-java">
3.283 + <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
3.284 + <attribute default="${main.class}" name="classname"/>
3.285 + <element name="customize" optional="true"/>
3.286 + <sequential>
3.287 + <java classname="@{classname}" dir="${work.dir}" fork="true">
3.288 + <jvmarg line="${run.jvmargs}"/>
3.289 + <classpath>
3.290 + <path path="${run.classpath}"/>
3.291 + </classpath>
3.292 + <syspropertyset>
3.293 + <propertyref prefix="run-sys-prop."/>
3.294 + <mapper from="run-sys-prop.*" to="*" type="glob"/>
3.295 + </syspropertyset>
3.296 + <customize/>
3.297 + </java>
3.298 + </sequential>
3.299 + </macrodef>
3.300 + </target>
3.301 + <target name="-init-presetdef-jar">
3.302 + <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
3.303 + <jar compress="${jar.compress}" jarfile="${dist.jar}">
3.304 + <j2seproject1:fileset dir="${build.classes.dir}"/>
3.305 + </jar>
3.306 + </presetdef>
3.307 + </target>
3.308 + <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar" name="init"/>
3.309 + <!--
3.310 + ===================
3.311 + COMPILATION SECTION
3.312 + ===================
3.313 + -->
3.314 + <target depends="init" name="deps-jar" unless="no.deps"/>
3.315 + <target depends="init,deps-jar" name="-pre-pre-compile">
3.316 + <mkdir dir="${build.classes.dir}"/>
3.317 + </target>
3.318 + <target name="-pre-compile">
3.319 + <!-- Empty placeholder for easier customization. -->
3.320 + <!-- You can override this target in the ../build.xml file. -->
3.321 + </target>
3.322 + <target if="do.depend.true" name="-compile-depend">
3.323 + <j2seproject3:depend/>
3.324 + </target>
3.325 + <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-compile-depend" if="have.sources" name="-do-compile">
3.326 + <j2seproject3:javac/>
3.327 + <copy todir="${build.classes.dir}">
3.328 + <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
3.329 + </copy>
3.330 + </target>
3.331 + <target name="-post-compile">
3.332 + <!-- Empty placeholder for easier customization. -->
3.333 + <!-- You can override this target in the ../build.xml file. -->
3.334 + </target>
3.335 + <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
3.336 + <target name="-pre-compile-single">
3.337 + <!-- Empty placeholder for easier customization. -->
3.338 + <!-- You can override this target in the ../build.xml file. -->
3.339 + </target>
3.340 + <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
3.341 + <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
3.342 + <j2seproject3:force-recompile/>
3.343 + <j2seproject3:javac excludes="" includes="${javac.includes}" sourcepath="${src.dir}"/>
3.344 + </target>
3.345 + <target name="-post-compile-single">
3.346 + <!-- Empty placeholder for easier customization. -->
3.347 + <!-- You can override this target in the ../build.xml file. -->
3.348 + </target>
3.349 + <target depends="init,deps-jar,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
3.350 + <!--
3.351 + ====================
3.352 + JAR BUILDING SECTION
3.353 + ====================
3.354 + -->
3.355 + <target depends="init" name="-pre-pre-jar">
3.356 + <dirname file="${dist.jar}" property="dist.jar.dir"/>
3.357 + <mkdir dir="${dist.jar.dir}"/>
3.358 + </target>
3.359 + <target name="-pre-jar">
3.360 + <!-- Empty placeholder for easier customization. -->
3.361 + <!-- You can override this target in the ../build.xml file. -->
3.362 + </target>
3.363 + <target depends="init,compile,-pre-pre-jar,-pre-jar" name="-do-jar-without-manifest" unless="manifest.available">
3.364 + <j2seproject1:jar/>
3.365 + </target>
3.366 + <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class">
3.367 + <j2seproject1:jar manifest="${manifest.file}"/>
3.368 + </target>
3.369 + <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available">
3.370 + <j2seproject1:jar manifest="${manifest.file}">
3.371 + <j2seproject1:manifest>
3.372 + <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
3.373 + </j2seproject1:manifest>
3.374 + </j2seproject1:jar>
3.375 + <echo>To run this application from the command line without Ant, try:</echo>
3.376 + <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
3.377 + <property location="${dist.jar}" name="dist.jar.resolved"/>
3.378 + <pathconvert property="run.classpath.with.dist.jar">
3.379 + <path path="${run.classpath}"/>
3.380 + <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
3.381 + </pathconvert>
3.382 + <echo>java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
3.383 + </target>
3.384 + <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class+mkdist.available" name="-do-jar-with-libraries">
3.385 + <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
3.386 + <pathconvert property="run.classpath.without.build.classes.dir">
3.387 + <path path="${run.classpath}"/>
3.388 + <map from="${build.classes.dir.resolved}" to=""/>
3.389 + </pathconvert>
3.390 + <pathconvert pathsep=" " property="jar.classpath">
3.391 + <path path="${run.classpath.without.build.classes.dir}"/>
3.392 + <chainedmapper>
3.393 + <flattenmapper/>
3.394 + <globmapper from="*" to="lib/*"/>
3.395 + </chainedmapper>
3.396 + </pathconvert>
3.397 + <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
3.398 + <copylibs compress="${jar.compress}" jarfile="${dist.jar}" manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
3.399 + <fileset dir="${build.classes.dir}"/>
3.400 + <manifest>
3.401 + <attribute name="Main-Class" value="${main.class}"/>
3.402 + <attribute name="Class-Path" value="${jar.classpath}"/>
3.403 + </manifest>
3.404 + </copylibs>
3.405 + <echo>To run this application from the command line without Ant, try:</echo>
3.406 + <property location="${dist.jar}" name="dist.jar.resolved"/>
3.407 + <echo>java -jar "${dist.jar.resolved}"</echo>
3.408 + </target>
3.409 + <target name="-post-jar">
3.410 + <!-- Empty placeholder for easier customization. -->
3.411 + <!-- You can override this target in the ../build.xml file. -->
3.412 + </target>
3.413 + <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar" description="Build JAR." name="jar"/>
3.414 + <!--
3.415 + =================
3.416 + EXECUTION SECTION
3.417 + =================
3.418 + -->
3.419 + <target depends="init,compile" description="Run a main class." name="run">
3.420 + <j2seproject1:java>
3.421 + <customize>
3.422 + <arg line="${application.args}"/>
3.423 + </customize>
3.424 + </j2seproject1:java>
3.425 + </target>
3.426 + <target name="-do-not-recompile">
3.427 + <property name="javac.includes.binary" value=""/>
3.428 + </target>
3.429 + <target depends="init,-do-not-recompile,compile-single" name="run-single">
3.430 + <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
3.431 + <j2seproject1:java classname="${run.class}"/>
3.432 + </target>
3.433 + <!--
3.434 + =================
3.435 + DEBUGGING SECTION
3.436 + =================
3.437 + -->
3.438 + <target depends="init" if="netbeans.home" name="-debug-start-debugger">
3.439 + <j2seproject1:nbjpdastart name="${debug.class}"/>
3.440 + </target>
3.441 + <target depends="init,compile" name="-debug-start-debuggee">
3.442 + <j2seproject3:debug>
3.443 + <customize>
3.444 + <arg line="${application.args}"/>
3.445 + </customize>
3.446 + </j2seproject3:debug>
3.447 + </target>
3.448 + <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
3.449 + <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
3.450 + <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
3.451 + </target>
3.452 + <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
3.453 + <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
3.454 + <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
3.455 + <j2seproject3:debug classname="${debug.class}"/>
3.456 + </target>
3.457 + <target depends="init,-do-not-recompile,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
3.458 + <target depends="init" name="-pre-debug-fix">
3.459 + <fail unless="fix.includes">Must set fix.includes</fail>
3.460 + <property name="javac.includes" value="${fix.includes}.java"/>
3.461 + </target>
3.462 + <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
3.463 + <j2seproject1:nbjpdareload/>
3.464 + </target>
3.465 + <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
3.466 + <!--
3.467 + ===============
3.468 + JAVADOC SECTION
3.469 + ===============
3.470 + -->
3.471 + <target depends="init" name="-javadoc-build">
3.472 + <mkdir dir="${dist.javadoc.dir}"/>
3.473 + <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
3.474 + <classpath>
3.475 + <path path="${javac.classpath}"/>
3.476 + </classpath>
3.477 + <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
3.478 + <filename name="**/*.java"/>
3.479 + </fileset>
3.480 + </javadoc>
3.481 + </target>
3.482 + <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
3.483 + <nbbrowse file="${dist.javadoc.dir}/index.html"/>
3.484 + </target>
3.485 + <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
3.486 + <!--
3.487 + =========================
3.488 + JUNIT COMPILATION SECTION
3.489 + =========================
3.490 + -->
3.491 + <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
3.492 + <mkdir dir="${build.test.classes.dir}"/>
3.493 + </target>
3.494 + <target name="-pre-compile-test">
3.495 + <!-- Empty placeholder for easier customization. -->
3.496 + <!-- You can override this target in the ../build.xml file. -->
3.497 + </target>
3.498 + <target if="do.depend.true" name="-compile-test-depend">
3.499 + <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
3.500 + </target>
3.501 + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
3.502 + <j2seproject3:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
3.503 + <copy todir="${build.test.classes.dir}">
3.504 + <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
3.505 + </copy>
3.506 + </target>
3.507 + <target name="-post-compile-test">
3.508 + <!-- Empty placeholder for easier customization. -->
3.509 + <!-- You can override this target in the ../build.xml file. -->
3.510 + </target>
3.511 + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
3.512 + <target name="-pre-compile-test-single">
3.513 + <!-- Empty placeholder for easier customization. -->
3.514 + <!-- You can override this target in the ../build.xml file. -->
3.515 + </target>
3.516 + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
3.517 + <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
3.518 + <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
3.519 + <j2seproject3:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}"/>
3.520 + <copy todir="${build.test.classes.dir}">
3.521 + <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
3.522 + </copy>
3.523 + </target>
3.524 + <target name="-post-compile-test-single">
3.525 + <!-- Empty placeholder for easier customization. -->
3.526 + <!-- You can override this target in the ../build.xml file. -->
3.527 + </target>
3.528 + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
3.529 + <!--
3.530 + =======================
3.531 + JUNIT EXECUTION SECTION
3.532 + =======================
3.533 + -->
3.534 + <target depends="init" if="have.tests" name="-pre-test-run">
3.535 + <mkdir dir="${build.test.results.dir}"/>
3.536 + </target>
3.537 + <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
3.538 + <j2seproject3:junit testincludes="**/*Test.java"/>
3.539 + </target>
3.540 + <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
3.541 + <fail if="tests.failed">Some tests failed; see details above.</fail>
3.542 + </target>
3.543 + <target depends="init" if="have.tests" name="test-report"/>
3.544 + <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
3.545 + <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
3.546 + <target depends="init" if="have.tests" name="-pre-test-run-single">
3.547 + <mkdir dir="${build.test.results.dir}"/>
3.548 + </target>
3.549 + <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
3.550 + <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
3.551 + <j2seproject3:junit excludes="" includes="${test.includes}"/>
3.552 + </target>
3.553 + <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
3.554 + <fail if="tests.failed">Some tests failed; see details above.</fail>
3.555 + </target>
3.556 + <target depends="init,-do-not-recompile,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
3.557 + <!--
3.558 + =======================
3.559 + JUNIT DEBUGGING SECTION
3.560 + =======================
3.561 + -->
3.562 + <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
3.563 + <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
3.564 + <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
3.565 + <delete file="${test.report.file}"/>
3.566 + <mkdir dir="${build.test.results.dir}"/>
3.567 + <j2seproject3:debug classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" classpath="${ant.home}/lib/ant.jar:${ant.home}/lib/ant-junit.jar:${debug.test.classpath}">
3.568 + <customize>
3.569 + <syspropertyset>
3.570 + <propertyref prefix="test-sys-prop."/>
3.571 + <mapper from="test-sys-prop.*" to="*" type="glob"/>
3.572 + </syspropertyset>
3.573 + <arg value="${test.class}"/>
3.574 + <arg value="showoutput=true"/>
3.575 + <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
3.576 + <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
3.577 + </customize>
3.578 + </j2seproject3:debug>
3.579 + </target>
3.580 + <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
3.581 + <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
3.582 + </target>
3.583 + <target depends="init,-do-not-recompile,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
3.584 + <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
3.585 + <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
3.586 + </target>
3.587 + <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
3.588 + <!--
3.589 + =========================
3.590 + APPLET EXECUTION SECTION
3.591 + =========================
3.592 + -->
3.593 + <target depends="init,compile-single" name="run-applet">
3.594 + <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
3.595 + <j2seproject1:java classname="sun.applet.AppletViewer">
3.596 + <customize>
3.597 + <arg value="${applet.url}"/>
3.598 + </customize>
3.599 + </j2seproject1:java>
3.600 + </target>
3.601 + <!--
3.602 + =========================
3.603 + APPLET DEBUGGING SECTION
3.604 + =========================
3.605 + -->
3.606 + <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
3.607 + <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
3.608 + <j2seproject3:debug classname="sun.applet.AppletViewer">
3.609 + <customize>
3.610 + <arg value="${applet.url}"/>
3.611 + </customize>
3.612 + </j2seproject3:debug>
3.613 + </target>
3.614 + <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
3.615 + <!--
3.616 + ===============
3.617 + CLEANUP SECTION
3.618 + ===============
3.619 + -->
3.620 + <target depends="init" name="deps-clean" unless="no.deps"/>
3.621 + <target depends="init" name="-do-clean">
3.622 + <delete dir="${build.dir}"/>
3.623 + <delete dir="${dist.dir}"/>
3.624 + </target>
3.625 + <target name="-post-clean">
3.626 + <!-- Empty placeholder for easier customization. -->
3.627 + <!-- You can override this target in the ../build.xml file. -->
3.628 + </target>
3.629 + <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
3.630 +</project>
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
4.2 +++ b/samples/componentinjection/anagram-plain/nbproject/genfiles.properties Sat Jun 14 10:06:39 2008 +0200
4.3 @@ -0,0 +1,8 @@
4.4 +build.xml.data.CRC32=a145f2df
4.5 +build.xml.script.CRC32=d6f783b7
4.6 +build.xml.stylesheet.CRC32=be360661
4.7 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
4.8 +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
4.9 +nbproject/build-impl.xml.data.CRC32=a145f2df
4.10 +nbproject/build-impl.xml.script.CRC32=751fa40b
4.11 +nbproject/build-impl.xml.stylesheet.CRC32=f1d9da08
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
5.2 +++ b/samples/componentinjection/anagram-plain/nbproject/project.properties Sat Jun 14 10:06:39 2008 +0200
5.3 @@ -0,0 +1,59 @@
5.4 +build.classes.dir=${build.dir}/classes
5.5 +build.classes.excludes=**/*.java,**/*.form
5.6 +# This directory is removed when the project is cleaned:
5.7 +build.dir=build
5.8 +build.generated.dir=${build.dir}/generated
5.9 +# Only compile against the classpath explicitly listed here:
5.10 +build.sysclasspath=ignore
5.11 +build.test.classes.dir=${build.dir}/test/classes
5.12 +build.test.results.dir=${build.dir}/test/results
5.13 +debug.classpath=\
5.14 + ${run.classpath}
5.15 +debug.test.classpath=\
5.16 + ${run.test.classpath}
5.17 +# This directory is removed when the project is cleaned:
5.18 +dist.dir=dist
5.19 +dist.jar=${dist.dir}/anagram-plain.jar
5.20 +dist.javadoc.dir=${dist.dir}/javadoc
5.21 +excludes=
5.22 +includes=**
5.23 +jar.compress=false
5.24 +javac.classpath=
5.25 +# Space-separated list of extra javac options
5.26 +javac.compilerargs=
5.27 +javac.deprecation=false
5.28 +javac.source=1.5
5.29 +javac.target=1.5
5.30 +javac.test.classpath=\
5.31 + ${javac.classpath}:\
5.32 + ${build.classes.dir}:\
5.33 + ${libs.junit.classpath}:\
5.34 + ${libs.junit_4.classpath}
5.35 +javadoc.additionalparam=
5.36 +javadoc.author=false
5.37 +javadoc.encoding=${source.encoding}
5.38 +javadoc.noindex=false
5.39 +javadoc.nonavbar=false
5.40 +javadoc.notree=false
5.41 +javadoc.private=false
5.42 +javadoc.splitindex=true
5.43 +javadoc.use=true
5.44 +javadoc.version=false
5.45 +javadoc.windowtitle=
5.46 +main.class=org.apidesign.anagram.ui.Anagrams
5.47 +manifest.file=manifest.mf
5.48 +meta.inf.dir=${src.dir}/META-INF
5.49 +platform.active=default_platform
5.50 +run.classpath=\
5.51 + ${javac.classpath}:\
5.52 + ${build.classes.dir}
5.53 +# Space-separated list of JVM arguments used when running the project
5.54 +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
5.55 +# or test-sys-prop.name=value to set system properties for unit tests):
5.56 +run.jvmargs=
5.57 +run.test.classpath=\
5.58 + ${javac.test.classpath}:\
5.59 + ${build.test.classes.dir}
5.60 +source.encoding=UTF-8
5.61 +src.dir=src
5.62 +test.src.dir=test
6.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
6.2 +++ b/samples/componentinjection/anagram-plain/nbproject/project.xml Sat Jun 14 10:06:39 2008 +0200
6.3 @@ -0,0 +1,16 @@
6.4 +<?xml version="1.0" encoding="UTF-8"?>
6.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
6.6 + <type>org.netbeans.modules.java.j2seproject</type>
6.7 + <configuration>
6.8 + <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
6.9 + <name>anagram-plain</name>
6.10 + <minimum-ant-version>1.6.5</minimum-ant-version>
6.11 + <source-roots>
6.12 + <root id="src.dir"/>
6.13 + </source-roots>
6.14 + <test-roots>
6.15 + <root id="test.src.dir"/>
6.16 + </test-roots>
6.17 + </data>
6.18 + </configuration>
6.19 +</project>
7.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
7.2 +++ b/samples/componentinjection/anagram-plain/src/org/apidesign/anagram/lib/WordLibrary.java Sat Jun 14 10:06:39 2008 +0200
7.3 @@ -0,0 +1,122 @@
7.4 +
7.5 +package org.apidesign.anagram.lib;
7.6 +
7.7 +public final class WordLibrary {
7.8 +
7.9 + private static String wordList[] = {
7.10 + "abstraction",
7.11 + "ambiguous",
7.12 + "arithmetic",
7.13 + "backslash",
7.14 + "bitmap",
7.15 + "circumstance",
7.16 + "combination",
7.17 + "consequently",
7.18 + "consortium",
7.19 + "decrementing",
7.20 + "dependency",
7.21 + "disambiguate",
7.22 + "dynamic",
7.23 + "encapsulation",
7.24 + "equivalent",
7.25 + "expression",
7.26 + "facilitate",
7.27 + "fragment",
7.28 + "hexadecimal",
7.29 + "implementation",
7.30 + "indistinguishable",
7.31 + "inheritance",
7.32 + "internet",
7.33 + "java",
7.34 + "localization",
7.35 + "microprocessor",
7.36 + "navigation",
7.37 + "optimization",
7.38 + "parameter",
7.39 + "patrick",
7.40 + "pickle",
7.41 + "polymorphic",
7.42 + "rigorously",
7.43 + "simultaneously",
7.44 + "specification",
7.45 + "structure",
7.46 + "lexical",
7.47 + "likewise",
7.48 + "management",
7.49 + "manipulate",
7.50 + "mathematics",
7.51 + "hotjava",
7.52 + "vertex",
7.53 + "unsigned",
7.54 + "traditional"};
7.55 +
7.56 + private static String scrambledWordList[] = {
7.57 + "batsartcoin",
7.58 + "maibuguos",
7.59 + "ratimhteci",
7.60 + "abkclssha",
7.61 + "ibmtpa",
7.62 + "iccrmutsnaec",
7.63 + "ocbmnitaoni",
7.64 + "ocsnqeeutnyl",
7.65 + "ocsnroitmu",
7.66 + "edrcmeneitgn",
7.67 + "edepdnneyc",
7.68 + "idasbmgiauet",
7.69 + "ydanicm",
7.70 + "neacsplutaoni",
7.71 + "qeiuaveltn",
7.72 + "xerpseisno",
7.73 + "aficilatet",
7.74 + "rfgaemtn",
7.75 + "ehaxedicalm",
7.76 + "milpmeneatitno",
7.77 + "niidtsniugsiahleb",
7.78 + "niehiratcen",
7.79 + "nietnret",
7.80 + "ajav",
7.81 + "olacilazitno",
7.82 + "imrcpoorecssro",
7.83 + "anivagitno",
7.84 + "poitimazitno",
7.85 + "aparemert",
7.86 + "aprtcki",
7.87 + "ipkcel",
7.88 + "opylomprich",
7.89 + "irogorsuyl",
7.90 + "isumtlnaoesuyl",
7.91 + "psceficitaoni",
7.92 + "tsurtcreu",
7.93 + "elixalc",
7.94 + "ilekiwse",
7.95 + "amanegemtn",
7.96 + "aminupalet",
7.97 + "amhtmetacsi",
7.98 + "ohjtvaa",
7.99 + "evtrxe",
7.100 + "nuisngde",
7.101 + "rtdatioialn"
7.102 + };
7.103 +
7.104 + /** Creates a new instance of dictionary */
7.105 + public WordLibrary() {
7.106 + }
7.107 +
7.108 + public String getWord(int idx) {
7.109 + return wordList[idx];
7.110 + }
7.111 +
7.112 + public String getScrambledWord(int idx) {
7.113 + return scrambledWordList[idx];
7.114 + }
7.115 +
7.116 + public int getSize() {
7.117 + return wordList.length;
7.118 + }
7.119 +
7.120 + public boolean isCorrect(int idx, String userGuess) {
7.121 + return userGuess.equals(getWord(idx));
7.122 + }
7.123 +
7.124 +}
7.125 +
8.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
8.2 +++ b/samples/componentinjection/anagram-plain/src/org/apidesign/anagram/ui/About.form Sat Jun 14 10:06:39 2008 +0200
8.3 @@ -0,0 +1,76 @@
8.4 +<?xml version="1.0" encoding="UTF-8" ?>
8.5 +
8.6 +<Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
8.7 + <Properties>
8.8 + <Property name="defaultCloseOperation" type="int" value="2"/>
8.9 + <Property name="title" type="java.lang.String" value="About Anagrams"/>
8.10 + </Properties>
8.11 + <SyntheticProperties>
8.12 + <SyntheticProperty name="formSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,0,-25,0,0,1,53"/>
8.13 + <SyntheticProperty name="formSizePolicy" type="int" value="0"/>
8.14 + <SyntheticProperty name="generateSize" type="boolean" value="true"/>
8.15 + <SyntheticProperty name="generateCenter" type="boolean" value="true"/>
8.16 + </SyntheticProperties>
8.17 + <Events>
8.18 + <EventHandler event="windowClosing" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="exitForm"/>
8.19 + </Events>
8.20 + <AuxValues>
8.21 + <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
8.22 + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
8.23 + <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
8.24 + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
8.25 + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
8.26 + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
8.27 + </AuxValues>
8.28 +
8.29 + <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
8.30 + <SubComponents>
8.31 + <Container class="javax.swing.JPanel" name="jPanel1">
8.32 + <Properties>
8.33 + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
8.34 + <Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
8.35 + <EmptyBorder bottom="12" left="11" right="12" top="11"/>
8.36 + </Border>
8.37 + </Property>
8.38 + </Properties>
8.39 + <Constraints>
8.40 + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
8.41 + <GridBagConstraints gridX="-1" gridY="-1" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="1.0"/>
8.42 + </Constraint>
8.43 + </Constraints>
8.44 +
8.45 + <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
8.46 + <SubComponents>
8.47 + <Component class="javax.swing.JTextArea" name="jTextArea1">
8.48 + <Properties>
8.49 + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
8.50 + <Color blue="cc" green="cc" id="Panel.background" palette="3" red="cc" type="palette"/>
8.51 + </Property>
8.52 + <Property name="editable" type="boolean" value="false"/>
8.53 + <Property name="lineWrap" type="boolean" value="true"/>
8.54 + <Property name="text" type="java.lang.String" value="Anagrams

Copyright (c) 2003 Irritable Enterprises, Inc."/>
8.55 + <Property name="wrapStyleWord" type="boolean" value="true"/>
8.56 + </Properties>
8.57 + <Constraints>
8.58 + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
8.59 + <GridBagConstraints gridX="-1" gridY="-1" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="12" insetsRight="0" anchor="10" weightX="1.0" weightY="1.0"/>
8.60 + </Constraint>
8.61 + </Constraints>
8.62 + </Component>
8.63 + <Component class="javax.swing.JButton" name="jButton1">
8.64 + <Properties>
8.65 + <Property name="text" type="java.lang.String" value="Close"/>
8.66 + </Properties>
8.67 + <Events>
8.68 + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/>
8.69 + </Events>
8.70 + <Constraints>
8.71 + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
8.72 + <GridBagConstraints gridX="0" gridY="1" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
8.73 + </Constraint>
8.74 + </Constraints>
8.75 + </Component>
8.76 + </SubComponents>
8.77 + </Container>
8.78 + </SubComponents>
8.79 +</Form>
9.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
9.2 +++ b/samples/componentinjection/anagram-plain/src/org/apidesign/anagram/ui/About.java Sat Jun 14 10:06:39 2008 +0200
9.3 @@ -0,0 +1,91 @@
9.4 +package org.apidesign.anagram.ui;
9.5 +
9.6 +/**
9.7 + *
9.8 + * @author Dirk Ruiz
9.9 + */
9.10 +public class About extends javax.swing.JFrame {
9.11 +
9.12 + /** Creates new form About */
9.13 + public About() {
9.14 + initComponents();
9.15 + }
9.16 +
9.17 + /** This method is called from within the constructor to
9.18 + * initialize the form.
9.19 + * WARNING: Do NOT modify this code. The content of this method is
9.20 + * always regenerated by the Form Editor.
9.21 + */
9.22 + private void initComponents() {//GEN-BEGIN:initComponents
9.23 + java.awt.GridBagConstraints gridBagConstraints;
9.24 +
9.25 + jPanel1 = new javax.swing.JPanel();
9.26 + jTextArea1 = new javax.swing.JTextArea();
9.27 + jButton1 = new javax.swing.JButton();
9.28 +
9.29 + getContentPane().setLayout(new java.awt.GridBagLayout());
9.30 +
9.31 + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
9.32 + setTitle("About Anagrams");
9.33 + addWindowListener(new java.awt.event.WindowAdapter() {
9.34 + public void windowClosing(java.awt.event.WindowEvent evt) {
9.35 + exitForm(evt);
9.36 + }
9.37 + });
9.38 +
9.39 + jPanel1.setLayout(new java.awt.GridBagLayout());
9.40 +
9.41 + jPanel1.setBorder(new javax.swing.border.EmptyBorder(new java.awt.Insets(11, 11, 12, 12)));
9.42 + jTextArea1.setBackground((java.awt.Color) javax.swing.UIManager.getDefaults().get("Panel.background"));
9.43 + jTextArea1.setEditable(false);
9.44 + jTextArea1.setLineWrap(true);
9.45 + jTextArea1.setText("Anagrams\n\nCopyright (c) 2003 Irritable Enterprises, Inc.");
9.46 + jTextArea1.setToolTipText("null");
9.47 + jTextArea1.setWrapStyleWord(true);
9.48 + gridBagConstraints = new java.awt.GridBagConstraints();
9.49 + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
9.50 + gridBagConstraints.insets = new java.awt.Insets(0, 0, 12, 0);
9.51 + gridBagConstraints.weightx = 1.0;
9.52 + gridBagConstraints.weighty = 1.0;
9.53 + jPanel1.add(jTextArea1, gridBagConstraints);
9.54 +
9.55 + jButton1.setText("Close");
9.56 + jButton1.addActionListener(new java.awt.event.ActionListener() {
9.57 + public void actionPerformed(java.awt.event.ActionEvent evt) {
9.58 + jButton1ActionPerformed(evt);
9.59 + }
9.60 + });
9.61 +
9.62 + gridBagConstraints = new java.awt.GridBagConstraints();
9.63 + gridBagConstraints.gridx = 0;
9.64 + gridBagConstraints.gridy = 1;
9.65 + jPanel1.add(jButton1, gridBagConstraints);
9.66 +
9.67 + gridBagConstraints = new java.awt.GridBagConstraints();
9.68 + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
9.69 + gridBagConstraints.weightx = 1.0;
9.70 + gridBagConstraints.weighty = 1.0;
9.71 + getContentPane().add(jPanel1, gridBagConstraints);
9.72 +
9.73 + pack();
9.74 + java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
9.75 + setSize(new java.awt.Dimension(309, 231));
9.76 + setLocation((screenSize.width-309)/2,(screenSize.height-231)/2);
9.77 + }//GEN-END:initComponents
9.78 +
9.79 + private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
9.80 + this.hide();
9.81 + }//GEN-LAST:event_jButton1ActionPerformed
9.82 +
9.83 + /** Exit the Application */
9.84 + private void exitForm(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_exitForm
9.85 + //System.exit(0);
9.86 + }//GEN-LAST:event_exitForm
9.87 +
9.88 + // Variables declaration - do not modify//GEN-BEGIN:variables
9.89 + private javax.swing.JButton jButton1;
9.90 + private javax.swing.JTextArea jTextArea1;
9.91 + private javax.swing.JPanel jPanel1;
9.92 + // End of variables declaration//GEN-END:variables
9.93 +
9.94 +}
10.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
10.2 +++ b/samples/componentinjection/anagram-plain/src/org/apidesign/anagram/ui/Anagrams.form Sat Jun 14 10:06:39 2008 +0200
10.3 @@ -0,0 +1,156 @@
10.4 +<?xml version="1.0" encoding="UTF-8" ?>
10.5 +
10.6 +<Form version="1.0" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
10.7 + <NonVisualComponents>
10.8 + <Menu class="javax.swing.JMenuBar" name="mainMenu">
10.9 + <SubComponents>
10.10 + <Menu class="javax.swing.JMenu" name="File">
10.11 + <Properties>
10.12 + <Property name="text" type="java.lang.String" value="File"/>
10.13 + </Properties>
10.14 + <SubComponents>
10.15 + <MenuItem class="javax.swing.JMenuItem" name="jMenuItem1">
10.16 + <Properties>
10.17 + <Property name="text" type="java.lang.String" value="About"/>
10.18 + <Property name="toolTipText" type="java.lang.String" value="About"/>
10.19 + </Properties>
10.20 + <Events>
10.21 + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem1ActionPerformed"/>
10.22 + </Events>
10.23 + </MenuItem>
10.24 + <MenuItem class="javax.swing.JMenuItem" name="jMenuItem2">
10.25 + <Properties>
10.26 + <Property name="text" type="java.lang.String" value="Exit"/>
10.27 + <Property name="toolTipText" type="java.lang.String" value="Quit Team, Quit!"/>
10.28 + </Properties>
10.29 + <Events>
10.30 + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem2ActionPerformed"/>
10.31 + </Events>
10.32 + </MenuItem>
10.33 + </SubComponents>
10.34 + </Menu>
10.35 + </SubComponents>
10.36 + </Menu>
10.37 + </NonVisualComponents>
10.38 + <Properties>
10.39 + <Property name="title" type="java.lang.String" value="Anagrams"/>
10.40 + </Properties>
10.41 + <SyntheticProperties>
10.42 + <SyntheticProperty name="menuBar" type="java.lang.String" value="mainMenu"/>
10.43 + <SyntheticProperty name="formSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,0,-6,0,0,1,-112"/>
10.44 + <SyntheticProperty name="formSizePolicy" type="int" value="0"/>
10.45 + <SyntheticProperty name="generateSize" type="boolean" value="true"/>
10.46 + <SyntheticProperty name="generateCenter" type="boolean" value="true"/>
10.47 + </SyntheticProperties>
10.48 + <Events>
10.49 + <EventHandler event="windowClosing" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="exitForm"/>
10.50 + </Events>
10.51 + <AuxValues>
10.52 + <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,0,-6,0,0,1,-112"/>
10.53 + </AuxValues>
10.54 +
10.55 + <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
10.56 + <SubComponents>
10.57 + <Container class="javax.swing.JPanel" name="mainPanel">
10.58 + <Properties>
10.59 + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
10.60 + <Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
10.61 + <EmptyBorder bottom="12" left="11" right="12" top="11"/>
10.62 + </Border>
10.63 + </Property>
10.64 + <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
10.65 + <Dimension value="[297, 200]"/>
10.66 + </Property>
10.67 + <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
10.68 + <Dimension value="[297, 200]"/>
10.69 + </Property>
10.70 + </Properties>
10.71 + <Constraints>
10.72 + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
10.73 + <BorderConstraints direction="Center"/>
10.74 + </Constraint>
10.75 + </Constraints>
10.76 +
10.77 + <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
10.78 + <SubComponents>
10.79 + <Component class="javax.swing.JLabel" name="scrambledLabel">
10.80 + <Properties>
10.81 + <Property name="text" type="java.lang.String" value="Scrambled Word:"/>
10.82 + </Properties>
10.83 + <Constraints>
10.84 + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
10.85 + <GridBagConstraints gridX="-1" gridY="-1" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="12" insetsLeft="12" insetsBottom="12" insetsRight="6" anchor="17" weightX="0.0" weightY="0.0"/>
10.86 + </Constraint>
10.87 + </Constraints>
10.88 + </Component>
10.89 + <Component class="javax.swing.JLabel" name="guessLabel">
10.90 + <Properties>
10.91 + <Property name="text" type="java.lang.String" value="Your Guess:"/>
10.92 + </Properties>
10.93 + <Constraints>
10.94 + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
10.95 + <GridBagConstraints gridX="0" gridY="1" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="12" insetsBottom="12" insetsRight="6" anchor="17" weightX="0.0" weightY="0.0"/>
10.96 + </Constraint>
10.97 + </Constraints>
10.98 + </Component>
10.99 + <Component class="javax.swing.JLabel" name="feedbackLabel">
10.100 + <Properties>
10.101 + <Property name="text" type="java.lang.String" value=" "/>
10.102 + </Properties>
10.103 + <Constraints>
10.104 + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
10.105 + <GridBagConstraints gridX="1" gridY="2" gridWidth="2" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="6" insetsRight="6" anchor="10" weightX="1.0" weightY="0.0"/>
10.106 + </Constraint>
10.107 + </Constraints>
10.108 + </Component>
10.109 + <Component class="javax.swing.JButton" name="guessButton">
10.110 + <Properties>
10.111 + <Property name="mnemonic" type="int" value="71"/>
10.112 + <Property name="text" type="java.lang.String" value="Guess"/>
10.113 + <Property name="toolTipText" type="java.lang.String" value="Guess the scrambled word."/>
10.114 + </Properties>
10.115 + <Events>
10.116 + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="guessedWordActionPerformed"/>
10.117 + </Events>
10.118 + <Constraints>
10.119 + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
10.120 + <GridBagConstraints gridX="2" gridY="3" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="11" insetsRight="6" anchor="13" weightX="0.0" weightY="0.0"/>
10.121 + </Constraint>
10.122 + </Constraints>
10.123 + </Component>
10.124 + <Component class="javax.swing.JTextField" name="scrambledWord">
10.125 + <Properties>
10.126 + <Property name="editable" type="boolean" value="false"/>
10.127 + </Properties>
10.128 + <Constraints>
10.129 + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
10.130 + <GridBagConstraints gridX="-1" gridY="-1" gridWidth="3" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="12" insetsLeft="0" insetsBottom="12" insetsRight="11" anchor="10" weightX="1.0" weightY="0.0"/>
10.131 + </Constraint>
10.132 + </Constraints>
10.133 + </Component>
10.134 + <Component class="javax.swing.JTextField" name="guessedWord">
10.135 + <Constraints>
10.136 + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
10.137 + <GridBagConstraints gridX="1" gridY="1" gridWidth="3" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="12" insetsRight="11" anchor="10" weightX="1.0" weightY="0.0"/>
10.138 + </Constraint>
10.139 + </Constraints>
10.140 + </Component>
10.141 + <Component class="javax.swing.JButton" name="nextTrial">
10.142 + <Properties>
10.143 + <Property name="mnemonic" type="int" value="78"/>
10.144 + <Property name="text" type="java.lang.String" value="New Word"/>
10.145 + <Property name="toolTipText" type="java.lang.String" value="Fetch a new word."/>
10.146 + </Properties>
10.147 + <Events>
10.148 + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="nextTrialActionPerformed"/>
10.149 + </Events>
10.150 + <Constraints>
10.151 + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
10.152 + <GridBagConstraints gridX="3" gridY="3" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="11" insetsRight="11" anchor="10" weightX="0.0" weightY="0.0"/>
10.153 + </Constraint>
10.154 + </Constraints>
10.155 + </Component>
10.156 + </SubComponents>
10.157 + </Container>
10.158 + </SubComponents>
10.159 +</Form>
11.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
11.2 +++ b/samples/componentinjection/anagram-plain/src/org/apidesign/anagram/ui/Anagrams.java Sat Jun 14 10:06:39 2008 +0200
11.3 @@ -0,0 +1,226 @@
11.4 +package org.apidesign.anagram.ui;
11.5 +
11.6 +import org.apidesign.anagram.lib.WordLibrary;
11.7 +
11.8 +/**
11.9 + *
11.10 + * @author Dirk Ruiz
11.11 + */
11.12 +public class Anagrams extends javax.swing.JFrame {
11.13 +
11.14 + /** Creates new form Anagrams */
11.15 + public Anagrams() {
11.16 + initComponents();
11.17 + scrambledWord.setText(wl.getScrambledWord(wordIdx));
11.18 + getRootPane().setDefaultButton(guessButton);
11.19 + }
11.20 + WordLibrary wl = new WordLibrary();
11.21 + int wordIdx = 0;
11.22 +
11.23 + /** This method is called from within the constructor to
11.24 + * initialize the form.
11.25 + * WARNING: Do NOT modify this code. The content of this method is
11.26 + * always regenerated by the Form Editor.
11.27 + */
11.28 + private void initComponents() {//GEN-BEGIN:initComponents
11.29 + java.awt.GridBagConstraints gridBagConstraints;
11.30 +
11.31 + mainPanel = new javax.swing.JPanel();
11.32 + scrambledLabel = new javax.swing.JLabel();
11.33 + guessLabel = new javax.swing.JLabel();
11.34 + feedbackLabel = new javax.swing.JLabel();
11.35 + guessButton = new javax.swing.JButton();
11.36 + scrambledWord = new javax.swing.JTextField();
11.37 + guessedWord = new javax.swing.JTextField();
11.38 + nextTrial = new javax.swing.JButton();
11.39 + mainMenu = new javax.swing.JMenuBar();
11.40 + File = new javax.swing.JMenu();
11.41 + jMenuItem1 = new javax.swing.JMenuItem();
11.42 + jMenuItem2 = new javax.swing.JMenuItem();
11.43 +
11.44 + setTitle("Anagrams");
11.45 + addWindowListener(new java.awt.event.WindowAdapter() {
11.46 + public void windowClosing(java.awt.event.WindowEvent evt) {
11.47 + exitForm(evt);
11.48 + }
11.49 + });
11.50 +
11.51 + mainPanel.setLayout(new java.awt.GridBagLayout());
11.52 +
11.53 + mainPanel.setBorder(new javax.swing.border.EmptyBorder(new java.awt.Insets(11, 11, 12, 12)));
11.54 + mainPanel.setMinimumSize(new java.awt.Dimension(297, 200));
11.55 + mainPanel.setPreferredSize(new java.awt.Dimension(297, 200));
11.56 + scrambledLabel.setText("Scrambled Word:");
11.57 + gridBagConstraints = new java.awt.GridBagConstraints();
11.58 + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
11.59 + gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
11.60 + gridBagConstraints.insets = new java.awt.Insets(12, 12, 12, 6);
11.61 + mainPanel.add(scrambledLabel, gridBagConstraints);
11.62 +
11.63 + guessLabel.setText("Your Guess:");
11.64 + gridBagConstraints = new java.awt.GridBagConstraints();
11.65 + gridBagConstraints.gridx = 0;
11.66 + gridBagConstraints.gridy = 1;
11.67 + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
11.68 + gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
11.69 + gridBagConstraints.insets = new java.awt.Insets(0, 12, 12, 6);
11.70 + mainPanel.add(guessLabel, gridBagConstraints);
11.71 +
11.72 + feedbackLabel.setText(" ");
11.73 + gridBagConstraints = new java.awt.GridBagConstraints();
11.74 + gridBagConstraints.gridx = 1;
11.75 + gridBagConstraints.gridy = 2;
11.76 + gridBagConstraints.gridwidth = 2;
11.77 + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
11.78 + gridBagConstraints.weightx = 1.0;
11.79 + gridBagConstraints.insets = new java.awt.Insets(0, 0, 6, 6);
11.80 + mainPanel.add(feedbackLabel, gridBagConstraints);
11.81 +
11.82 + guessButton.setMnemonic('G');
11.83 + guessButton.setText("Guess");
11.84 + guessButton.setToolTipText("Guess the scrambled word.");
11.85 + guessButton.addActionListener(new java.awt.event.ActionListener() {
11.86 + public void actionPerformed(java.awt.event.ActionEvent evt) {
11.87 + guessedWordActionPerformed(evt);
11.88 + }
11.89 + });
11.90 +
11.91 + gridBagConstraints = new java.awt.GridBagConstraints();
11.92 + gridBagConstraints.gridx = 2;
11.93 + gridBagConstraints.gridy = 3;
11.94 + gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
11.95 + gridBagConstraints.insets = new java.awt.Insets(0, 0, 11, 6);
11.96 + mainPanel.add(guessButton, gridBagConstraints);
11.97 +
11.98 + scrambledWord.setEditable(false);
11.99 + gridBagConstraints = new java.awt.GridBagConstraints();
11.100 + gridBagConstraints.gridwidth = 3;
11.101 + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
11.102 + gridBagConstraints.weightx = 1.0;
11.103 + gridBagConstraints.insets = new java.awt.Insets(12, 0, 12, 11);
11.104 + mainPanel.add(scrambledWord, gridBagConstraints);
11.105 +
11.106 + gridBagConstraints = new java.awt.GridBagConstraints();
11.107 + gridBagConstraints.gridx = 1;
11.108 + gridBagConstraints.gridy = 1;
11.109 + gridBagConstraints.gridwidth = 3;
11.110 + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
11.111 + gridBagConstraints.weightx = 1.0;
11.112 + gridBagConstraints.insets = new java.awt.Insets(0, 0, 12, 11);
11.113 + mainPanel.add(guessedWord, gridBagConstraints);
11.114 +
11.115 + nextTrial.setMnemonic('N');
11.116 + nextTrial.setText("New Word");
11.117 + nextTrial.setToolTipText("Fetch a new word.");
11.118 + nextTrial.addActionListener(new java.awt.event.ActionListener() {
11.119 + public void actionPerformed(java.awt.event.ActionEvent evt) {
11.120 + nextTrialActionPerformed(evt);
11.121 + }
11.122 + });
11.123 +
11.124 + gridBagConstraints = new java.awt.GridBagConstraints();
11.125 + gridBagConstraints.gridx = 3;
11.126 + gridBagConstraints.gridy = 3;
11.127 + gridBagConstraints.insets = new java.awt.Insets(0, 0, 11, 11);
11.128 + mainPanel.add(nextTrial, gridBagConstraints);
11.129 +
11.130 + getContentPane().add(mainPanel, java.awt.BorderLayout.CENTER);
11.131 +
11.132 + File.setText("File");
11.133 + jMenuItem1.setText("About");
11.134 + jMenuItem1.setToolTipText("About");
11.135 + jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
11.136 + public void actionPerformed(java.awt.event.ActionEvent evt) {
11.137 + jMenuItem1ActionPerformed(evt);
11.138 + }
11.139 + });
11.140 +
11.141 + File.add(jMenuItem1);
11.142 +
11.143 + jMenuItem2.setText("Exit");
11.144 + jMenuItem2.setToolTipText("Quit Team, Quit!");
11.145 + jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
11.146 + public void actionPerformed(java.awt.event.ActionEvent evt) {
11.147 + jMenuItem2ActionPerformed(evt);
11.148 + }
11.149 + });
11.150 +
11.151 + File.add(jMenuItem2);
11.152 +
11.153 + mainMenu.add(File);
11.154 +
11.155 + setJMenuBar(mainMenu);
11.156 +
11.157 + java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
11.158 + setBounds((screenSize.width-400)/2, (screenSize.height-250)/2, 400, 250);
11.159 + }//GEN-END:initComponents
11.160 +
11.161 + private void nextTrialActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nextTrialActionPerformed
11.162 + wordIdx = (wordIdx + 1) % wl.getSize();
11.163 +
11.164 + feedbackLabel.setText(" ");
11.165 + scrambledWord.setText(wl.getScrambledWord(wordIdx));
11.166 + guessedWord.setText("");
11.167 + getRootPane().setDefaultButton(guessButton);
11.168 +
11.169 + guessedWord.requestFocus();
11.170 + }//GEN-LAST:event_nextTrialActionPerformed
11.171 +
11.172 + private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed
11.173 + System.exit(0);
11.174 + }//GEN-LAST:event_jMenuItem2ActionPerformed
11.175 +
11.176 + private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
11.177 + new About().show();
11.178 + }//GEN-LAST:event_jMenuItem1ActionPerformed
11.179 +
11.180 + private void guessedWordActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_guessedWordActionPerformed
11.181 +
11.182 + if(wl.isCorrect(wordIdx, guessedWord.getText())){
11.183 + feedbackLabel.setText("Correct! Try a new word!");
11.184 + getRootPane().setDefaultButton(nextTrial);
11.185 + } else {
11.186 + feedbackLabel.setText("Incorrect! Try again!");
11.187 + guessedWord.setText("");
11.188 + }
11.189 +
11.190 + guessedWord.requestFocus();
11.191 + }//GEN-LAST:event_guessedWordActionPerformed
11.192 +
11.193 + /** Exit the Application */
11.194 + private void exitForm(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_exitForm
11.195 + System.exit(0);
11.196 + }//GEN-LAST:event_exitForm
11.197 +
11.198 + @Override
11.199 + public void setVisible(boolean v) {
11.200 + super.setVisible(v);
11.201 + if (v) {
11.202 + guessedWord.requestFocus();
11.203 + }
11.204 + }
11.205 +
11.206 + /**
11.207 + * @param args the command line arguments
11.208 + */
11.209 + public static void main(String args[]) {
11.210 + new Anagrams().show();
11.211 + }
11.212 +
11.213 +
11.214 + // Variables declaration - do not modify//GEN-BEGIN:variables
11.215 + private javax.swing.JMenu File;
11.216 + private javax.swing.JLabel feedbackLabel;
11.217 + private javax.swing.JButton guessButton;
11.218 + private javax.swing.JLabel guessLabel;
11.219 + private javax.swing.JTextField guessedWord;
11.220 + private javax.swing.JMenuItem jMenuItem1;
11.221 + private javax.swing.JMenuItem jMenuItem2;
11.222 + private javax.swing.JMenuBar mainMenu;
11.223 + private javax.swing.JPanel mainPanel;
11.224 + private javax.swing.JButton nextTrial;
11.225 + private javax.swing.JLabel scrambledLabel;
11.226 + private javax.swing.JTextField scrambledWord;
11.227 + // End of variables declaration//GEN-END:variables
11.228 +
11.229 +}