Sat, 26 Jan 2013 15:48:59 +0100
init project + editable sudoku field
1.1 --- a/.hgignore Sat Jan 26 14:49:54 2013 +0100 1.2 +++ b/.hgignore Sat Jan 26 15:48:59 2013 +0100 1.3 @@ -0,0 +1,5 @@ 1.4 +\.orig\..*$ 1.5 +\.orig$ 1.6 +\.chg\..*$ 1.7 +\.rej$ 1.8 +\.conflict\~$
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/build.xml Sat Jan 26 15:48:59 2013 +0100 2.3 @@ -0,0 +1,74 @@ 2.4 +<?xml version="1.0" encoding="UTF-8"?> 2.5 +<!-- You may freely edit this file. See commented blocks below for --> 2.6 +<!-- some examples of how to customize the build. --> 2.7 +<!-- (If you delete it and reopen the project it will be recreated.) --> 2.8 +<!-- By default, only the Clean and Build commands use this build script. --> 2.9 +<!-- Commands such as Run, Debug, and Test only use this build script if --> 2.10 +<!-- the Compile on Save feature is turned off for the project. --> 2.11 +<!-- You can turn off the Compile on Save (or Deploy on Save) setting --> 2.12 +<!-- in the project's Project Properties dialog box.--> 2.13 +<project name="Sudoku" default="default" basedir="."> 2.14 + <description>Builds, tests, and runs the project Sudoku.</description> 2.15 + <import file="nbproject/build-impl.xml"/> 2.16 + <!-- 2.17 + 2.18 + There exist several targets which are by default empty and which can be 2.19 + used for execution of your tasks. These targets are usually executed 2.20 + before and after some main targets. They are: 2.21 + 2.22 + -pre-init: called before initialization of project properties 2.23 + -post-init: called after initialization of project properties 2.24 + -pre-compile: called before javac compilation 2.25 + -post-compile: called after javac compilation 2.26 + -pre-compile-single: called before javac compilation of single file 2.27 + -post-compile-single: called after javac compilation of single file 2.28 + -pre-compile-test: called before javac compilation of JUnit tests 2.29 + -post-compile-test: called after javac compilation of JUnit tests 2.30 + -pre-compile-test-single: called before javac compilation of single JUnit test 2.31 + -post-compile-test-single: called after javac compilation of single JUunit test 2.32 + -pre-jar: called before JAR building 2.33 + -post-jar: called after JAR building 2.34 + -post-clean: called after cleaning build products 2.35 + 2.36 + (Targets beginning with '-' are not intended to be called on their own.) 2.37 + 2.38 + Example of inserting an obfuscator after compilation could look like this: 2.39 + 2.40 + <target name="-post-compile"> 2.41 + <obfuscate> 2.42 + <fileset dir="${build.classes.dir}"/> 2.43 + </obfuscate> 2.44 + </target> 2.45 + 2.46 + For list of available properties check the imported 2.47 + nbproject/build-impl.xml file. 2.48 + 2.49 + 2.50 + Another way to customize the build is by overriding existing main targets. 2.51 + The targets of interest are: 2.52 + 2.53 + -init-macrodef-javac: defines macro for javac compilation 2.54 + -init-macrodef-junit: defines macro for junit execution 2.55 + -init-macrodef-debug: defines macro for class debugging 2.56 + -init-macrodef-java: defines macro for class execution 2.57 + -do-jar-with-manifest: JAR building (if you are using a manifest) 2.58 + -do-jar-without-manifest: JAR building (if you are not using a manifest) 2.59 + run: execution of project 2.60 + -javadoc-build: Javadoc generation 2.61 + test-report: JUnit report generation 2.62 + 2.63 + An example of overriding the target for project execution could look like this: 2.64 + 2.65 + <target name="run" depends="Sudoku-impl.jar"> 2.66 + <exec dir="bin" executable="launcher.exe"> 2.67 + <arg file="${dist.jar}"/> 2.68 + </exec> 2.69 + </target> 2.70 + 2.71 + Notice that the overridden target depends on the jar target and not only on 2.72 + the compile target as the regular run target does. Again, for a list of available 2.73 + properties which you can use, check the target you are overriding in the 2.74 + nbproject/build-impl.xml file. 2.75 + 2.76 + --> 2.77 +</project>
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 3.2 +++ b/manifest.mf Sat Jan 26 15:48:59 2013 +0100 3.3 @@ -0,0 +1,3 @@ 3.4 +Manifest-Version: 1.0 3.5 +X-COMMENT: Main-Class will be added automatically by build 3.6 +
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 4.2 +++ b/nbproject/build-impl.xml Sat Jan 26 15:48:59 2013 +0100 4.3 @@ -0,0 +1,1400 @@ 4.4 +<?xml version="1.0" encoding="UTF-8"?> 4.5 +<!-- 4.6 +*** GENERATED FROM project.xml - DO NOT EDIT *** 4.7 +*** EDIT ../build.xml INSTEAD *** 4.8 + 4.9 +For the purpose of easier reading the script 4.10 +is divided into following sections: 4.11 + 4.12 + - initialization 4.13 + - compilation 4.14 + - jar 4.15 + - execution 4.16 + - debugging 4.17 + - javadoc 4.18 + - test compilation 4.19 + - test execution 4.20 + - test debugging 4.21 + - applet 4.22 + - cleanup 4.23 + 4.24 + --> 4.25 +<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" 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="Sudoku-impl"> 4.26 + <fail message="Please build using Ant 1.8.0 or higher."> 4.27 + <condition> 4.28 + <not> 4.29 + <antversion atleast="1.8.0"/> 4.30 + </not> 4.31 + </condition> 4.32 + </fail> 4.33 + <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/> 4.34 + <!-- 4.35 + ====================== 4.36 + INITIALIZATION SECTION 4.37 + ====================== 4.38 + --> 4.39 + <target name="-pre-init"> 4.40 + <!-- Empty placeholder for easier customization. --> 4.41 + <!-- You can override this target in the ../build.xml file. --> 4.42 + </target> 4.43 + <target depends="-pre-init" name="-init-private"> 4.44 + <property file="nbproject/private/config.properties"/> 4.45 + <property file="nbproject/private/configs/${config}.properties"/> 4.46 + <property file="nbproject/private/private.properties"/> 4.47 + </target> 4.48 + <target depends="-pre-init,-init-private" name="-init-user"> 4.49 + <property file="${user.properties.file}"/> 4.50 + <!-- The two properties below are usually overridden --> 4.51 + <!-- by the active platform. Just a fallback. --> 4.52 + <property name="default.javac.source" value="1.4"/> 4.53 + <property name="default.javac.target" value="1.4"/> 4.54 + </target> 4.55 + <target depends="-pre-init,-init-private,-init-user" name="-init-project"> 4.56 + <property file="nbproject/configs/${config}.properties"/> 4.57 + <property file="nbproject/project.properties"/> 4.58 + </target> 4.59 + <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init"> 4.60 + <available file="${manifest.file}" property="manifest.available"/> 4.61 + <condition property="splashscreen.available"> 4.62 + <and> 4.63 + <not> 4.64 + <equals arg1="${application.splash}" arg2="" trim="true"/> 4.65 + </not> 4.66 + <available file="${application.splash}"/> 4.67 + </and> 4.68 + </condition> 4.69 + <condition property="main.class.available"> 4.70 + <and> 4.71 + <isset property="main.class"/> 4.72 + <not> 4.73 + <equals arg1="${main.class}" arg2="" trim="true"/> 4.74 + </not> 4.75 + </and> 4.76 + </condition> 4.77 + <condition property="manifest.available+main.class"> 4.78 + <and> 4.79 + <isset property="manifest.available"/> 4.80 + <isset property="main.class.available"/> 4.81 + </and> 4.82 + </condition> 4.83 + <condition property="do.archive"> 4.84 + <not> 4.85 + <istrue value="${jar.archive.disabled}"/> 4.86 + </not> 4.87 + </condition> 4.88 + <condition property="do.mkdist"> 4.89 + <and> 4.90 + <isset property="do.archive"/> 4.91 + <isset property="libs.CopyLibs.classpath"/> 4.92 + <not> 4.93 + <istrue value="${mkdist.disabled}"/> 4.94 + </not> 4.95 + </and> 4.96 + </condition> 4.97 + <condition property="manifest.available+main.class+mkdist.available"> 4.98 + <and> 4.99 + <istrue value="${manifest.available+main.class}"/> 4.100 + <isset property="do.mkdist"/> 4.101 + </and> 4.102 + </condition> 4.103 + <condition property="do.archive+manifest.available"> 4.104 + <and> 4.105 + <isset property="manifest.available"/> 4.106 + <istrue value="${do.archive}"/> 4.107 + </and> 4.108 + </condition> 4.109 + <condition property="do.archive+main.class.available"> 4.110 + <and> 4.111 + <isset property="main.class.available"/> 4.112 + <istrue value="${do.archive}"/> 4.113 + </and> 4.114 + </condition> 4.115 + <condition property="do.archive+splashscreen.available"> 4.116 + <and> 4.117 + <isset property="splashscreen.available"/> 4.118 + <istrue value="${do.archive}"/> 4.119 + </and> 4.120 + </condition> 4.121 + <condition property="do.archive+manifest.available+main.class"> 4.122 + <and> 4.123 + <istrue value="${manifest.available+main.class}"/> 4.124 + <istrue value="${do.archive}"/> 4.125 + </and> 4.126 + </condition> 4.127 + <condition property="manifest.available-mkdist.available"> 4.128 + <or> 4.129 + <istrue value="${manifest.available}"/> 4.130 + <isset property="do.mkdist"/> 4.131 + </or> 4.132 + </condition> 4.133 + <condition property="manifest.available+main.class-mkdist.available"> 4.134 + <or> 4.135 + <istrue value="${manifest.available+main.class}"/> 4.136 + <isset property="do.mkdist"/> 4.137 + </or> 4.138 + </condition> 4.139 + <condition property="have.tests"> 4.140 + <or> 4.141 + <available file="${test.src.dir}"/> 4.142 + </or> 4.143 + </condition> 4.144 + <condition property="have.sources"> 4.145 + <or> 4.146 + <available file="${src.dir}"/> 4.147 + </or> 4.148 + </condition> 4.149 + <condition property="netbeans.home+have.tests"> 4.150 + <and> 4.151 + <isset property="netbeans.home"/> 4.152 + <isset property="have.tests"/> 4.153 + </and> 4.154 + </condition> 4.155 + <condition property="no.javadoc.preview"> 4.156 + <and> 4.157 + <isset property="javadoc.preview"/> 4.158 + <isfalse value="${javadoc.preview}"/> 4.159 + </and> 4.160 + </condition> 4.161 + <property name="run.jvmargs" value=""/> 4.162 + <property name="run.jvmargs.ide" value=""/> 4.163 + <property name="javac.compilerargs" value=""/> 4.164 + <property name="work.dir" value="${basedir}"/> 4.165 + <condition property="no.deps"> 4.166 + <and> 4.167 + <istrue value="${no.dependencies}"/> 4.168 + </and> 4.169 + </condition> 4.170 + <property name="javac.debug" value="true"/> 4.171 + <property name="javadoc.preview" value="true"/> 4.172 + <property name="application.args" value=""/> 4.173 + <property name="source.encoding" value="${file.encoding}"/> 4.174 + <property name="runtime.encoding" value="${source.encoding}"/> 4.175 + <condition property="javadoc.encoding.used" value="${javadoc.encoding}"> 4.176 + <and> 4.177 + <isset property="javadoc.encoding"/> 4.178 + <not> 4.179 + <equals arg1="${javadoc.encoding}" arg2=""/> 4.180 + </not> 4.181 + </and> 4.182 + </condition> 4.183 + <property name="javadoc.encoding.used" value="${source.encoding}"/> 4.184 + <property name="includes" value="**"/> 4.185 + <property name="excludes" value=""/> 4.186 + <property name="do.depend" value="false"/> 4.187 + <condition property="do.depend.true"> 4.188 + <istrue value="${do.depend}"/> 4.189 + </condition> 4.190 + <path id="endorsed.classpath.path" path="${endorsed.classpath}"/> 4.191 + <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'"> 4.192 + <length length="0" string="${endorsed.classpath}" when="greater"/> 4.193 + </condition> 4.194 + <condition else="false" property="jdkBug6558476"> 4.195 + <and> 4.196 + <matches pattern="1\.[56]" string="${java.specification.version}"/> 4.197 + <not> 4.198 + <os family="unix"/> 4.199 + </not> 4.200 + </and> 4.201 + </condition> 4.202 + <property name="javac.fork" value="${jdkBug6558476}"/> 4.203 + <property name="jar.index" value="false"/> 4.204 + <property name="jar.index.metainf" value="${jar.index}"/> 4.205 + <property name="copylibs.rebase" value="true"/> 4.206 + <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/> 4.207 + <condition property="junit.available"> 4.208 + <or> 4.209 + <available classname="org.junit.Test" classpath="${run.test.classpath}"/> 4.210 + <available classname="junit.framework.Test" classpath="${run.test.classpath}"/> 4.211 + </or> 4.212 + </condition> 4.213 + <condition property="testng.available"> 4.214 + <available classname="org.testng.annotations.Test" classpath="${run.test.classpath}"/> 4.215 + </condition> 4.216 + <condition property="junit+testng.available"> 4.217 + <and> 4.218 + <istrue value="${junit.available}"/> 4.219 + <istrue value="${testng.available}"/> 4.220 + </and> 4.221 + </condition> 4.222 + <condition else="testng" property="testng.mode" value="mixed"> 4.223 + <istrue value="${junit+testng.available}"/> 4.224 + </condition> 4.225 + <condition else="" property="testng.debug.mode" value="-mixed"> 4.226 + <istrue value="${junit+testng.available}"/> 4.227 + </condition> 4.228 + </target> 4.229 + <target name="-post-init"> 4.230 + <!-- Empty placeholder for easier customization. --> 4.231 + <!-- You can override this target in the ../build.xml file. --> 4.232 + </target> 4.233 + <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check"> 4.234 + <fail unless="src.dir">Must set src.dir</fail> 4.235 + <fail unless="test.src.dir">Must set test.src.dir</fail> 4.236 + <fail unless="build.dir">Must set build.dir</fail> 4.237 + <fail unless="dist.dir">Must set dist.dir</fail> 4.238 + <fail unless="build.classes.dir">Must set build.classes.dir</fail> 4.239 + <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail> 4.240 + <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail> 4.241 + <fail unless="build.test.results.dir">Must set build.test.results.dir</fail> 4.242 + <fail unless="build.classes.excludes">Must set build.classes.excludes</fail> 4.243 + <fail unless="dist.jar">Must set dist.jar</fail> 4.244 + </target> 4.245 + <target name="-init-macrodef-property"> 4.246 + <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1"> 4.247 + <attribute name="name"/> 4.248 + <attribute name="value"/> 4.249 + <sequential> 4.250 + <property name="@{name}" value="${@{value}}"/> 4.251 + </sequential> 4.252 + </macrodef> 4.253 + </target> 4.254 + <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors"> 4.255 + <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3"> 4.256 + <attribute default="${src.dir}" name="srcdir"/> 4.257 + <attribute default="${build.classes.dir}" name="destdir"/> 4.258 + <attribute default="${javac.classpath}" name="classpath"/> 4.259 + <attribute default="${javac.processorpath}" name="processorpath"/> 4.260 + <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/> 4.261 + <attribute default="${includes}" name="includes"/> 4.262 + <attribute default="${excludes}" name="excludes"/> 4.263 + <attribute default="${javac.debug}" name="debug"/> 4.264 + <attribute default="${empty.dir}" name="sourcepath"/> 4.265 + <attribute default="${empty.dir}" name="gensrcdir"/> 4.266 + <element name="customize" optional="true"/> 4.267 + <sequential> 4.268 + <property location="${build.dir}/empty" name="empty.dir"/> 4.269 + <mkdir dir="${empty.dir}"/> 4.270 + <mkdir dir="@{apgeneratedsrcdir}"/> 4.271 + <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}"> 4.272 + <src> 4.273 + <dirset dir="@{gensrcdir}" erroronmissingdir="false"> 4.274 + <include name="*"/> 4.275 + </dirset> 4.276 + </src> 4.277 + <classpath> 4.278 + <path path="@{classpath}"/> 4.279 + </classpath> 4.280 + <compilerarg line="${endorsed.classpath.cmd.line.arg}"/> 4.281 + <compilerarg line="${javac.compilerargs}"/> 4.282 + <compilerarg value="-processorpath"/> 4.283 + <compilerarg path="@{processorpath}:${empty.dir}"/> 4.284 + <compilerarg line="${ap.processors.internal}"/> 4.285 + <compilerarg line="${annotation.processing.processor.options}"/> 4.286 + <compilerarg value="-s"/> 4.287 + <compilerarg path="@{apgeneratedsrcdir}"/> 4.288 + <compilerarg line="${ap.proc.none.internal}"/> 4.289 + <customize/> 4.290 + </javac> 4.291 + </sequential> 4.292 + </macrodef> 4.293 + </target> 4.294 + <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal"> 4.295 + <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3"> 4.296 + <attribute default="${src.dir}" name="srcdir"/> 4.297 + <attribute default="${build.classes.dir}" name="destdir"/> 4.298 + <attribute default="${javac.classpath}" name="classpath"/> 4.299 + <attribute default="${javac.processorpath}" name="processorpath"/> 4.300 + <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/> 4.301 + <attribute default="${includes}" name="includes"/> 4.302 + <attribute default="${excludes}" name="excludes"/> 4.303 + <attribute default="${javac.debug}" name="debug"/> 4.304 + <attribute default="${empty.dir}" name="sourcepath"/> 4.305 + <attribute default="${empty.dir}" name="gensrcdir"/> 4.306 + <element name="customize" optional="true"/> 4.307 + <sequential> 4.308 + <property location="${build.dir}/empty" name="empty.dir"/> 4.309 + <mkdir dir="${empty.dir}"/> 4.310 + <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}"> 4.311 + <src> 4.312 + <dirset dir="@{gensrcdir}" erroronmissingdir="false"> 4.313 + <include name="*"/> 4.314 + </dirset> 4.315 + </src> 4.316 + <classpath> 4.317 + <path path="@{classpath}"/> 4.318 + </classpath> 4.319 + <compilerarg line="${endorsed.classpath.cmd.line.arg}"/> 4.320 + <compilerarg line="${javac.compilerargs}"/> 4.321 + <customize/> 4.322 + </javac> 4.323 + </sequential> 4.324 + </macrodef> 4.325 + </target> 4.326 + <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac"> 4.327 + <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3"> 4.328 + <attribute default="${src.dir}" name="srcdir"/> 4.329 + <attribute default="${build.classes.dir}" name="destdir"/> 4.330 + <attribute default="${javac.classpath}" name="classpath"/> 4.331 + <sequential> 4.332 + <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}"> 4.333 + <classpath> 4.334 + <path path="@{classpath}"/> 4.335 + </classpath> 4.336 + </depend> 4.337 + </sequential> 4.338 + </macrodef> 4.339 + <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3"> 4.340 + <attribute default="${build.classes.dir}" name="destdir"/> 4.341 + <sequential> 4.342 + <fail unless="javac.includes">Must set javac.includes</fail> 4.343 + <pathconvert pathsep="${line.separator}" property="javac.includes.binary"> 4.344 + <path> 4.345 + <filelist dir="@{destdir}" files="${javac.includes}"/> 4.346 + </path> 4.347 + <globmapper from="*.java" to="*.class"/> 4.348 + </pathconvert> 4.349 + <tempfile deleteonexit="true" property="javac.includesfile.binary"/> 4.350 + <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/> 4.351 + <delete> 4.352 + <files includesfile="${javac.includesfile.binary}"/> 4.353 + </delete> 4.354 + <delete> 4.355 + <fileset file="${javac.includesfile.binary}"/> 4.356 + </delete> 4.357 + </sequential> 4.358 + </macrodef> 4.359 + </target> 4.360 + <target if="${junit.available}" name="-init-macrodef-junit-init"> 4.361 + <condition else="false" property="nb.junit.batch" value="true"> 4.362 + <and> 4.363 + <istrue value="${junit.available}"/> 4.364 + <not> 4.365 + <isset property="test.method"/> 4.366 + </not> 4.367 + </and> 4.368 + </condition> 4.369 + <condition else="false" property="nb.junit.single" value="true"> 4.370 + <and> 4.371 + <istrue value="${junit.available}"/> 4.372 + <isset property="test.method"/> 4.373 + </and> 4.374 + </condition> 4.375 + </target> 4.376 + <target if="${nb.junit.single}" name="-init-macrodef-junit-single" unless="${nb.junit.batch}"> 4.377 + <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3"> 4.378 + <attribute default="${includes}" name="includes"/> 4.379 + <attribute default="${excludes}" name="excludes"/> 4.380 + <attribute default="**" name="testincludes"/> 4.381 + <attribute default="" name="testmethods"/> 4.382 + <element name="customize" optional="true"/> 4.383 + <sequential> 4.384 + <property name="junit.forkmode" value="perTest"/> 4.385 + <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}"> 4.386 + <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/> 4.387 + <syspropertyset> 4.388 + <propertyref prefix="test-sys-prop."/> 4.389 + <mapper from="test-sys-prop.*" to="*" type="glob"/> 4.390 + </syspropertyset> 4.391 + <formatter type="brief" usefile="false"/> 4.392 + <formatter type="xml"/> 4.393 + <jvmarg value="-ea"/> 4.394 + <customize/> 4.395 + </junit> 4.396 + </sequential> 4.397 + </macrodef> 4.398 + </target> 4.399 + <target if="${nb.junit.batch}" name="-init-macrodef-junit-batch" unless="${nb.junit.single}"> 4.400 + <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3"> 4.401 + <attribute default="${includes}" name="includes"/> 4.402 + <attribute default="${excludes}" name="excludes"/> 4.403 + <attribute default="**" name="testincludes"/> 4.404 + <attribute default="" name="testmethods"/> 4.405 + <element name="customize" optional="true"/> 4.406 + <sequential> 4.407 + <property name="junit.forkmode" value="perTest"/> 4.408 + <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}"> 4.409 + <batchtest todir="${build.test.results.dir}"> 4.410 + <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}"> 4.411 + <filename name="@{testincludes}"/> 4.412 + </fileset> 4.413 + </batchtest> 4.414 + <syspropertyset> 4.415 + <propertyref prefix="test-sys-prop."/> 4.416 + <mapper from="test-sys-prop.*" to="*" type="glob"/> 4.417 + </syspropertyset> 4.418 + <formatter type="brief" usefile="false"/> 4.419 + <formatter type="xml"/> 4.420 + <jvmarg value="-ea"/> 4.421 + <customize/> 4.422 + </junit> 4.423 + </sequential> 4.424 + </macrodef> 4.425 + </target> 4.426 + <target depends="-init-macrodef-junit-init,-init-macrodef-junit-single, -init-macrodef-junit-batch" if="${junit.available}" name="-init-macrodef-junit"/> 4.427 + <target if="${testng.available}" name="-init-macrodef-testng"> 4.428 + <macrodef name="testng" uri="http://www.netbeans.org/ns/j2se-project/3"> 4.429 + <attribute default="${includes}" name="includes"/> 4.430 + <attribute default="${excludes}" name="excludes"/> 4.431 + <attribute default="**" name="testincludes"/> 4.432 + <attribute default="" name="testmethods"/> 4.433 + <element name="customize" optional="true"/> 4.434 + <sequential> 4.435 + <condition else="" property="testng.methods.arg" value="@{testincludes}.@{testmethods}"> 4.436 + <isset property="test.method"/> 4.437 + </condition> 4.438 + <union id="test.set"> 4.439 + <fileset dir="${test.src.dir}" excludes="@{excludes},**/*.xml,${excludes}" includes="@{includes}"> 4.440 + <filename name="@{testincludes}"/> 4.441 + </fileset> 4.442 + </union> 4.443 + <taskdef classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}" name="testng"/> 4.444 + <testng classfilesetref="test.set" failureProperty="tests.failed" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="Sudoku" testname="TestNG tests" workingDir="${work.dir}"> 4.445 + <xmlfileset dir="${build.test.classes.dir}" includes="@{testincludes}"/> 4.446 + <propertyset> 4.447 + <propertyref prefix="test-sys-prop."/> 4.448 + <mapper from="test-sys-prop.*" to="*" type="glob"/> 4.449 + </propertyset> 4.450 + <customize/> 4.451 + </testng> 4.452 + </sequential> 4.453 + </macrodef> 4.454 + </target> 4.455 + <target name="-init-macrodef-test-impl"> 4.456 + <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3"> 4.457 + <attribute default="${includes}" name="includes"/> 4.458 + <attribute default="${excludes}" name="excludes"/> 4.459 + <attribute default="**" name="testincludes"/> 4.460 + <attribute default="" name="testmethods"/> 4.461 + <element implicit="true" name="customize" optional="true"/> 4.462 + <sequential> 4.463 + <echo>No tests executed.</echo> 4.464 + </sequential> 4.465 + </macrodef> 4.466 + </target> 4.467 + <target depends="-init-macrodef-junit" if="${junit.available}" name="-init-macrodef-junit-impl"> 4.468 + <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3"> 4.469 + <attribute default="${includes}" name="includes"/> 4.470 + <attribute default="${excludes}" name="excludes"/> 4.471 + <attribute default="**" name="testincludes"/> 4.472 + <attribute default="" name="testmethods"/> 4.473 + <element implicit="true" name="customize" optional="true"/> 4.474 + <sequential> 4.475 + <j2seproject3:junit excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}"> 4.476 + <customize/> 4.477 + </j2seproject3:junit> 4.478 + </sequential> 4.479 + </macrodef> 4.480 + </target> 4.481 + <target depends="-init-macrodef-testng" if="${testng.available}" name="-init-macrodef-testng-impl"> 4.482 + <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3"> 4.483 + <attribute default="${includes}" name="includes"/> 4.484 + <attribute default="${excludes}" name="excludes"/> 4.485 + <attribute default="**" name="testincludes"/> 4.486 + <attribute default="" name="testmethods"/> 4.487 + <element implicit="true" name="customize" optional="true"/> 4.488 + <sequential> 4.489 + <j2seproject3:testng excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}"> 4.490 + <customize/> 4.491 + </j2seproject3:testng> 4.492 + </sequential> 4.493 + </macrodef> 4.494 + </target> 4.495 + <target depends="-init-macrodef-test-impl,-init-macrodef-junit-impl,-init-macrodef-testng-impl" name="-init-macrodef-test"> 4.496 + <macrodef name="test" uri="http://www.netbeans.org/ns/j2se-project/3"> 4.497 + <attribute default="${includes}" name="includes"/> 4.498 + <attribute default="${excludes}" name="excludes"/> 4.499 + <attribute default="**" name="testincludes"/> 4.500 + <attribute default="" name="testmethods"/> 4.501 + <sequential> 4.502 + <j2seproject3:test-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}"> 4.503 + <customize> 4.504 + <classpath> 4.505 + <path path="${run.test.classpath}"/> 4.506 + </classpath> 4.507 + <jvmarg line="${endorsed.classpath.cmd.line.arg}"/> 4.508 + <jvmarg line="${run.jvmargs}"/> 4.509 + <jvmarg line="${run.jvmargs.ide}"/> 4.510 + </customize> 4.511 + </j2seproject3:test-impl> 4.512 + </sequential> 4.513 + </macrodef> 4.514 + </target> 4.515 + <target if="${junit.available}" name="-init-macrodef-junit-debug" unless="${nb.junit.batch}"> 4.516 + <macrodef name="junit-debug" uri="http://www.netbeans.org/ns/j2se-project/3"> 4.517 + <attribute default="${includes}" name="includes"/> 4.518 + <attribute default="${excludes}" name="excludes"/> 4.519 + <attribute default="**" name="testincludes"/> 4.520 + <attribute default="" name="testmethods"/> 4.521 + <element name="customize" optional="true"/> 4.522 + <sequential> 4.523 + <property name="junit.forkmode" value="perTest"/> 4.524 + <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}"> 4.525 + <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/> 4.526 + <syspropertyset> 4.527 + <propertyref prefix="test-sys-prop."/> 4.528 + <mapper from="test-sys-prop.*" to="*" type="glob"/> 4.529 + </syspropertyset> 4.530 + <formatter type="brief" usefile="false"/> 4.531 + <formatter type="xml"/> 4.532 + <jvmarg value="-ea"/> 4.533 + <jvmarg line="${debug-args-line}"/> 4.534 + <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/> 4.535 + <customize/> 4.536 + </junit> 4.537 + </sequential> 4.538 + </macrodef> 4.539 + </target> 4.540 + <target if="${nb.junit.batch}" name="-init-macrodef-junit-debug-batch"> 4.541 + <macrodef name="junit-debug" uri="http://www.netbeans.org/ns/j2se-project/3"> 4.542 + <attribute default="${includes}" name="includes"/> 4.543 + <attribute default="${excludes}" name="excludes"/> 4.544 + <attribute default="**" name="testincludes"/> 4.545 + <attribute default="" name="testmethods"/> 4.546 + <element name="customize" optional="true"/> 4.547 + <sequential> 4.548 + <property name="junit.forkmode" value="perTest"/> 4.549 + <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}"> 4.550 + <batchtest todir="${build.test.results.dir}"> 4.551 + <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}"> 4.552 + <filename name="@{testincludes}"/> 4.553 + </fileset> 4.554 + </batchtest> 4.555 + <syspropertyset> 4.556 + <propertyref prefix="test-sys-prop."/> 4.557 + <mapper from="test-sys-prop.*" to="*" type="glob"/> 4.558 + </syspropertyset> 4.559 + <formatter type="brief" usefile="false"/> 4.560 + <formatter type="xml"/> 4.561 + <jvmarg value="-ea"/> 4.562 + <jvmarg line="${debug-args-line}"/> 4.563 + <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/> 4.564 + <customize/> 4.565 + </junit> 4.566 + </sequential> 4.567 + </macrodef> 4.568 + </target> 4.569 + <target depends="-init-macrodef-junit-debug,-init-macrodef-junit-debug-batch" if="${junit.available}" name="-init-macrodef-junit-debug-impl"> 4.570 + <macrodef name="test-debug-impl" uri="http://www.netbeans.org/ns/j2se-project/3"> 4.571 + <attribute default="${includes}" name="includes"/> 4.572 + <attribute default="${excludes}" name="excludes"/> 4.573 + <attribute default="**" name="testincludes"/> 4.574 + <attribute default="" name="testmethods"/> 4.575 + <element implicit="true" name="customize" optional="true"/> 4.576 + <sequential> 4.577 + <j2seproject3:junit-debug excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}"> 4.578 + <customize/> 4.579 + </j2seproject3:junit-debug> 4.580 + </sequential> 4.581 + </macrodef> 4.582 + </target> 4.583 + <target if="${testng.available}" name="-init-macrodef-testng-debug"> 4.584 + <macrodef name="testng-debug" uri="http://www.netbeans.org/ns/j2se-project/3"> 4.585 + <attribute default="${main.class}" name="testClass"/> 4.586 + <attribute default="" name="testMethod"/> 4.587 + <element name="customize2" optional="true"/> 4.588 + <sequential> 4.589 + <condition else="-testclass @{testClass}" property="test.class.or.method" value="-methods @{testClass}.@{testMethod}"> 4.590 + <isset property="test.method"/> 4.591 + </condition> 4.592 + <condition else="-suitename Sudoku -testname @{testClass} ${test.class.or.method}" property="testng.cmd.args" value="@{testClass}"> 4.593 + <matches pattern=".*\.xml" string="@{testClass}"/> 4.594 + </condition> 4.595 + <delete dir="${build.test.results.dir}" quiet="true"/> 4.596 + <mkdir dir="${build.test.results.dir}"/> 4.597 + <j2seproject3:debug classname="org.testng.TestNG" classpath="${debug.test.classpath}"> 4.598 + <customize> 4.599 + <customize2/> 4.600 + <jvmarg value="-ea"/> 4.601 + <arg line="${testng.debug.mode}"/> 4.602 + <arg line="-d ${build.test.results.dir}"/> 4.603 + <arg line="-listener org.testng.reporters.VerboseReporter"/> 4.604 + <arg line="${testng.cmd.args}"/> 4.605 + </customize> 4.606 + </j2seproject3:debug> 4.607 + </sequential> 4.608 + </macrodef> 4.609 + </target> 4.610 + <target depends="-init-macrodef-testng-debug" if="${testng.available}" name="-init-macrodef-testng-debug-impl"> 4.611 + <macrodef name="testng-debug-impl" uri="http://www.netbeans.org/ns/j2se-project/3"> 4.612 + <attribute default="${main.class}" name="testClass"/> 4.613 + <attribute default="" name="testMethod"/> 4.614 + <element implicit="true" name="customize2" optional="true"/> 4.615 + <sequential> 4.616 + <j2seproject3:testng-debug testClass="@{testClass}" testMethod="@{testMethod}"> 4.617 + <customize2/> 4.618 + </j2seproject3:testng-debug> 4.619 + </sequential> 4.620 + </macrodef> 4.621 + </target> 4.622 + <target depends="-init-macrodef-junit-debug-impl" if="${junit.available}" name="-init-macrodef-test-debug-junit"> 4.623 + <macrodef name="test-debug" uri="http://www.netbeans.org/ns/j2se-project/3"> 4.624 + <attribute default="${includes}" name="includes"/> 4.625 + <attribute default="${excludes}" name="excludes"/> 4.626 + <attribute default="**" name="testincludes"/> 4.627 + <attribute default="" name="testmethods"/> 4.628 + <attribute default="${main.class}" name="testClass"/> 4.629 + <attribute default="" name="testMethod"/> 4.630 + <sequential> 4.631 + <j2seproject3:test-debug-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}"> 4.632 + <customize> 4.633 + <classpath> 4.634 + <path path="${run.test.classpath}"/> 4.635 + </classpath> 4.636 + <jvmarg line="${endorsed.classpath.cmd.line.arg}"/> 4.637 + <jvmarg line="${run.jvmargs}"/> 4.638 + <jvmarg line="${run.jvmargs.ide}"/> 4.639 + </customize> 4.640 + </j2seproject3:test-debug-impl> 4.641 + </sequential> 4.642 + </macrodef> 4.643 + </target> 4.644 + <target depends="-init-macrodef-testng-debug-impl" if="${testng.available}" name="-init-macrodef-test-debug-testng"> 4.645 + <macrodef name="test-debug" uri="http://www.netbeans.org/ns/j2se-project/3"> 4.646 + <attribute default="${includes}" name="includes"/> 4.647 + <attribute default="${excludes}" name="excludes"/> 4.648 + <attribute default="**" name="testincludes"/> 4.649 + <attribute default="" name="testmethods"/> 4.650 + <attribute default="${main.class}" name="testClass"/> 4.651 + <attribute default="" name="testMethod"/> 4.652 + <sequential> 4.653 + <j2seproject3:testng-debug-impl testClass="@{testClass}" testMethod="@{testMethod}"> 4.654 + <customize2> 4.655 + <syspropertyset> 4.656 + <propertyref prefix="test-sys-prop."/> 4.657 + <mapper from="test-sys-prop.*" to="*" type="glob"/> 4.658 + </syspropertyset> 4.659 + </customize2> 4.660 + </j2seproject3:testng-debug-impl> 4.661 + </sequential> 4.662 + </macrodef> 4.663 + </target> 4.664 + <target depends="-init-macrodef-test-debug-junit,-init-macrodef-test-debug-testng" name="-init-macrodef-test-debug"/> 4.665 + <!-- 4.666 + pre NB7.2 profiling section; consider it deprecated 4.667 + --> 4.668 + <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" if="profiler.info.jvmargs.agent" name="profile-init"/> 4.669 + <target if="profiler.info.jvmargs.agent" name="-profile-pre-init"> 4.670 + <!-- Empty placeholder for easier customization. --> 4.671 + <!-- You can override this target in the ../build.xml file. --> 4.672 + </target> 4.673 + <target if="profiler.info.jvmargs.agent" name="-profile-post-init"> 4.674 + <!-- Empty placeholder for easier customization. --> 4.675 + <!-- You can override this target in the ../build.xml file. --> 4.676 + </target> 4.677 + <target if="profiler.info.jvmargs.agent" name="-profile-init-macrodef-profile"> 4.678 + <macrodef name="resolve"> 4.679 + <attribute name="name"/> 4.680 + <attribute name="value"/> 4.681 + <sequential> 4.682 + <property name="@{name}" value="${env.@{value}}"/> 4.683 + </sequential> 4.684 + </macrodef> 4.685 + <macrodef name="profile"> 4.686 + <attribute default="${main.class}" name="classname"/> 4.687 + <element name="customize" optional="true"/> 4.688 + <sequential> 4.689 + <property environment="env"/> 4.690 + <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/> 4.691 + <java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}"> 4.692 + <jvmarg line="${endorsed.classpath.cmd.line.arg}"/> 4.693 + <jvmarg value="${profiler.info.jvmargs.agent}"/> 4.694 + <jvmarg line="${profiler.info.jvmargs}"/> 4.695 + <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/> 4.696 + <arg line="${application.args}"/> 4.697 + <classpath> 4.698 + <path path="${run.classpath}"/> 4.699 + </classpath> 4.700 + <syspropertyset> 4.701 + <propertyref prefix="run-sys-prop."/> 4.702 + <mapper from="run-sys-prop.*" to="*" type="glob"/> 4.703 + </syspropertyset> 4.704 + <customize/> 4.705 + </java> 4.706 + </sequential> 4.707 + </macrodef> 4.708 + </target> 4.709 + <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" if="profiler.info.jvmargs.agent" name="-profile-init-check"> 4.710 + <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail> 4.711 + <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail> 4.712 + </target> 4.713 + <!-- 4.714 + end of pre NB7.2 profiling section 4.715 + --> 4.716 + <target depends="-init-debug-args" name="-init-macrodef-nbjpda"> 4.717 + <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1"> 4.718 + <attribute default="${main.class}" name="name"/> 4.719 + <attribute default="${debug.classpath}" name="classpath"/> 4.720 + <attribute default="" name="stopclassname"/> 4.721 + <sequential> 4.722 + <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}"> 4.723 + <classpath> 4.724 + <path path="@{classpath}"/> 4.725 + </classpath> 4.726 + </nbjpdastart> 4.727 + </sequential> 4.728 + </macrodef> 4.729 + <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1"> 4.730 + <attribute default="${build.classes.dir}" name="dir"/> 4.731 + <sequential> 4.732 + <nbjpdareload> 4.733 + <fileset dir="@{dir}" includes="${fix.classes}"> 4.734 + <include name="${fix.includes}*.class"/> 4.735 + </fileset> 4.736 + </nbjpdareload> 4.737 + </sequential> 4.738 + </macrodef> 4.739 + </target> 4.740 + <target name="-init-debug-args"> 4.741 + <property name="version-output" value="java version "${ant.java.version}"/> 4.742 + <condition property="have-jdk-older-than-1.4"> 4.743 + <or> 4.744 + <contains string="${version-output}" substring="java version "1.0"/> 4.745 + <contains string="${version-output}" substring="java version "1.1"/> 4.746 + <contains string="${version-output}" substring="java version "1.2"/> 4.747 + <contains string="${version-output}" substring="java version "1.3"/> 4.748 + </or> 4.749 + </condition> 4.750 + <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none"> 4.751 + <istrue value="${have-jdk-older-than-1.4}"/> 4.752 + </condition> 4.753 + <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem"> 4.754 + <os family="windows"/> 4.755 + </condition> 4.756 + <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}"> 4.757 + <isset property="debug.transport"/> 4.758 + </condition> 4.759 + </target> 4.760 + <target depends="-init-debug-args" name="-init-macrodef-debug"> 4.761 + <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3"> 4.762 + <attribute default="${main.class}" name="classname"/> 4.763 + <attribute default="${debug.classpath}" name="classpath"/> 4.764 + <element name="customize" optional="true"/> 4.765 + <sequential> 4.766 + <java classname="@{classname}" dir="${work.dir}" fork="true"> 4.767 + <jvmarg line="${endorsed.classpath.cmd.line.arg}"/> 4.768 + <jvmarg line="${debug-args-line}"/> 4.769 + <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/> 4.770 + <jvmarg value="-Dfile.encoding=${runtime.encoding}"/> 4.771 + <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/> 4.772 + <jvmarg line="${run.jvmargs}"/> 4.773 + <jvmarg line="${run.jvmargs.ide}"/> 4.774 + <classpath> 4.775 + <path path="@{classpath}"/> 4.776 + </classpath> 4.777 + <syspropertyset> 4.778 + <propertyref prefix="run-sys-prop."/> 4.779 + <mapper from="run-sys-prop.*" to="*" type="glob"/> 4.780 + </syspropertyset> 4.781 + <customize/> 4.782 + </java> 4.783 + </sequential> 4.784 + </macrodef> 4.785 + </target> 4.786 + <target name="-init-macrodef-java"> 4.787 + <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1"> 4.788 + <attribute default="${main.class}" name="classname"/> 4.789 + <attribute default="${run.classpath}" name="classpath"/> 4.790 + <attribute default="jvm" name="jvm"/> 4.791 + <element name="customize" optional="true"/> 4.792 + <sequential> 4.793 + <java classname="@{classname}" dir="${work.dir}" fork="true"> 4.794 + <jvmarg line="${endorsed.classpath.cmd.line.arg}"/> 4.795 + <jvmarg value="-Dfile.encoding=${runtime.encoding}"/> 4.796 + <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/> 4.797 + <jvmarg line="${run.jvmargs}"/> 4.798 + <jvmarg line="${run.jvmargs.ide}"/> 4.799 + <classpath> 4.800 + <path path="@{classpath}"/> 4.801 + </classpath> 4.802 + <syspropertyset> 4.803 + <propertyref prefix="run-sys-prop."/> 4.804 + <mapper from="run-sys-prop.*" to="*" type="glob"/> 4.805 + </syspropertyset> 4.806 + <customize/> 4.807 + </java> 4.808 + </sequential> 4.809 + </macrodef> 4.810 + </target> 4.811 + <target name="-init-macrodef-copylibs"> 4.812 + <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3"> 4.813 + <attribute default="${manifest.file}" name="manifest"/> 4.814 + <element name="customize" optional="true"/> 4.815 + <sequential> 4.816 + <property location="${build.classes.dir}" name="build.classes.dir.resolved"/> 4.817 + <pathconvert property="run.classpath.without.build.classes.dir"> 4.818 + <path path="${run.classpath}"/> 4.819 + <map from="${build.classes.dir.resolved}" to=""/> 4.820 + </pathconvert> 4.821 + <pathconvert pathsep=" " property="jar.classpath"> 4.822 + <path path="${run.classpath.without.build.classes.dir}"/> 4.823 + <chainedmapper> 4.824 + <flattenmapper/> 4.825 + <filtermapper> 4.826 + <replacestring from=" " to="%20"/> 4.827 + </filtermapper> 4.828 + <globmapper from="*" to="lib/*"/> 4.829 + </chainedmapper> 4.830 + </pathconvert> 4.831 + <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/> 4.832 + <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}"> 4.833 + <fileset dir="${build.classes.dir}"/> 4.834 + <manifest> 4.835 + <attribute name="Class-Path" value="${jar.classpath}"/> 4.836 + <customize/> 4.837 + </manifest> 4.838 + </copylibs> 4.839 + </sequential> 4.840 + </macrodef> 4.841 + </target> 4.842 + <target name="-init-presetdef-jar"> 4.843 + <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1"> 4.844 + <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}"> 4.845 + <j2seproject1:fileset dir="${build.classes.dir}"/> 4.846 + </jar> 4.847 + </presetdef> 4.848 + </target> 4.849 + <target name="-init-ap-cmdline-properties"> 4.850 + <property name="annotation.processing.enabled" value="true"/> 4.851 + <property name="annotation.processing.processors.list" value=""/> 4.852 + <property name="annotation.processing.processor.options" value=""/> 4.853 + <property name="annotation.processing.run.all.processors" value="true"/> 4.854 + <property name="javac.processorpath" value="${javac.classpath}"/> 4.855 + <property name="javac.test.processorpath" value="${javac.test.classpath}"/> 4.856 + <condition property="ap.supported.internal" value="true"> 4.857 + <not> 4.858 + <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/> 4.859 + </not> 4.860 + </condition> 4.861 + </target> 4.862 + <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported"> 4.863 + <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}"> 4.864 + <isfalse value="${annotation.processing.run.all.processors}"/> 4.865 + </condition> 4.866 + <condition else="" property="ap.proc.none.internal" value="-proc:none"> 4.867 + <isfalse value="${annotation.processing.enabled}"/> 4.868 + </condition> 4.869 + </target> 4.870 + <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline"> 4.871 + <property name="ap.cmd.line.internal" value=""/> 4.872 + </target> 4.873 + <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-test,-init-macrodef-test-debug,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline" name="init"/> 4.874 + <!-- 4.875 + =================== 4.876 + COMPILATION SECTION 4.877 + =================== 4.878 + --> 4.879 + <target name="-deps-jar-init" unless="built-jar.properties"> 4.880 + <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/> 4.881 + <delete file="${built-jar.properties}" quiet="true"/> 4.882 + </target> 4.883 + <target if="already.built.jar.${basedir}" name="-warn-already-built-jar"> 4.884 + <echo level="warn" message="Cycle detected: Sudoku was already built"/> 4.885 + </target> 4.886 + <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps"> 4.887 + <mkdir dir="${build.dir}"/> 4.888 + <touch file="${built-jar.properties}" verbose="false"/> 4.889 + <property file="${built-jar.properties}" prefix="already.built.jar."/> 4.890 + <antcall target="-warn-already-built-jar"/> 4.891 + <propertyfile file="${built-jar.properties}"> 4.892 + <entry key="${basedir}" value=""/> 4.893 + </propertyfile> 4.894 + </target> 4.895 + <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/> 4.896 + <target depends="init" name="-check-automatic-build"> 4.897 + <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/> 4.898 + </target> 4.899 + <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build"> 4.900 + <antcall target="clean"/> 4.901 + </target> 4.902 + <target depends="init,deps-jar" name="-pre-pre-compile"> 4.903 + <mkdir dir="${build.classes.dir}"/> 4.904 + </target> 4.905 + <target name="-pre-compile"> 4.906 + <!-- Empty placeholder for easier customization. --> 4.907 + <!-- You can override this target in the ../build.xml file. --> 4.908 + </target> 4.909 + <target if="do.depend.true" name="-compile-depend"> 4.910 + <pathconvert property="build.generated.subdirs"> 4.911 + <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false"> 4.912 + <include name="*"/> 4.913 + </dirset> 4.914 + </pathconvert> 4.915 + <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/> 4.916 + </target> 4.917 + <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile"> 4.918 + <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/> 4.919 + <copy todir="${build.classes.dir}"> 4.920 + <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/> 4.921 + </copy> 4.922 + </target> 4.923 + <target if="has.persistence.xml" name="-copy-persistence-xml"> 4.924 + <mkdir dir="${build.classes.dir}/META-INF"/> 4.925 + <copy todir="${build.classes.dir}/META-INF"> 4.926 + <fileset dir="${meta.inf.dir}" includes="persistence.xml"/> 4.927 + </copy> 4.928 + </target> 4.929 + <target name="-post-compile"> 4.930 + <!-- Empty placeholder for easier customization. --> 4.931 + <!-- You can override this target in the ../build.xml file. --> 4.932 + </target> 4.933 + <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/> 4.934 + <target name="-pre-compile-single"> 4.935 + <!-- Empty placeholder for easier customization. --> 4.936 + <!-- You can override this target in the ../build.xml file. --> 4.937 + </target> 4.938 + <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single"> 4.939 + <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail> 4.940 + <j2seproject3:force-recompile/> 4.941 + <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}"/> 4.942 + </target> 4.943 + <target name="-post-compile-single"> 4.944 + <!-- Empty placeholder for easier customization. --> 4.945 + <!-- You can override this target in the ../build.xml file. --> 4.946 + </target> 4.947 + <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/> 4.948 + <!-- 4.949 + ==================== 4.950 + JAR BUILDING SECTION 4.951 + ==================== 4.952 + --> 4.953 + <target depends="init" name="-pre-pre-jar"> 4.954 + <dirname file="${dist.jar}" property="dist.jar.dir"/> 4.955 + <mkdir dir="${dist.jar.dir}"/> 4.956 + </target> 4.957 + <target name="-pre-jar"> 4.958 + <!-- Empty placeholder for easier customization. --> 4.959 + <!-- You can override this target in the ../build.xml file. --> 4.960 + </target> 4.961 + <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available"> 4.962 + <j2seproject1:jar/> 4.963 + </target> 4.964 + <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class-mkdist.available"> 4.965 + <j2seproject1:jar manifest="${manifest.file}"/> 4.966 + </target> 4.967 + <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available"> 4.968 + <j2seproject1:jar manifest="${manifest.file}"> 4.969 + <j2seproject1:manifest> 4.970 + <j2seproject1:attribute name="Main-Class" value="${main.class}"/> 4.971 + </j2seproject1:manifest> 4.972 + </j2seproject1:jar> 4.973 + <echo level="info">To run this application from the command line without Ant, try:</echo> 4.974 + <property location="${build.classes.dir}" name="build.classes.dir.resolved"/> 4.975 + <property location="${dist.jar}" name="dist.jar.resolved"/> 4.976 + <pathconvert property="run.classpath.with.dist.jar"> 4.977 + <path path="${run.classpath}"/> 4.978 + <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/> 4.979 + </pathconvert> 4.980 + <echo level="info">java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo> 4.981 + </target> 4.982 + <target depends="init" if="do.archive" name="-do-jar-with-libraries-create-manifest" unless="manifest.available"> 4.983 + <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/> 4.984 + <touch file="${tmp.manifest.file}" verbose="false"/> 4.985 + </target> 4.986 + <target depends="init" if="do.archive+manifest.available" name="-do-jar-with-libraries-copy-manifest"> 4.987 + <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/> 4.988 + <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/> 4.989 + </target> 4.990 + <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+main.class.available" name="-do-jar-with-libraries-set-main"> 4.991 + <manifest file="${tmp.manifest.file}" mode="update"> 4.992 + <attribute name="Main-Class" value="${main.class}"/> 4.993 + </manifest> 4.994 + </target> 4.995 + <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-with-libraries-set-splashscreen"> 4.996 + <basename file="${application.splash}" property="splashscreen.basename"/> 4.997 + <mkdir dir="${build.classes.dir}/META-INF"/> 4.998 + <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/> 4.999 + <manifest file="${tmp.manifest.file}" mode="update"> 4.1000 + <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/> 4.1001 + </manifest> 4.1002 + </target> 4.1003 + <target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen" if="do.mkdist" name="-do-jar-with-libraries-pack"> 4.1004 + <j2seproject3:copylibs manifest="${tmp.manifest.file}"/> 4.1005 + <echo level="info">To run this application from the command line without Ant, try:</echo> 4.1006 + <property location="${dist.jar}" name="dist.jar.resolved"/> 4.1007 + <echo level="info">java -jar "${dist.jar.resolved}"</echo> 4.1008 + </target> 4.1009 + <target depends="-do-jar-with-libraries-pack" if="do.archive" name="-do-jar-with-libraries-delete-manifest"> 4.1010 + <delete> 4.1011 + <fileset file="${tmp.manifest.file}"/> 4.1012 + </delete> 4.1013 + </target> 4.1014 + <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen,-do-jar-with-libraries-pack,-do-jar-with-libraries-delete-manifest" name="-do-jar-with-libraries"/> 4.1015 + <target name="-post-jar"> 4.1016 + <!-- Empty placeholder for easier customization. --> 4.1017 + <!-- You can override this target in the ../build.xml file. --> 4.1018 + </target> 4.1019 + <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"/> 4.1020 + <!-- 4.1021 + ================= 4.1022 + EXECUTION SECTION 4.1023 + ================= 4.1024 + --> 4.1025 + <target depends="init,compile" description="Run a main class." name="run"> 4.1026 + <j2seproject1:java> 4.1027 + <customize> 4.1028 + <arg line="${application.args}"/> 4.1029 + </customize> 4.1030 + </j2seproject1:java> 4.1031 + </target> 4.1032 + <target name="-do-not-recompile"> 4.1033 + <property name="javac.includes.binary" value=""/> 4.1034 + </target> 4.1035 + <target depends="init,compile-single" name="run-single"> 4.1036 + <fail unless="run.class">Must select one file in the IDE or set run.class</fail> 4.1037 + <j2seproject1:java classname="${run.class}"/> 4.1038 + </target> 4.1039 + <target depends="init,compile-test-single" name="run-test-with-main"> 4.1040 + <fail unless="run.class">Must select one file in the IDE or set run.class</fail> 4.1041 + <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/> 4.1042 + </target> 4.1043 + <!-- 4.1044 + ================= 4.1045 + DEBUGGING SECTION 4.1046 + ================= 4.1047 + --> 4.1048 + <target depends="init" if="netbeans.home" name="-debug-start-debugger"> 4.1049 + <j2seproject1:nbjpdastart name="${debug.class}"/> 4.1050 + </target> 4.1051 + <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test"> 4.1052 + <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/> 4.1053 + </target> 4.1054 + <target depends="init,compile" name="-debug-start-debuggee"> 4.1055 + <j2seproject3:debug> 4.1056 + <customize> 4.1057 + <arg line="${application.args}"/> 4.1058 + </customize> 4.1059 + </j2seproject3:debug> 4.1060 + </target> 4.1061 + <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/> 4.1062 + <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto"> 4.1063 + <j2seproject1:nbjpdastart stopclassname="${main.class}"/> 4.1064 + </target> 4.1065 + <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/> 4.1066 + <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single"> 4.1067 + <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail> 4.1068 + <j2seproject3:debug classname="${debug.class}"/> 4.1069 + </target> 4.1070 + <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/> 4.1071 + <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test"> 4.1072 + <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail> 4.1073 + <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/> 4.1074 + </target> 4.1075 + <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/> 4.1076 + <target depends="init" name="-pre-debug-fix"> 4.1077 + <fail unless="fix.includes">Must set fix.includes</fail> 4.1078 + <property name="javac.includes" value="${fix.includes}.java"/> 4.1079 + </target> 4.1080 + <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix"> 4.1081 + <j2seproject1:nbjpdareload/> 4.1082 + </target> 4.1083 + <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/> 4.1084 + <!-- 4.1085 + ================= 4.1086 + PROFILING SECTION 4.1087 + ================= 4.1088 + --> 4.1089 + <!-- 4.1090 + pre NB7.2 profiler integration 4.1091 + --> 4.1092 + <target depends="profile-init,compile" description="Profile a project in the IDE." if="profiler.info.jvmargs.agent" name="-profile-pre72"> 4.1093 + <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail> 4.1094 + <nbprofiledirect> 4.1095 + <classpath> 4.1096 + <path path="${run.classpath}"/> 4.1097 + </classpath> 4.1098 + </nbprofiledirect> 4.1099 + <profile/> 4.1100 + </target> 4.1101 + <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="profiler.info.jvmargs.agent" name="-profile-single-pre72"> 4.1102 + <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail> 4.1103 + <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail> 4.1104 + <nbprofiledirect> 4.1105 + <classpath> 4.1106 + <path path="${run.classpath}"/> 4.1107 + </classpath> 4.1108 + </nbprofiledirect> 4.1109 + <profile classname="${profile.class}"/> 4.1110 + </target> 4.1111 + <target depends="profile-init,compile-single" if="profiler.info.jvmargs.agent" name="-profile-applet-pre72"> 4.1112 + <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail> 4.1113 + <nbprofiledirect> 4.1114 + <classpath> 4.1115 + <path path="${run.classpath}"/> 4.1116 + </classpath> 4.1117 + </nbprofiledirect> 4.1118 + <profile classname="sun.applet.AppletViewer"> 4.1119 + <customize> 4.1120 + <arg value="${applet.url}"/> 4.1121 + </customize> 4.1122 + </profile> 4.1123 + </target> 4.1124 + <target depends="profile-init,compile-test-single" if="profiler.info.jvmargs.agent" name="-profile-test-single-pre72"> 4.1125 + <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail> 4.1126 + <nbprofiledirect> 4.1127 + <classpath> 4.1128 + <path path="${run.test.classpath}"/> 4.1129 + </classpath> 4.1130 + </nbprofiledirect> 4.1131 + <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true"> 4.1132 + <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/> 4.1133 + <jvmarg value="${profiler.info.jvmargs.agent}"/> 4.1134 + <jvmarg line="${profiler.info.jvmargs}"/> 4.1135 + <test name="${profile.class}"/> 4.1136 + <classpath> 4.1137 + <path path="${run.test.classpath}"/> 4.1138 + </classpath> 4.1139 + <syspropertyset> 4.1140 + <propertyref prefix="test-sys-prop."/> 4.1141 + <mapper from="test-sys-prop.*" to="*" type="glob"/> 4.1142 + </syspropertyset> 4.1143 + <formatter type="brief" usefile="false"/> 4.1144 + <formatter type="xml"/> 4.1145 + </junit> 4.1146 + </target> 4.1147 + <!-- 4.1148 + end of pre NB72 profiling section 4.1149 + --> 4.1150 + <target if="netbeans.home" name="-profile-check"> 4.1151 + <condition property="profiler.configured"> 4.1152 + <or> 4.1153 + <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-agentpath:"/> 4.1154 + <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-javaagent:"/> 4.1155 + </or> 4.1156 + </condition> 4.1157 + </target> 4.1158 + <target depends="-profile-check,-profile-pre72" description="Profile a project in the IDE." if="profiler.configured" name="profile" unless="profiler.info.jvmargs.agent"> 4.1159 + <startprofiler/> 4.1160 + <antcall target="run"/> 4.1161 + </target> 4.1162 + <target depends="-profile-check,-profile-single-pre72" description="Profile a selected class in the IDE." if="profiler.configured" name="profile-single" unless="profiler.info.jvmargs.agent"> 4.1163 + <fail unless="run.class">Must select one file in the IDE or set run.class</fail> 4.1164 + <startprofiler/> 4.1165 + <antcall target="run-single"/> 4.1166 + </target> 4.1167 + <target depends="-profile-test-single-pre72" description="Profile a selected test in the IDE." name="profile-test-single"/> 4.1168 + <target depends="-profile-check" description="Profile a selected test in the IDE." if="profiler.configured" name="profile-test" unless="profiler.info.jvmargs"> 4.1169 + <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail> 4.1170 + <startprofiler/> 4.1171 + <antcall target="test-single"/> 4.1172 + </target> 4.1173 + <target depends="-profile-check" description="Profile a selected class in the IDE." if="profiler.configured" name="profile-test-with-main"> 4.1174 + <fail unless="run.class">Must select one file in the IDE or set run.class</fail> 4.1175 + <startprofiler/> 4.1176 + <antcal target="run-test-with-main"/> 4.1177 + </target> 4.1178 + <target depends="-profile-check,-profile-applet-pre72" if="profiler.configured" name="profile-applet" unless="profiler.info.jvmargs.agent"> 4.1179 + <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail> 4.1180 + <startprofiler/> 4.1181 + <antcall target="run-applet"/> 4.1182 + </target> 4.1183 + <!-- 4.1184 + =============== 4.1185 + JAVADOC SECTION 4.1186 + =============== 4.1187 + --> 4.1188 + <target depends="init" if="have.sources" name="-javadoc-build"> 4.1189 + <mkdir dir="${dist.javadoc.dir}"/> 4.1190 + <condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}"> 4.1191 + <and> 4.1192 + <isset property="endorsed.classpath.cmd.line.arg"/> 4.1193 + <not> 4.1194 + <equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/> 4.1195 + </not> 4.1196 + </and> 4.1197 + </condition> 4.1198 + <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}"> 4.1199 + <classpath> 4.1200 + <path path="${javac.classpath}"/> 4.1201 + </classpath> 4.1202 + <fileset dir="${src.dir}" excludes="*.java,${excludes}" includes="${includes}"> 4.1203 + <filename name="**/*.java"/> 4.1204 + </fileset> 4.1205 + <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false"> 4.1206 + <include name="**/*.java"/> 4.1207 + <exclude name="*.java"/> 4.1208 + </fileset> 4.1209 + <arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/> 4.1210 + </javadoc> 4.1211 + <copy todir="${dist.javadoc.dir}"> 4.1212 + <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}"> 4.1213 + <filename name="**/doc-files/**"/> 4.1214 + </fileset> 4.1215 + <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false"> 4.1216 + <include name="**/doc-files/**"/> 4.1217 + </fileset> 4.1218 + </copy> 4.1219 + </target> 4.1220 + <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview"> 4.1221 + <nbbrowse file="${dist.javadoc.dir}/index.html"/> 4.1222 + </target> 4.1223 + <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/> 4.1224 + <!-- 4.1225 + ========================= 4.1226 + TEST COMPILATION SECTION 4.1227 + ========================= 4.1228 + --> 4.1229 + <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test"> 4.1230 + <mkdir dir="${build.test.classes.dir}"/> 4.1231 + </target> 4.1232 + <target name="-pre-compile-test"> 4.1233 + <!-- Empty placeholder for easier customization. --> 4.1234 + <!-- You can override this target in the ../build.xml file. --> 4.1235 + </target> 4.1236 + <target if="do.depend.true" name="-compile-test-depend"> 4.1237 + <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/> 4.1238 + </target> 4.1239 + <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test"> 4.1240 + <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" processorpath="${javac.test.processorpath}" srcdir="${test.src.dir}"/> 4.1241 + <copy todir="${build.test.classes.dir}"> 4.1242 + <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/> 4.1243 + </copy> 4.1244 + </target> 4.1245 + <target name="-post-compile-test"> 4.1246 + <!-- Empty placeholder for easier customization. --> 4.1247 + <!-- You can override this target in the ../build.xml file. --> 4.1248 + </target> 4.1249 + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/> 4.1250 + <target name="-pre-compile-test-single"> 4.1251 + <!-- Empty placeholder for easier customization. --> 4.1252 + <!-- You can override this target in the ../build.xml file. --> 4.1253 + </target> 4.1254 + <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single"> 4.1255 + <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail> 4.1256 + <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/> 4.1257 + <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" processorpath="${javac.test.processorpath}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}"/> 4.1258 + <copy todir="${build.test.classes.dir}"> 4.1259 + <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/> 4.1260 + </copy> 4.1261 + </target> 4.1262 + <target name="-post-compile-test-single"> 4.1263 + <!-- Empty placeholder for easier customization. --> 4.1264 + <!-- You can override this target in the ../build.xml file. --> 4.1265 + </target> 4.1266 + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/> 4.1267 + <!-- 4.1268 + ======================= 4.1269 + TEST EXECUTION SECTION 4.1270 + ======================= 4.1271 + --> 4.1272 + <target depends="init" if="have.tests" name="-pre-test-run"> 4.1273 + <mkdir dir="${build.test.results.dir}"/> 4.1274 + </target> 4.1275 + <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run"> 4.1276 + <j2seproject3:test testincludes="**/*Test.java"/> 4.1277 + </target> 4.1278 + <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run"> 4.1279 + <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail> 4.1280 + </target> 4.1281 + <target depends="init" if="have.tests" name="test-report"/> 4.1282 + <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/> 4.1283 + <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/> 4.1284 + <target depends="init" if="have.tests" name="-pre-test-run-single"> 4.1285 + <mkdir dir="${build.test.results.dir}"/> 4.1286 + </target> 4.1287 + <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single"> 4.1288 + <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail> 4.1289 + <j2seproject3:test excludes="" includes="${test.includes}" testincludes="${test.includes}"/> 4.1290 + </target> 4.1291 + <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single"> 4.1292 + <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail> 4.1293 + </target> 4.1294 + <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/> 4.1295 + <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single-method"> 4.1296 + <fail unless="test.class">Must select some files in the IDE or set test.class</fail> 4.1297 + <fail unless="test.method">Must select some method in the IDE or set test.method</fail> 4.1298 + <j2seproject3:test excludes="" includes="${javac.includes}" testincludes="${test.class}" testmethods="${test.method}"/> 4.1299 + </target> 4.1300 + <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method" if="have.tests" name="-post-test-run-single-method"> 4.1301 + <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail> 4.1302 + </target> 4.1303 + <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method,-post-test-run-single-method" description="Run single unit test." name="test-single-method"/> 4.1304 + <!-- 4.1305 + ======================= 4.1306 + TEST DEBUGGING SECTION 4.1307 + ======================= 4.1308 + --> 4.1309 + <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test"> 4.1310 + <fail unless="test.class">Must select one file in the IDE or set test.class</fail> 4.1311 + <j2seproject3:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testincludes="${javac.includes}"/> 4.1312 + </target> 4.1313 + <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test-method"> 4.1314 + <fail unless="test.class">Must select one file in the IDE or set test.class</fail> 4.1315 + <fail unless="test.method">Must select some method in the IDE or set test.method</fail> 4.1316 + <j2seproject3:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testMethod="${test.method}" testincludes="${test.class}" testmethods="${test.method}"/> 4.1317 + </target> 4.1318 + <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test"> 4.1319 + <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/> 4.1320 + </target> 4.1321 + <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/> 4.1322 + <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test-method" name="debug-test-method"/> 4.1323 + <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test"> 4.1324 + <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/> 4.1325 + </target> 4.1326 + <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/> 4.1327 + <!-- 4.1328 + ========================= 4.1329 + APPLET EXECUTION SECTION 4.1330 + ========================= 4.1331 + --> 4.1332 + <target depends="init,compile-single" name="run-applet"> 4.1333 + <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail> 4.1334 + <j2seproject1:java classname="sun.applet.AppletViewer"> 4.1335 + <customize> 4.1336 + <arg value="${applet.url}"/> 4.1337 + </customize> 4.1338 + </j2seproject1:java> 4.1339 + </target> 4.1340 + <!-- 4.1341 + ========================= 4.1342 + APPLET DEBUGGING SECTION 4.1343 + ========================= 4.1344 + --> 4.1345 + <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet"> 4.1346 + <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail> 4.1347 + <j2seproject3:debug classname="sun.applet.AppletViewer"> 4.1348 + <customize> 4.1349 + <arg value="${applet.url}"/> 4.1350 + </customize> 4.1351 + </j2seproject3:debug> 4.1352 + </target> 4.1353 + <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/> 4.1354 + <!-- 4.1355 + =============== 4.1356 + CLEANUP SECTION 4.1357 + =============== 4.1358 + --> 4.1359 + <target name="-deps-clean-init" unless="built-clean.properties"> 4.1360 + <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/> 4.1361 + <delete file="${built-clean.properties}" quiet="true"/> 4.1362 + </target> 4.1363 + <target if="already.built.clean.${basedir}" name="-warn-already-built-clean"> 4.1364 + <echo level="warn" message="Cycle detected: Sudoku was already built"/> 4.1365 + </target> 4.1366 + <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps"> 4.1367 + <mkdir dir="${build.dir}"/> 4.1368 + <touch file="${built-clean.properties}" verbose="false"/> 4.1369 + <property file="${built-clean.properties}" prefix="already.built.clean."/> 4.1370 + <antcall target="-warn-already-built-clean"/> 4.1371 + <propertyfile file="${built-clean.properties}"> 4.1372 + <entry key="${basedir}" value=""/> 4.1373 + </propertyfile> 4.1374 + </target> 4.1375 + <target depends="init" name="-do-clean"> 4.1376 + <delete dir="${build.dir}"/> 4.1377 + <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/> 4.1378 + </target> 4.1379 + <target name="-post-clean"> 4.1380 + <!-- Empty placeholder for easier customization. --> 4.1381 + <!-- You can override this target in the ../build.xml file. --> 4.1382 + </target> 4.1383 + <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/> 4.1384 + <target name="-check-call-dep"> 4.1385 + <property file="${call.built.properties}" prefix="already.built."/> 4.1386 + <condition property="should.call.dep"> 4.1387 + <and> 4.1388 + <not> 4.1389 + <isset property="already.built.${call.subproject}"/> 4.1390 + </not> 4.1391 + <available file="${call.script}"/> 4.1392 + </and> 4.1393 + </condition> 4.1394 + </target> 4.1395 + <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep"> 4.1396 + <ant antfile="${call.script}" inheritall="false" target="${call.target}"> 4.1397 + <propertyset> 4.1398 + <propertyref prefix="transfer."/> 4.1399 + <mapper from="transfer.*" to="*" type="glob"/> 4.1400 + </propertyset> 4.1401 + </ant> 4.1402 + </target> 4.1403 +</project>
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 5.2 +++ b/nbproject/genfiles.properties Sat Jan 26 15:48:59 2013 +0100 5.3 @@ -0,0 +1,8 @@ 5.4 +build.xml.data.CRC32=7c7a460d 5.5 +build.xml.script.CRC32=0dfebe00 5.6 +build.xml.stylesheet.CRC32=28e38971@1.53.1.46 5.7 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. 5.8 +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. 5.9 +nbproject/build-impl.xml.data.CRC32=7c7a460d 5.10 +nbproject/build-impl.xml.script.CRC32=2bd010ed 5.11 +nbproject/build-impl.xml.stylesheet.CRC32=6ddba6b6@1.53.1.46
6.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 6.2 +++ b/nbproject/project.properties Sat Jan 26 15:48:59 2013 +0100 6.3 @@ -0,0 +1,71 @@ 6.4 +annotation.processing.enabled=true 6.5 +annotation.processing.enabled.in.editor=false 6.6 +annotation.processing.processor.options= 6.7 +annotation.processing.processors.list= 6.8 +annotation.processing.run.all.processors=true 6.9 +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output 6.10 +build.classes.dir=${build.dir}/classes 6.11 +build.classes.excludes=**/*.java,**/*.form 6.12 +# This directory is removed when the project is cleaned: 6.13 +build.dir=build 6.14 +build.generated.dir=${build.dir}/generated 6.15 +build.generated.sources.dir=${build.dir}/generated-sources 6.16 +# Only compile against the classpath explicitly listed here: 6.17 +build.sysclasspath=ignore 6.18 +build.test.classes.dir=${build.dir}/test/classes 6.19 +build.test.results.dir=${build.dir}/test/results 6.20 +# Uncomment to specify the preferred debugger connection transport: 6.21 +#debug.transport=dt_socket 6.22 +debug.classpath=\ 6.23 + ${run.classpath} 6.24 +debug.test.classpath=\ 6.25 + ${run.test.classpath} 6.26 +# This directory is removed when the project is cleaned: 6.27 +dist.dir=dist 6.28 +dist.jar=${dist.dir}/Sudoku.jar 6.29 +dist.javadoc.dir=${dist.dir}/javadoc 6.30 +excludes= 6.31 +includes=** 6.32 +jar.compress=false 6.33 +javac.classpath= 6.34 +# Space-separated list of extra javac options 6.35 +javac.compilerargs= 6.36 +javac.deprecation=false 6.37 +javac.processorpath=\ 6.38 + ${javac.classpath} 6.39 +javac.source=1.7 6.40 +javac.target=1.7 6.41 +javac.test.classpath=\ 6.42 + ${javac.classpath}:\ 6.43 + ${build.classes.dir} 6.44 +javac.test.processorpath=\ 6.45 + ${javac.test.classpath} 6.46 +javadoc.additionalparam= 6.47 +javadoc.author=false 6.48 +javadoc.encoding=${source.encoding} 6.49 +javadoc.noindex=false 6.50 +javadoc.nonavbar=false 6.51 +javadoc.notree=false 6.52 +javadoc.private=false 6.53 +javadoc.splitindex=true 6.54 +javadoc.use=true 6.55 +javadoc.version=false 6.56 +javadoc.windowtitle= 6.57 +main.class=de.uapcore.sudoku.Sudoku 6.58 +manifest.file=manifest.mf 6.59 +meta.inf.dir=${src.dir}/META-INF 6.60 +mkdist.disabled=false 6.61 +platform.active=default_platform 6.62 +run.classpath=\ 6.63 + ${javac.classpath}:\ 6.64 + ${build.classes.dir} 6.65 +# Space-separated list of JVM arguments used when running the project. 6.66 +# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. 6.67 +# To set system properties for unit tests define test-sys-prop.name=value: 6.68 +run.jvmargs= 6.69 +run.test.classpath=\ 6.70 + ${javac.test.classpath}:\ 6.71 + ${build.test.classes.dir} 6.72 +source.encoding=UTF-8 6.73 +src.dir=src 6.74 +test.src.dir=test
7.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 7.2 +++ b/nbproject/project.xml Sat Jan 26 15:48:59 2013 +0100 7.3 @@ -0,0 +1,15 @@ 7.4 +<?xml version="1.0" encoding="UTF-8"?> 7.5 +<project xmlns="http://www.netbeans.org/ns/project/1"> 7.6 + <type>org.netbeans.modules.java.j2seproject</type> 7.7 + <configuration> 7.8 + <data xmlns="http://www.netbeans.org/ns/j2se-project/3"> 7.9 + <name>Sudoku</name> 7.10 + <source-roots> 7.11 + <root id="src.dir"/> 7.12 + </source-roots> 7.13 + <test-roots> 7.14 + <root id="test.src.dir"/> 7.15 + </test-roots> 7.16 + </data> 7.17 + </configuration> 7.18 +</project>
8.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 8.2 +++ b/src/de/uapcore/sudoku/Field.java Sat Jan 26 15:48:59 2013 +0100 8.3 @@ -0,0 +1,70 @@ 8.4 +package de.uapcore.sudoku; 8.5 + 8.6 +import java.awt.Color; 8.7 +import java.awt.Graphics; 8.8 +import java.awt.Graphics2D; 8.9 +import java.awt.GridBagConstraints; 8.10 +import java.awt.GridBagLayout; 8.11 +import java.awt.Insets; 8.12 +import java.awt.image.BufferedImage; 8.13 +import javax.swing.JPanel; 8.14 + 8.15 +/** 8.16 + * 8.17 + * @author mike 8.18 + */ 8.19 +public class Field extends JPanel { 8.20 + private SudokuTextField[][] cells; 8.21 + 8.22 + public Field() { 8.23 + setBackground(Color.WHITE); 8.24 + 8.25 + setLayout(new GridBagLayout()); 8.26 + GridBagConstraints c = new GridBagConstraints(); 8.27 + c.insets = new Insets(5, 5, 5, 5); 8.28 + 8.29 + cells = new SudokuTextField[9][9]; 8.30 + for (int x = 0 ; x < 9 ; x++) { 8.31 + for (int y = 0 ; y < 9 ; y++) { 8.32 + cells[x][y] = new SudokuTextField(); 8.33 + c.gridx = x; 8.34 + c.gridy = y; 8.35 + add(cells[x][y], c); 8.36 + } 8.37 + } 8.38 + } 8.39 + 8.40 + @Override 8.41 + public void paint(Graphics graphics) { 8.42 + super.paint(graphics); 8.43 + final int w = getWidth(); 8.44 + final int h = getHeight(); 8.45 + final int cw = w / 9; 8.46 + final int ch = h / 9; 8.47 + 8.48 + BufferedImage img = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB); 8.49 + Graphics2D g = img.createGraphics(); 8.50 + g.setBackground(Color.WHITE); 8.51 + g.clearRect(0, 0, w, h); 8.52 + 8.53 + g.setColor(Color.BLACK); 8.54 + g.drawRect(1, 1, w-2, h-2); 8.55 + g.drawRect(2, 2, w-4, h-4); 8.56 + for (int x = cw ; x < w ; x += cw) { 8.57 + for (int y = ch ; y < h ; y += ch) { 8.58 + g.drawLine(x, 2, x, h-2); 8.59 + g.drawLine(2, y, w-2, y); 8.60 + if ((x / cw) % 3 == 0) { 8.61 + g.drawLine(x+1, 2, x+1, h-2); 8.62 + } 8.63 + if ((y / ch) % 3 == 0) { 8.64 + g.drawLine(2, y+1, w-2, y+1); 8.65 + } 8.66 + } 8.67 + } 8.68 + 8.69 + graphics.drawImage(img, 0, 0, this); 8.70 + } 8.71 + 8.72 + 8.73 +}
9.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 9.2 +++ b/src/de/uapcore/sudoku/Sudoku.java Sat Jan 26 15:48:59 2013 +0100 9.3 @@ -0,0 +1,40 @@ 9.4 +package de.uapcore.sudoku; 9.5 + 9.6 +import java.awt.Color; 9.7 +import java.awt.GridBagConstraints; 9.8 +import java.awt.GridBagLayout; 9.9 +import java.awt.Insets; 9.10 +import javax.swing.JFrame; 9.11 +import javax.swing.JRootPane; 9.12 + 9.13 +/** 9.14 + * 9.15 + * @author mike 9.16 + */ 9.17 +public class Sudoku extends JFrame { 9.18 + 9.19 + public Sudoku() { 9.20 + super("Sudoku"); 9.21 + 9.22 + JRootPane root = getRootPane(); 9.23 + 9.24 + root.setLayout(new GridBagLayout()); 9.25 + GridBagConstraints c = new GridBagConstraints(); 9.26 + c.insets = new Insets(20, 20, 20, 20); 9.27 + 9.28 + c.gridx = 0; c.gridy = 0; 9.29 + root.add(new Field(), c); 9.30 + 9.31 + pack(); 9.32 + root.setBackground(Color.WHITE); 9.33 + setLocationByPlatform(true); 9.34 + setDefaultCloseOperation(EXIT_ON_CLOSE); 9.35 + } 9.36 + 9.37 + /** 9.38 + * @param args the command line arguments 9.39 + */ 9.40 + public static void main(String[] args) { 9.41 + new Sudoku().setVisible(true); 9.42 + } 9.43 +}
10.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 10.2 +++ b/src/de/uapcore/sudoku/SudokuTextField.java Sat Jan 26 15:48:59 2013 +0100 10.3 @@ -0,0 +1,71 @@ 10.4 +package de.uapcore.sudoku; 10.5 + 10.6 +import java.awt.Color; 10.7 +import java.awt.Dimension; 10.8 +import java.awt.Font; 10.9 +import java.awt.event.FocusAdapter; 10.10 +import java.awt.event.FocusEvent; 10.11 +import java.awt.event.KeyAdapter; 10.12 +import java.awt.event.KeyEvent; 10.13 +import javax.swing.JTextField; 10.14 + 10.15 +/** 10.16 + * 10.17 + * @author mike 10.18 + */ 10.19 +public class SudokuTextField extends JTextField { 10.20 + 10.21 + public SudokuTextField() { 10.22 + setBorder(null); 10.23 + setBackground(Color.WHITE); 10.24 + 10.25 + setFont(new Font("Dialog", Font.PLAIN, 18)); 10.26 + setHorizontalAlignment(JTextField.CENTER); 10.27 + 10.28 + Dimension dim = new Dimension(40,40); 10.29 + setPreferredSize(dim); 10.30 + setMinimumSize(dim); 10.31 + setMaximumSize(dim); 10.32 + 10.33 + addKeyListener(new KeyAdapter() { 10.34 + private void handle(KeyEvent e) { 10.35 + if (getText().length() > 0) { 10.36 + int c = e.getKeyCode(); 10.37 + if (c != KeyEvent.VK_DELETE && 10.38 + c != KeyEvent.VK_BACK_SPACE && 10.39 + !e.isActionKey()) { 10.40 + e.consume(); 10.41 + } 10.42 + } else { 10.43 + char c = e.getKeyChar(); 10.44 + if (c < '0' || c > '9') { 10.45 + e.consume(); 10.46 + } 10.47 + } 10.48 + } 10.49 + 10.50 + @Override 10.51 + public void keyPressed(KeyEvent e) { 10.52 + handle(e); 10.53 + } 10.54 + 10.55 + @Override 10.56 + public void keyTyped(KeyEvent e) { 10.57 + handle(e); 10.58 + } 10.59 + 10.60 + @Override 10.61 + public void keyReleased(KeyEvent e) { 10.62 + handle(e); 10.63 + } 10.64 + 10.65 + }); 10.66 + addFocusListener(new FocusAdapter() { 10.67 + @Override 10.68 + public void focusGained(FocusEvent e) { 10.69 + selectAll(); 10.70 + } 10.71 + }); 10.72 + } 10.73 + 10.74 +}