diff options
Diffstat (limited to 'testgraphical/ui')
15 files changed, 2653 insertions, 0 deletions
diff --git a/testgraphical/ui/java/ConvwatchGUIProject/build.xml b/testgraphical/ui/java/ConvwatchGUIProject/build.xml new file mode 100644 index 000000000000..e4d82212f35d --- /dev/null +++ b/testgraphical/ui/java/ConvwatchGUIProject/build.xml @@ -0,0 +1,74 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- You may freely edit this file. See commented blocks below for --> +<!-- some examples of how to customize the build. --> +<!-- (If you delete it and reopen the project it will be recreated.) --> +<!-- By default, only the Clean and Build commands use this build script. --> +<!-- Commands such as Run, Debug, and Test only use this build script if --> +<!-- the Compile on Save feature is turned off for the project. --> +<!-- You can turn off the Compile on Save (or Deploy on Save) setting --> +<!-- in the project's Project Properties dialog box.--> +<project name="ConvwatchGUIProject" default="default" basedir="."> + <description>Builds, tests, and runs the project ConvwatchGUIProject.</description> + <import file="nbproject/build-impl.xml"/> + <!-- + + There exist several targets which are by default empty and which can be + used for execution of your tasks. These targets are usually executed + before and after some main targets. They are: + + -pre-init: called before initialization of project properties + -post-init: called after initialization of project properties + -pre-compile: called before javac compilation + -post-compile: called after javac compilation + -pre-compile-single: called before javac compilation of single file + -post-compile-single: called after javac compilation of single file + -pre-compile-test: called before javac compilation of JUnit tests + -post-compile-test: called after javac compilation of JUnit tests + -pre-compile-test-single: called before javac compilation of single JUnit test + -post-compile-test-single: called after javac compilation of single JUunit test + -pre-jar: called before JAR building + -post-jar: called after JAR building + -post-clean: called after cleaning build products + + (Targets beginning with '-' are not intended to be called on their own.) + + Example of inserting an obfuscator after compilation could look like this: + + <target name="-post-compile"> + <obfuscate> + <fileset dir="${build.classes.dir}"/> + </obfuscate> + </target> + + For list of available properties check the imported + nbproject/build-impl.xml file. + + + Another way to customize the build is by overriding existing main targets. + The targets of interest are: + + -init-macrodef-javac: defines macro for javac compilation + -init-macrodef-junit: defines macro for junit execution + -init-macrodef-debug: defines macro for class debugging + -init-macrodef-java: defines macro for class execution + -do-jar-with-manifest: JAR building (if you are using a manifest) + -do-jar-without-manifest: JAR building (if you are not using a manifest) + run: execution of project + -javadoc-build: Javadoc generation + test-report: JUnit report generation + + An example of overriding the target for project execution could look like this: + + <target name="run" depends="ConvwatchGUIProject-impl.jar"> + <exec dir="bin" executable="launcher.exe"> + <arg file="${dist.jar}"/> + </exec> + </target> + + Notice that the overridden target depends on the jar target and not only on + the compile target as the regular run target does. Again, for a list of available + properties which you can use, check the target you are overriding in the + nbproject/build-impl.xml file. + + --> +</project> diff --git a/testgraphical/ui/java/ConvwatchGUIProject/dist/ConvwatchGUIProject.jar b/testgraphical/ui/java/ConvwatchGUIProject/dist/ConvwatchGUIProject.jar Binary files differnew file mode 100644 index 000000000000..3b0ac20afa74 --- /dev/null +++ b/testgraphical/ui/java/ConvwatchGUIProject/dist/ConvwatchGUIProject.jar diff --git a/testgraphical/ui/java/ConvwatchGUIProject/makefile.mk b/testgraphical/ui/java/ConvwatchGUIProject/makefile.mk new file mode 100644 index 000000000000..5cb16f1d4c31 --- /dev/null +++ b/testgraphical/ui/java/ConvwatchGUIProject/makefile.mk @@ -0,0 +1,71 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=../../.. + +PRJNAME=gfxcmp_ui_java_convwatchgui +TARGET=notargetyet + +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk + +# --- ANT build environment --------------------------------------- + +.INCLUDE : antsettings.mk + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk + +.IF "$(SHOW)" == "" +nothing .PHONY: + +.ELSE + + +ALLTAR: dist/ConvwatchGUIProject.jar + +dist/ConvwatchGUIProject.jar: src/ConvwatchGUI.java src/IniFile.java +# .if $(JDK_VERSION) < 160 +# echo "You need at least java 6" +# error +# .endif +# +.IF "$(GUI)"=="WNT" + $(ANT) +.ELSE + ant +.END + +.END + +.INCLUDE : $(PRJ)$/util$/makefile.pmk + +clean: + $(ANT) clean + diff --git a/testgraphical/ui/java/ConvwatchGUIProject/manifest.mf b/testgraphical/ui/java/ConvwatchGUIProject/manifest.mf new file mode 100644 index 000000000000..328e8e5bc3b7 --- /dev/null +++ b/testgraphical/ui/java/ConvwatchGUIProject/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/testgraphical/ui/java/ConvwatchGUIProject/nbproject/build-impl.xml b/testgraphical/ui/java/ConvwatchGUIProject/nbproject/build-impl.xml new file mode 100644 index 000000000000..e493afec4fc3 --- /dev/null +++ b/testgraphical/ui/java/ConvwatchGUIProject/nbproject/build-impl.xml @@ -0,0 +1,805 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +*** GENERATED FROM project.xml - DO NOT EDIT *** +*** EDIT ../build.xml INSTEAD *** + +For the purpose of easier reading the script +is divided into following sections: + + - initialization + - compilation + - jar + - execution + - debugging + - javadoc + - junit compilation + - junit execution + - junit debugging + - applet + - cleanup + + --> +<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="ConvwatchGUIProject-impl"> + <fail message="Please build using Ant 1.7.1 or higher."> + <condition> + <not> + <antversion atleast="1.7.1"/> + </not> + </condition> + </fail> + <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/> + <!-- + ====================== + INITIALIZATION SECTION + ====================== + --> + <target name="-pre-init"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="-pre-init" name="-init-private"> + <property file="nbproject/private/config.properties"/> + <property file="nbproject/private/configs/${config}.properties"/> + <property file="nbproject/private/private.properties"/> + </target> + <target depends="-pre-init,-init-private" name="-init-user"> + <property file="${user.properties.file}"/> + <!-- The two properties below are usually overridden --> + <!-- by the active platform. Just a fallback. --> + <property name="default.javac.source" value="1.4"/> + <property name="default.javac.target" value="1.4"/> + </target> + <target depends="-pre-init,-init-private,-init-user" name="-init-project"> + <property file="nbproject/configs/${config}.properties"/> + <property file="nbproject/project.properties"/> + </target> + <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init"> + <available file="${manifest.file}" property="manifest.available"/> + <condition property="main.class.available"> + <and> + <isset property="main.class"/> + <not> + <equals arg1="${main.class}" arg2="" trim="true"/> + </not> + </and> + </condition> + <condition property="manifest.available+main.class"> + <and> + <isset property="manifest.available"/> + <isset property="main.class.available"/> + </and> + </condition> + <condition property="do.mkdist"> + <and> + <isset property="libs.CopyLibs.classpath"/> + <not> + <istrue value="${mkdist.disabled}"/> + </not> + </and> + </condition> + <condition property="manifest.available+main.class+mkdist.available"> + <and> + <istrue value="${manifest.available+main.class}"/> + <isset property="do.mkdist"/> + </and> + </condition> + <condition property="manifest.available+mkdist.available"> + <and> + <istrue value="${manifest.available}"/> + <isset property="do.mkdist"/> + </and> + </condition> + <condition property="manifest.available-mkdist.available"> + <or> + <istrue value="${manifest.available}"/> + <isset property="do.mkdist"/> + </or> + </condition> + <condition property="manifest.available+main.class-mkdist.available"> + <or> + <istrue value="${manifest.available+main.class}"/> + <isset property="do.mkdist"/> + </or> + </condition> + <condition property="have.tests"> + <or> + <available file="${test.src.dir}"/> + </or> + </condition> + <condition property="have.sources"> + <or> + <available file="${src.dir}"/> + </or> + </condition> + <condition property="netbeans.home+have.tests"> + <and> + <isset property="netbeans.home"/> + <isset property="have.tests"/> + </and> + </condition> + <condition property="no.javadoc.preview"> + <and> + <isset property="javadoc.preview"/> + <isfalse value="${javadoc.preview}"/> + </and> + </condition> + <property name="run.jvmargs" value=""/> + <property name="javac.compilerargs" value=""/> + <property name="work.dir" value="${basedir}"/> + <condition property="no.deps"> + <and> + <istrue value="${no.dependencies}"/> + </and> + </condition> + <property name="javac.debug" value="true"/> + <property name="javadoc.preview" value="true"/> + <property name="application.args" value=""/> + <property name="source.encoding" value="${file.encoding}"/> + <property name="runtime.encoding" value="${source.encoding}"/> + <condition property="javadoc.encoding.used" value="${javadoc.encoding}"> + <and> + <isset property="javadoc.encoding"/> + <not> + <equals arg1="${javadoc.encoding}" arg2=""/> + </not> + </and> + </condition> + <property name="javadoc.encoding.used" value="${source.encoding}"/> + <property name="includes" value="**"/> + <property name="excludes" value=""/> + <property name="do.depend" value="false"/> + <condition property="do.depend.true"> + <istrue value="${do.depend}"/> + </condition> + <path id="endorsed.classpath.path" path="${endorsed.classpath}"/> + <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'"> + <length length="0" string="${endorsed.classpath}" when="greater"/> + </condition> + <property name="javac.fork" value="false"/> + </target> + <target name="-post-init"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check"> + <fail unless="src.dir">Must set src.dir</fail> + <fail unless="test.src.dir">Must set test.src.dir</fail> + <fail unless="build.dir">Must set build.dir</fail> + <fail unless="dist.dir">Must set dist.dir</fail> + <fail unless="build.classes.dir">Must set build.classes.dir</fail> + <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail> + <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail> + <fail unless="build.test.results.dir">Must set build.test.results.dir</fail> + <fail unless="build.classes.excludes">Must set build.classes.excludes</fail> + <fail unless="dist.jar">Must set dist.jar</fail> + </target> + <target name="-init-macrodef-property"> + <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1"> + <attribute name="name"/> + <attribute name="value"/> + <sequential> + <property name="@{name}" value="${@{value}}"/> + </sequential> + </macrodef> + </target> + <target name="-init-macrodef-javac"> + <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute default="${src.dir}" name="srcdir"/> + <attribute default="${build.classes.dir}" name="destdir"/> + <attribute default="${javac.classpath}" name="classpath"/> + <attribute default="${includes}" name="includes"/> + <attribute default="${excludes}" name="excludes"/> + <attribute default="${javac.debug}" name="debug"/> + <attribute default="${empty.dir}" name="sourcepath"/> + <attribute default="${empty.dir}" name="gensrcdir"/> + <element name="customize" optional="true"/> + <sequential> + <property location="${build.dir}/empty" name="empty.dir"/> + <mkdir dir="${empty.dir}"/> + <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}"> + <src> + <dirset dir="@{gensrcdir}" erroronmissingdir="false"> + <include name="*"/> + </dirset> + </src> + <classpath> + <path path="@{classpath}"/> + </classpath> + <compilerarg line="${endorsed.classpath.cmd.line.arg}"/> + <compilerarg line="${javac.compilerargs}"/> + <customize/> + </javac> + </sequential> + </macrodef> + <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute default="${src.dir}" name="srcdir"/> + <attribute default="${build.classes.dir}" name="destdir"/> + <attribute default="${javac.classpath}" name="classpath"/> + <sequential> + <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}"> + <classpath> + <path path="@{classpath}"/> + </classpath> + </depend> + </sequential> + </macrodef> + <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute default="${build.classes.dir}" name="destdir"/> + <sequential> + <fail unless="javac.includes">Must set javac.includes</fail> + <pathconvert pathsep="," property="javac.includes.binary"> + <path> + <filelist dir="@{destdir}" files="${javac.includes}"/> + </path> + <globmapper from="*.java" to="*.class"/> + </pathconvert> + <delete> + <files includes="${javac.includes.binary}"/> + </delete> + </sequential> + </macrodef> + </target> + <target name="-init-macrodef-junit"> + <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute default="${includes}" name="includes"/> + <attribute default="${excludes}" name="excludes"/> + <attribute default="**" name="testincludes"/> + <sequential> + <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true" tempdir="${build.dir}"> + <batchtest todir="${build.test.results.dir}"> + <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}"> + <filename name="@{testincludes}"/> + </fileset> + </batchtest> + <classpath> + <path path="${run.test.classpath}"/> + </classpath> + <syspropertyset> + <propertyref prefix="test-sys-prop."/> + <mapper from="test-sys-prop.*" to="*" type="glob"/> + </syspropertyset> + <formatter type="brief" usefile="false"/> + <formatter type="xml"/> + <jvmarg line="${endorsed.classpath.cmd.line.arg}"/> + <jvmarg line="${run.jvmargs}"/> + </junit> + </sequential> + </macrodef> + </target> + <target depends="-init-debug-args" name="-init-macrodef-nbjpda"> + <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1"> + <attribute default="${main.class}" name="name"/> + <attribute default="${debug.classpath}" name="classpath"/> + <attribute default="" name="stopclassname"/> + <sequential> + <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}"> + <classpath> + <path path="@{classpath}"/> + </classpath> + </nbjpdastart> + </sequential> + </macrodef> + <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1"> + <attribute default="${build.classes.dir}" name="dir"/> + <sequential> + <nbjpdareload> + <fileset dir="@{dir}" includes="${fix.classes}"> + <include name="${fix.includes}*.class"/> + </fileset> + </nbjpdareload> + </sequential> + </macrodef> + </target> + <target name="-init-debug-args"> + <property name="version-output" value="java version "${ant.java.version}"/> + <condition property="have-jdk-older-than-1.4"> + <or> + <contains string="${version-output}" substring="java version "1.0"/> + <contains string="${version-output}" substring="java version "1.1"/> + <contains string="${version-output}" substring="java version "1.2"/> + <contains string="${version-output}" substring="java version "1.3"/> + </or> + </condition> + <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none"> + <istrue value="${have-jdk-older-than-1.4}"/> + </condition> + <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem"> + <os family="windows"/> + </condition> + <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}"> + <isset property="debug.transport"/> + </condition> + </target> + <target depends="-init-debug-args" name="-init-macrodef-debug"> + <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute default="${main.class}" name="classname"/> + <attribute default="${debug.classpath}" name="classpath"/> + <element name="customize" optional="true"/> + <sequential> + <java classname="@{classname}" dir="${work.dir}" fork="true"> + <jvmarg line="${endorsed.classpath.cmd.line.arg}"/> + <jvmarg line="${debug-args-line}"/> + <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/> + <jvmarg value="-Dfile.encoding=${runtime.encoding}"/> + <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/> + <jvmarg line="${run.jvmargs}"/> + <classpath> + <path path="@{classpath}"/> + </classpath> + <syspropertyset> + <propertyref prefix="run-sys-prop."/> + <mapper from="run-sys-prop.*" to="*" type="glob"/> + </syspropertyset> + <customize/> + </java> + </sequential> + </macrodef> + </target> + <target name="-init-macrodef-java"> + <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1"> + <attribute default="${main.class}" name="classname"/> + <attribute default="${run.classpath}" name="classpath"/> + <element name="customize" optional="true"/> + <sequential> + <java classname="@{classname}" dir="${work.dir}" fork="true"> + <jvmarg line="${endorsed.classpath.cmd.line.arg}"/> + <jvmarg value="-Dfile.encoding=${runtime.encoding}"/> + <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/> + <jvmarg line="${run.jvmargs}"/> + <classpath> + <path path="@{classpath}"/> + </classpath> + <syspropertyset> + <propertyref prefix="run-sys-prop."/> + <mapper from="run-sys-prop.*" to="*" type="glob"/> + </syspropertyset> + <customize/> + </java> + </sequential> + </macrodef> + </target> + <target name="-init-presetdef-jar"> + <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1"> + <jar compress="${jar.compress}" jarfile="${dist.jar}"> + <j2seproject1:fileset dir="${build.classes.dir}"/> + </jar> + </presetdef> + </target> + <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"/> + <!-- + =================== + COMPILATION SECTION + =================== + --> + <target name="-deps-jar-init" unless="built-jar.properties"> + <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/> + <delete file="${built-jar.properties}" quiet="true"/> + </target> + <target if="already.built.jar.${basedir}" name="-warn-already-built-jar"> + <echo level="warn" message="Cycle detected: ConvwatchGUIProject was already built"/> + </target> + <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps"> + <mkdir dir="${build.dir}"/> + <touch file="${built-jar.properties}" verbose="false"/> + <property file="${built-jar.properties}" prefix="already.built.jar."/> + <antcall target="-warn-already-built-jar"/> + <propertyfile file="${built-jar.properties}"> + <entry key="${basedir}" value=""/> + </propertyfile> + </target> + <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/> + <target depends="init" name="-check-automatic-build"> + <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/> + </target> + <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build"> + <antcall target="clean"/> + </target> + <target depends="init,deps-jar" name="-pre-pre-compile"> + <mkdir dir="${build.classes.dir}"/> + </target> + <target name="-pre-compile"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target if="do.depend.true" name="-compile-depend"> + <pathconvert property="build.generated.subdirs"> + <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false"> + <include name="*"/> + </dirset> + </pathconvert> + <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/> + </target> + <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-compile-depend" if="have.sources" name="-do-compile"> + <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/> + <copy todir="${build.classes.dir}"> + <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/> + </copy> + </target> + <target name="-post-compile"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/> + <target name="-pre-compile-single"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single"> + <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail> + <j2seproject3:force-recompile/> + <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}"/> + </target> + <target name="-post-compile-single"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/> + <!-- + ==================== + JAR BUILDING SECTION + ==================== + --> + <target depends="init" name="-pre-pre-jar"> + <dirname file="${dist.jar}" property="dist.jar.dir"/> + <mkdir dir="${dist.jar.dir}"/> + </target> + <target name="-pre-jar"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,compile,-pre-pre-jar,-pre-jar" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available"> + <j2seproject1:jar/> + </target> + <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class-mkdist.available"> + <j2seproject1:jar manifest="${manifest.file}"/> + </target> + <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"> + <j2seproject1:jar manifest="${manifest.file}"> + <j2seproject1:manifest> + <j2seproject1:attribute name="Main-Class" value="${main.class}"/> + </j2seproject1:manifest> + </j2seproject1:jar> + <echo>To run this application from the command line without Ant, try:</echo> + <property location="${build.classes.dir}" name="build.classes.dir.resolved"/> + <property location="${dist.jar}" name="dist.jar.resolved"/> + <pathconvert property="run.classpath.with.dist.jar"> + <path path="${run.classpath}"/> + <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/> + </pathconvert> + <echo>java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo> + </target> + <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class+mkdist.available" name="-do-jar-with-libraries"> + <property location="${build.classes.dir}" name="build.classes.dir.resolved"/> + <pathconvert property="run.classpath.without.build.classes.dir"> + <path path="${run.classpath}"/> + <map from="${build.classes.dir.resolved}" to=""/> + </pathconvert> + <pathconvert pathsep=" " property="jar.classpath"> + <path path="${run.classpath.without.build.classes.dir}"/> + <chainedmapper> + <flattenmapper/> + <globmapper from="*" to="lib/*"/> + </chainedmapper> + </pathconvert> + <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/> + <copylibs compress="${jar.compress}" jarfile="${dist.jar}" manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}"> + <fileset dir="${build.classes.dir}"/> + <manifest> + <attribute name="Main-Class" value="${main.class}"/> + <attribute name="Class-Path" value="${jar.classpath}"/> + </manifest> + </copylibs> + <echo>To run this application from the command line without Ant, try:</echo> + <property location="${dist.jar}" name="dist.jar.resolved"/> + <echo>java -jar "${dist.jar.resolved}"</echo> + </target> + <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+mkdist.available" name="-do-jar-with-libraries-without-mainclass" unless="main.class.available"> + <property location="${build.classes.dir}" name="build.classes.dir.resolved"/> + <pathconvert property="run.classpath.without.build.classes.dir"> + <path path="${run.classpath}"/> + <map from="${build.classes.dir.resolved}" to=""/> + </pathconvert> + <pathconvert pathsep=" " property="jar.classpath"> + <path path="${run.classpath.without.build.classes.dir}"/> + <chainedmapper> + <flattenmapper/> + <globmapper from="*" to="lib/*"/> + </chainedmapper> + </pathconvert> + <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/> + <copylibs compress="${jar.compress}" jarfile="${dist.jar}" manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}"> + <fileset dir="${build.classes.dir}"/> + <manifest> + <attribute name="Class-Path" value="${jar.classpath}"/> + </manifest> + </copylibs> + </target> + <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.mkdist" name="-do-jar-with-libraries-without-manifest" unless="manifest.available"> + <property location="${build.classes.dir}" name="build.classes.dir.resolved"/> + <pathconvert property="run.classpath.without.build.classes.dir"> + <path path="${run.classpath}"/> + <map from="${build.classes.dir.resolved}" to=""/> + </pathconvert> + <pathconvert pathsep=" " property="jar.classpath"> + <path path="${run.classpath.without.build.classes.dir}"/> + <chainedmapper> + <flattenmapper/> + <globmapper from="*" to="lib/*"/> + </chainedmapper> + </pathconvert> + <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/> + <copylibs compress="${jar.compress}" jarfile="${dist.jar}" runtimeclasspath="${run.classpath.without.build.classes.dir}"> + <fileset dir="${build.classes.dir}"/> + <manifest> + <attribute name="Class-Path" value="${jar.classpath}"/> + </manifest> + </copylibs> + </target> + <target name="-post-jar"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-do-jar-with-libraries-without-mainclass,-do-jar-with-libraries-without-manifest,-post-jar" description="Build JAR." name="jar"/> + <!-- + ================= + EXECUTION SECTION + ================= + --> + <target depends="init,compile" description="Run a main class." name="run"> + <j2seproject1:java> + <customize> + <arg line="${application.args}"/> + </customize> + </j2seproject1:java> + </target> + <target name="-do-not-recompile"> + <property name="javac.includes.binary" value=""/> + </target> + <target depends="init,compile-single" name="run-single"> + <fail unless="run.class">Must select one file in the IDE or set run.class</fail> + <j2seproject1:java classname="${run.class}"/> + </target> + <target depends="init,compile-test-single" name="run-test-with-main"> + <fail unless="run.class">Must select one file in the IDE or set run.class</fail> + <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/> + </target> + <!-- + ================= + DEBUGGING SECTION + ================= + --> + <target depends="init" if="netbeans.home" name="-debug-start-debugger"> + <j2seproject1:nbjpdastart name="${debug.class}"/> + </target> + <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test"> + <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/> + </target> + <target depends="init,compile" name="-debug-start-debuggee"> + <j2seproject3:debug> + <customize> + <arg line="${application.args}"/> + </customize> + </j2seproject3:debug> + </target> + <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/> + <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto"> + <j2seproject1:nbjpdastart stopclassname="${main.class}"/> + </target> + <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/> + <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single"> + <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail> + <j2seproject3:debug classname="${debug.class}"/> + </target> + <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/> + <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test"> + <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail> + <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/> + </target> + <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/> + <target depends="init" name="-pre-debug-fix"> + <fail unless="fix.includes">Must set fix.includes</fail> + <property name="javac.includes" value="${fix.includes}.java"/> + </target> + <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix"> + <j2seproject1:nbjpdareload/> + </target> + <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/> + <!-- + =============== + JAVADOC SECTION + =============== + --> + <target depends="init" name="-javadoc-build"> + <mkdir dir="${dist.javadoc.dir}"/> + <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}"> + <classpath> + <path path="${javac.classpath}"/> + </classpath> + <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}"> + <filename name="**/*.java"/> + </fileset> + <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false"> + <include name="**/*.java"/> + </fileset> + </javadoc> + </target> + <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview"> + <nbbrowse file="${dist.javadoc.dir}/index.html"/> + </target> + <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/> + <!-- + ========================= + JUNIT COMPILATION SECTION + ========================= + --> + <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test"> + <mkdir dir="${build.test.classes.dir}"/> + </target> + <target name="-pre-compile-test"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target if="do.depend.true" name="-compile-test-depend"> + <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/> + </target> + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test"> + <j2seproject3:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/> + <copy todir="${build.test.classes.dir}"> + <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/> + </copy> + </target> + <target name="-post-compile-test"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/> + <target name="-pre-compile-test-single"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single"> + <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail> + <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/> + <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}"/> + <copy todir="${build.test.classes.dir}"> + <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/> + </copy> + </target> + <target name="-post-compile-test-single"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/> + <!-- + ======================= + JUNIT EXECUTION SECTION + ======================= + --> + <target depends="init" if="have.tests" name="-pre-test-run"> + <mkdir dir="${build.test.results.dir}"/> + </target> + <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run"> + <j2seproject3:junit testincludes="**/*Test.java"/> + </target> + <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run"> + <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail> + </target> + <target depends="init" if="have.tests" name="test-report"/> + <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/> + <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/> + <target depends="init" if="have.tests" name="-pre-test-run-single"> + <mkdir dir="${build.test.results.dir}"/> + </target> + <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single"> + <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail> + <j2seproject3:junit excludes="" includes="${test.includes}"/> + </target> + <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single"> + <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail> + </target> + <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"/> + <!-- + ======================= + JUNIT DEBUGGING SECTION + ======================= + --> + <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test"> + <fail unless="test.class">Must select one file in the IDE or set test.class</fail> + <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/> + <delete file="${test.report.file}"/> + <mkdir dir="${build.test.results.dir}"/> + <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}"> + <customize> + <syspropertyset> + <propertyref prefix="test-sys-prop."/> + <mapper from="test-sys-prop.*" to="*" type="glob"/> + </syspropertyset> + <arg value="${test.class}"/> + <arg value="showoutput=true"/> + <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/> + <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/> + </customize> + </j2seproject3:debug> + </target> + <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test"> + <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/> + </target> + <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/> + <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test"> + <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/> + </target> + <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/> + <!-- + ========================= + APPLET EXECUTION SECTION + ========================= + --> + <target depends="init,compile-single" name="run-applet"> + <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail> + <j2seproject1:java classname="sun.applet.AppletViewer"> + <customize> + <arg value="${applet.url}"/> + </customize> + </j2seproject1:java> + </target> + <!-- + ========================= + APPLET DEBUGGING SECTION + ========================= + --> + <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet"> + <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail> + <j2seproject3:debug classname="sun.applet.AppletViewer"> + <customize> + <arg value="${applet.url}"/> + </customize> + </j2seproject3:debug> + </target> + <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/> + <!-- + =============== + CLEANUP SECTION + =============== + --> + <target name="-deps-clean-init" unless="built-clean.properties"> + <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/> + <delete file="${built-clean.properties}" quiet="true"/> + </target> + <target if="already.built.clean.${basedir}" name="-warn-already-built-clean"> + <echo level="warn" message="Cycle detected: ConvwatchGUIProject was already built"/> + </target> + <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps"> + <mkdir dir="${build.dir}"/> + <touch file="${built-clean.properties}" verbose="false"/> + <property file="${built-clean.properties}" prefix="already.built.clean."/> + <antcall target="-warn-already-built-clean"/> + <propertyfile file="${built-clean.properties}"> + <entry key="${basedir}" value=""/> + </propertyfile> + </target> + <target depends="init" name="-do-clean"> + <delete dir="${build.dir}"/> + <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/> + </target> + <target name="-post-clean"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/> + <target name="-check-call-dep"> + <property file="${call.built.properties}" prefix="already.built."/> + <condition property="should.call.dep"> + <not> + <isset property="already.built.${call.subproject}"/> + </not> + </condition> + </target> + <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep"> + <ant antfile="${call.script}" inheritall="false" target="${call.target}"> + <propertyset> + <propertyref prefix="transfer."/> + <mapper from="transfer.*" to="*" type="glob"/> + </propertyset> + </ant> + </target> +</project> diff --git a/testgraphical/ui/java/ConvwatchGUIProject/nbproject/genfiles.properties b/testgraphical/ui/java/ConvwatchGUIProject/nbproject/genfiles.properties new file mode 100644 index 000000000000..9f120781c97e --- /dev/null +++ b/testgraphical/ui/java/ConvwatchGUIProject/nbproject/genfiles.properties @@ -0,0 +1,9 @@ +# x-no-translate +build.xml.data.CRC32=d17eccb2 +build.xml.script.CRC32=a183e208 +build.xml.stylesheet.CRC32=958a1d3e@1.32.1.45 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=d17eccb2 +nbproject/build-impl.xml.script.CRC32=ea0e5dc9 +nbproject/build-impl.xml.stylesheet.CRC32=576378a2@1.32.1.45 diff --git a/testgraphical/ui/java/ConvwatchGUIProject/nbproject/private/config.properties b/testgraphical/ui/java/ConvwatchGUIProject/nbproject/private/config.properties new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/testgraphical/ui/java/ConvwatchGUIProject/nbproject/private/config.properties diff --git a/testgraphical/ui/java/ConvwatchGUIProject/nbproject/private/private.properties b/testgraphical/ui/java/ConvwatchGUIProject/nbproject/private/private.properties new file mode 100644 index 000000000000..23e517d892d7 --- /dev/null +++ b/testgraphical/ui/java/ConvwatchGUIProject/nbproject/private/private.properties @@ -0,0 +1,8 @@ +# x-no-translate +application.args=D:\\sources\\gfxcmp02\\DEV300\\ooo\\testgraphical\\wntmsci12.pro\\misc\\CurrentTime.ods.ps.ini +compile.on.save=true +do.depend=false +do.jar=true +javac.debug=true +javadoc.preview=true +user.properties.file=C:\\Documents and Settings\\ll93751\\.netbeans\\6.8\\build.properties diff --git a/testgraphical/ui/java/ConvwatchGUIProject/nbproject/private/private.xml b/testgraphical/ui/java/ConvwatchGUIProject/nbproject/private/private.xml new file mode 100644 index 000000000000..c1f155a782bd --- /dev/null +++ b/testgraphical/ui/java/ConvwatchGUIProject/nbproject/private/private.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project-private xmlns="http://www.netbeans.org/ns/project-private/1"> + <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/1"/> +</project-private> diff --git a/testgraphical/ui/java/ConvwatchGUIProject/nbproject/project.properties b/testgraphical/ui/java/ConvwatchGUIProject/nbproject/project.properties new file mode 100644 index 000000000000..3a6731d3bcf6 --- /dev/null +++ b/testgraphical/ui/java/ConvwatchGUIProject/nbproject/project.properties @@ -0,0 +1,72 @@ +# x-no-translate +application.desc=This Program shows three pictures in one line. +application.title=ConvwatchGUIProject +application.vendor=Oracle and/or its affiliates +build.classes.dir=${build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +# This directory is removed when the project is cleaned: +build.dir=build +build.generated.dir=${build.dir}/generated +build.generated.sources.dir=${build.dir}/generated-sources +# Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +# Uncomment to specify the preferred debugger connection transport: +#debug.transport=dt_socket +debug.classpath=\ + ${run.classpath} +debug.test.classpath=\ + ${run.test.classpath} +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/ConvwatchGUIProject.jar +dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.source=1.5 +javac.target=1.5 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir}:\ + ${libs.junit.classpath}:\ + ${libs.junit_4.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +jnlp.codebase.type=local +jnlp.descriptor=application +jnlp.enabled=false +jnlp.offline-allowed=false +jnlp.signed=false +main.class=ConvwatchGUI +manifest.file=manifest.mf +meta.inf.dir=${src.dir}/META-INF +platform.active=default_platform +run.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +# Space-separated list of JVM arguments used when running the project +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value +# or test-sys-prop.name=value to set system properties for unit tests): +run.jvmargs= +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/testgraphical/ui/java/ConvwatchGUIProject/nbproject/project.xml b/testgraphical/ui/java/ConvwatchGUIProject/nbproject/project.xml new file mode 100644 index 000000000000..0bc513904c86 --- /dev/null +++ b/testgraphical/ui/java/ConvwatchGUIProject/nbproject/project.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://www.netbeans.org/ns/project/1"> + <type>org.netbeans.modules.java.j2seproject</type> + <configuration> + <data xmlns="http://www.netbeans.org/ns/j2se-project/3"> + <name>ConvwatchGUIProject</name> + <source-roots> + <root id="src.dir"/> + </source-roots> + <test-roots> + <root id="test.src.dir"/> + </test-roots> + </data> + </configuration> +</project> diff --git a/testgraphical/ui/java/ConvwatchGUIProject/src/ConvwatchGUI.form b/testgraphical/ui/java/ConvwatchGUIProject/src/ConvwatchGUI.form new file mode 100644 index 000000000000..ad0552d1efd5 --- /dev/null +++ b/testgraphical/ui/java/ConvwatchGUIProject/src/ConvwatchGUI.form @@ -0,0 +1,286 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.3" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> + <Properties> + <Property name="defaultCloseOperation" type="int" value="3"/> + </Properties> + <SyntheticProperties> + <SyntheticProperty name="formSizePolicy" type="int" value="1"/> + </SyntheticProperties> + <Events> + <EventHandler event="componentResized" listener="java.awt.event.ComponentListener" parameters="java.awt.event.ComponentEvent" handler="formComponentResized"/> + <EventHandler event="propertyChange" listener="java.beans.PropertyChangeListener" parameters="java.beans.PropertyChangeEvent" handler="formPropertyChange"/> + </Events> + <AuxValues> + <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + </AuxValues> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="jPanel5" alignment="0" max="32767" attributes="0"/> + <Component id="jPanel4" alignment="0" max="32767" attributes="0"/> + <Group type="102" alignment="1" attributes="0"> + <Component id="jPanelOriginal" max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jPanelReference" max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jPanelDifference" max="32767" attributes="0"/> + </Group> + </Group> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jPanel5" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="jPanelReference" alignment="1" max="32767" attributes="1"/> + <Component id="jPanelOriginal" alignment="1" max="32767" attributes="1"/> + <Component id="jPanelDifference" alignment="0" max="32767" attributes="1"/> + </Group> + <EmptySpace min="-2" max="-2" attributes="0"/> + <Component id="jPanel4" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Container class="javax.swing.JPanel" name="jPanelOriginal"> + <Properties> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo"> + <TitledBorder title="Picture"/> + </Border> + </Property> + </Properties> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jLabelOriginalImage" pref="299" max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabelOriginalImage" pref="514" max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabelOriginalImage"> + </Component> + </SubComponents> + </Container> + <Container class="javax.swing.JPanel" name="jPanelReference"> + <Properties> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo"> + <TitledBorder title="Reference Picture"/> + </Border> + </Property> + </Properties> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jLabelReferenceImage" pref="299" max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabelReferenceImage" pref="514" max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabelReferenceImage"> + </Component> + </SubComponents> + </Container> + <Container class="javax.swing.JPanel" name="jPanelDifference"> + <Properties> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo"> + <TitledBorder title="Difference"/> + </Border> + </Property> + </Properties> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jLabelDifferenceImage" pref="298" max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabelDifferenceImage" pref="514" max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabelDifferenceImage"> + <Properties> + <Property name="name" type="java.lang.String" value="DifferenceImage" noResource="true"/> + </Properties> + </Component> + </SubComponents> + </Container> + <Container class="javax.swing.JPanel" name="jPanel4"> + <Properties> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo"> + <TitledBorder title="Action"/> + </Border> + </Property> + </Properties> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jButton2" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jButton3" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="jLabelCurrentPage" min="-2" pref="107" max="-2" attributes="0"/> + <EmptySpace pref="614" max="32767" attributes="0"/> + <Component id="jButton1" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="32767" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jButton1" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jButton2" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jButton3" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabelCurrentPage" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JButton" name="jButton1"> + <Properties> + <Property name="text" type="java.lang.String" value="Close"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="jButton2"> + <Properties> + <Property name="label" type="java.lang.String" value="prev page"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton2ActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="jButton3"> + <Properties> + <Property name="label" type="java.lang.String" value="next page"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton3ActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="jLabelCurrentPage"> + <Properties> + <Property name="text" type="java.lang.String" value="Current page: 1"/> + </Properties> + </Component> + </SubComponents> + </Container> + <Container class="javax.swing.JPanel" name="jPanel5"> + <Properties> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo"> + <TitledBorder title="Information"/> + </Border> + </Property> + </Properties> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="jLabel1" alignment="0" pref="972" max="32767" attributes="0"/> + <Component id="jLabelDocumentName" alignment="0" pref="972" max="32767" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel1" pref="50" max="32767" attributes="0"/> + <EmptySpace min="-2" max="-2" attributes="0"/> + <Component id="jLabelDocumentName" min="-2" pref="19" max="-2" attributes="0"/> + <EmptySpace min="-2" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel1"> + <Properties> + <Property name="text" type="java.lang.String" value="<html>Here you see a graphical compare by pictures created with a current running office, a stored reference picture and the difference between those both pictures created by ImageMagicks 'composite'.
</html>" noResource="true"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabelDocumentName"> + <Properties> + <Property name="text" type="java.lang.String" value="jLabel2"/> + </Properties> + </Component> + </SubComponents> + </Container> + </SubComponents> +</Form> diff --git a/testgraphical/ui/java/ConvwatchGUIProject/src/ConvwatchGUI.java b/testgraphical/ui/java/ConvwatchGUIProject/src/ConvwatchGUI.java new file mode 100644 index 000000000000..625e7b80c6e0 --- /dev/null +++ b/testgraphical/ui/java/ConvwatchGUIProject/src/ConvwatchGUI.java @@ -0,0 +1,535 @@ + +import java.awt.Dimension; +import java.awt.Image; +import java.io.File; +import javax.swing.ImageIcon; +import javax.swing.JLabel; +import javax.swing.SwingWorker; + +/* +************************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +************************************************************************** + */ + +/* + * Simple windows, which should show differences if there are some + */ + +public class ConvwatchGUI extends javax.swing.JFrame +{ + private ImageIcon[] m_aImageIcon; + private String m_sInifile; + private int m_nMaxPages; + private int m_nCurrentPage; + + /** Creates new form ConvwatchGUI + * @param args + */ + + private ConvwatchGUI(String args[]) + { + if (args.length > 0) + { + if (args[0].endsWith(".ini")) + { + m_sInifile = args[0]; + fillImageIconsFromInifile(); + } + else + { + fillImageIcons(args); + } + } + + String sVersion = System.getProperty("java.version"); + Float f = Float.valueOf(sVersion.substring(0,3)); + if (f.floatValue() < (float)1.6) + { + System.out.println("You need at least Java version 1.6"); + System.exit(1); + } + + initComponents(); + jLabelDocumentName.setText("Document: " + m_sInifile); + } + + void fillImageIconsFromInifile() + { + File aFile = new File(m_sInifile); + if (!aFile.exists()) + { + GlobalLogWriter.println("Inifile '" + m_sInifile + "' not found."); + printUsage(); + System.exit(1); + } + + IniFile aIniFile = new IniFile(aFile); + int nPages = aIniFile.getIntValue("global", "pages", 0); + if (nPages < 1) + { + System.out.println("No pages found."); + } + m_nMaxPages = nPages; + m_nCurrentPage = 1; + fillImageIcons(); + } + + private void fillImageIcons() + { + File aFile = new File(m_sInifile); + IniFile aIniFile = new IniFile(aFile); + String sSection = "page" + m_nCurrentPage; + String[] files = new String[3]; + files[0] = aIniFile.getValue(sSection, "newgfx"); // current created picture + files[1] = aIniFile.getValue(sSection, "oldgfx"); // reference picture + files[2] = aIniFile.getValue(sSection, "diffgfx"); + fillImageIcons(files); + } + + /** + * Give 3 file names + * @param args + */ + private void fillImageIcons(String args[]) + { + boolean bLoadImages = false; + m_aImageIcon = new ImageIcon[3]; + for (int i=0;i<3;i++) + { + if (args.length > i && args[i] != null) + { + File aFile = new File(args[i]); + if (aFile.exists()) + { + // TODO: Load images + // Image aImage = new BufferedImage(100,100, BufferedImage.TYPE_INT_RGB); + // aImage. + m_aImageIcon[i] = new ImageIcon(args[i]); + if (m_aImageIcon[i] != null) + { + bLoadImages = true; + } + } + else + { + System.out.println("Can't read file: " + aFile.getName()); + bLoadImages = false; + } + } + else + { + System.out.println("There is no #" + (i + 1) + " image given."); + bLoadImages = false; + } + } +// if (!bLoadImages) +// { +// printUsage(); +// System.exit(1); +// } + + + + // TODO: Set images. + + // formComponentResized(null); + } + + private void printUsage() + { + System.out.println("Usage:"); + System.out.println(" ConvwatchGUI <pic1> <pic2> <pic3>"); + System.out.println("or ConvwatchGUI <inifile>"); + } + +// private int m_nOldWidth; + + /** This method is called from within the constructor to + * initialize the form. + * WARNING: Do NOT modify this code. The content of this method is + * always regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents + private void initComponents() { + + jPanelOriginal = new javax.swing.JPanel(); + jLabelOriginalImage = new javax.swing.JLabel(); + jPanelReference = new javax.swing.JPanel(); + jLabelReferenceImage = new javax.swing.JLabel(); + jPanelDifference = new javax.swing.JPanel(); + jLabelDifferenceImage = new javax.swing.JLabel(); + jPanel4 = new javax.swing.JPanel(); + jButton1 = new javax.swing.JButton(); + jButton2 = new javax.swing.JButton(); + jButton3 = new javax.swing.JButton(); + jLabelCurrentPage = new javax.swing.JLabel(); + jPanel5 = new javax.swing.JPanel(); + jLabel1 = new javax.swing.JLabel(); + jLabelDocumentName = new javax.swing.JLabel(); + + setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); + addComponentListener(new java.awt.event.ComponentAdapter() { + public void componentResized(java.awt.event.ComponentEvent evt) { + formComponentResized(evt); + } + }); + addPropertyChangeListener(new java.beans.PropertyChangeListener() { + public void propertyChange(java.beans.PropertyChangeEvent evt) { + formPropertyChange(evt); + } + }); + + jPanelOriginal.setBorder(javax.swing.BorderFactory.createTitledBorder("Picture")); + + javax.swing.GroupLayout jPanelOriginalLayout = new javax.swing.GroupLayout(jPanelOriginal); + jPanelOriginal.setLayout(jPanelOriginalLayout); + jPanelOriginalLayout.setHorizontalGroup( + jPanelOriginalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelOriginalLayout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabelOriginalImage, javax.swing.GroupLayout.DEFAULT_SIZE, 299, Short.MAX_VALUE) + .addContainerGap()) + ); + jPanelOriginalLayout.setVerticalGroup( + jPanelOriginalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelOriginalLayout.createSequentialGroup() + .addComponent(jLabelOriginalImage, javax.swing.GroupLayout.DEFAULT_SIZE, 514, Short.MAX_VALUE) + .addContainerGap()) + ); + + jPanelReference.setBorder(javax.swing.BorderFactory.createTitledBorder("Reference Picture")); + + javax.swing.GroupLayout jPanelReferenceLayout = new javax.swing.GroupLayout(jPanelReference); + jPanelReference.setLayout(jPanelReferenceLayout); + jPanelReferenceLayout.setHorizontalGroup( + jPanelReferenceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelReferenceLayout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabelReferenceImage, javax.swing.GroupLayout.DEFAULT_SIZE, 299, Short.MAX_VALUE) + .addContainerGap()) + ); + jPanelReferenceLayout.setVerticalGroup( + jPanelReferenceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelReferenceLayout.createSequentialGroup() + .addComponent(jLabelReferenceImage, javax.swing.GroupLayout.DEFAULT_SIZE, 514, Short.MAX_VALUE) + .addContainerGap()) + ); + + jPanelDifference.setBorder(javax.swing.BorderFactory.createTitledBorder("Difference")); + + jLabelDifferenceImage.setName("DifferenceImage"); // NOI18N + + javax.swing.GroupLayout jPanelDifferenceLayout = new javax.swing.GroupLayout(jPanelDifference); + jPanelDifference.setLayout(jPanelDifferenceLayout); + jPanelDifferenceLayout.setHorizontalGroup( + jPanelDifferenceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelDifferenceLayout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabelDifferenceImage, javax.swing.GroupLayout.DEFAULT_SIZE, 298, Short.MAX_VALUE) + .addContainerGap()) + ); + jPanelDifferenceLayout.setVerticalGroup( + jPanelDifferenceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelDifferenceLayout.createSequentialGroup() + .addComponent(jLabelDifferenceImage, javax.swing.GroupLayout.DEFAULT_SIZE, 514, Short.MAX_VALUE) + .addContainerGap()) + ); + + jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder("Action")); + + jButton1.setText("Close"); + jButton1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton1ActionPerformed(evt); + } + }); + + jButton2.setLabel("prev page"); + jButton2.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton2ActionPerformed(evt); + } + }); + + jButton3.setLabel("next page"); + jButton3.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton3ActionPerformed(evt); + } + }); + + jLabelCurrentPage.setText("Current page: 1"); + + javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4); + jPanel4.setLayout(jPanel4Layout); + jPanel4Layout.setHorizontalGroup( + jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup() + .addContainerGap() + .addComponent(jButton2) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jButton3) + .addGap(18, 18, 18) + .addComponent(jLabelCurrentPage, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 614, Short.MAX_VALUE) + .addComponent(jButton1) + .addContainerGap()) + ); + jPanel4Layout.setVerticalGroup( + jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup() + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jButton1) + .addComponent(jButton2) + .addComponent(jButton3) + .addComponent(jLabelCurrentPage)) + .addContainerGap()) + ); + + jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder("Information")); + + jLabel1.setText("<html>Here you see a graphical compare by pictures created with a current running office, a stored reference picture and the difference between those both pictures created by ImageMagicks 'composite'.\n</html>"); // NOI18N + + jLabelDocumentName.setText("jLabel2"); + + javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5); + jPanel5.setLayout(jPanel5Layout); + jPanel5Layout.setHorizontalGroup( + jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 972, Short.MAX_VALUE) + .addComponent(jLabelDocumentName, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 972, Short.MAX_VALUE)) + .addContainerGap()) + ); + jPanel5Layout.setVerticalGroup( + jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel5Layout.createSequentialGroup() + .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 50, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabelDocumentName, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap()) + ); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addContainerGap() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jPanel5, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jPanel4, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(layout.createSequentialGroup() + .addComponent(jPanelOriginal, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jPanelReference, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jPanelDifference, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) + .addContainerGap()) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addContainerGap() + .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jPanelReference, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jPanelOriginal, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jPanelDifference, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap()) + ); + + pack(); + }// </editor-fold>//GEN-END:initComponents + + private boolean bAdd = false; + + private void formComponentResized(java.awt.event.ComponentEvent evt)//GEN-FIRST:event_formComponentResized + {//GEN-HEADEREND:event_formComponentResized + // TODO add your handling code here: + // we need to set icons to null + // if we don't do this, icons can only grow, but not shrink :-( + + initialiseImages(); + } + private void initialiseImages() + { + if (jLabelOriginalImage.getIcon() != null) + { + jLabelOriginalImage.setIcon(null); + jLabelReferenceImage.setIcon(null); + jLabelDifferenceImage.setIcon(null); + + int w = getWidth(); + int h = getHeight(); + if (bAdd) + { + this.setSize(w, h + 1); + bAdd = false; + } + else + { + this.setSize(w, h - 1); + bAdd = true; + } + } + else + { + new ResizeImage(jLabelOriginalImage, m_aImageIcon[0]).execute(); + new ResizeImage(jLabelReferenceImage, m_aImageIcon[1]).execute(); + new ResizeImage(jLabelDifferenceImage, m_aImageIcon[2]).execute(); + } + int dummy=0; + }//GEN-LAST:event_formComponentResized + + private void jButton1ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jButton1ActionPerformed + {//GEN-HEADEREND:event_jButton1ActionPerformed + // TODO add your handling code here: + System.exit(1); + }//GEN-LAST:event_jButton1ActionPerformed + + private void formPropertyChange(java.beans.PropertyChangeEvent evt)//GEN-FIRST:event_formPropertyChange + {//GEN-HEADEREND:event_formPropertyChange + // TODO add your handling code here: + int dummy = 0; + }//GEN-LAST:event_formPropertyChange + + private void jButton2ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jButton2ActionPerformed + {//GEN-HEADEREND:event_jButton2ActionPerformed + // TODO add your handling code here: + int nOldPage = m_nCurrentPage; + if (m_nCurrentPage > 1) + { + m_nCurrentPage--; + } + if (nOldPage != m_nCurrentPage) + { + jLabelCurrentPage.setText("Current page: " + m_nCurrentPage); + fillImageIcons(); + initialiseImages(); + } + }//GEN-LAST:event_jButton2ActionPerformed + + private void jButton3ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jButton3ActionPerformed + {//GEN-HEADEREND:event_jButton3ActionPerformed + // TODO add your handling code here: + int nOldPage = m_nCurrentPage; + if (m_nCurrentPage < m_nMaxPages) + { + m_nCurrentPage++; + } + if (nOldPage != m_nCurrentPage) + { + jLabelCurrentPage.setText("Current page: " + m_nCurrentPage); + fillImageIcons(); + initialiseImages(); + } + }//GEN-LAST:event_jButton3ActionPerformed + + class ResizeImage extends SwingWorker <ImageIcon, Object> + { + private JLabel m_jLabel; + private ImageIcon m_aImageIcon; + private int w; + private int h; + + public ResizeImage(JLabel _aLabel, ImageIcon _aImageIcon) + { + m_jLabel = _aLabel; + m_aImageIcon = _aImageIcon; + w = _aLabel.getWidth(); + h = _aLabel.getHeight(); + } + + // dont access here anything to "Event Swing Thread" + @Override + public ImageIcon doInBackground() + { + Image aImage = m_aImageIcon.getImage().getScaledInstance(w, h, Image.SCALE_AREA_AVERAGING); // SCALE_SMOOTH + final ImageIcon aIcon = new ImageIcon(aImage); + // m_jLabel.setIcon(aIcon); + return aIcon; + } + + @Override + protected void done() + { + try + { + m_jLabel.setIcon(get()); + } + catch (Exception e) + {} + } + + } + + /** + * @param args the command line arguments + */ + public static void main(final String args[]) + { + + // Start GUI + + java.awt.EventQueue.invokeLater(new Runnable() + { + + public void run() + { + ConvwatchGUI aGUI = new ConvwatchGUI(args); + aGUI.setTitle("Graphical Compare"); + aGUI.setPreferredSize(new Dimension(1024, 768)); + + aGUI.setVisible(true); + } + }); + } + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton jButton1; + private javax.swing.JButton jButton2; + private javax.swing.JButton jButton3; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabelCurrentPage; + private javax.swing.JLabel jLabelDifferenceImage; + private javax.swing.JLabel jLabelDocumentName; + private javax.swing.JLabel jLabelOriginalImage; + private javax.swing.JLabel jLabelReferenceImage; + private javax.swing.JPanel jPanel4; + private javax.swing.JPanel jPanel5; + private javax.swing.JPanel jPanelDifference; + private javax.swing.JPanel jPanelOriginal; + private javax.swing.JPanel jPanelReference; + // End of variables declaration//GEN-END:variables +} diff --git a/testgraphical/ui/java/ConvwatchGUIProject/src/IniFile.java b/testgraphical/ui/java/ConvwatchGUIProject/src/IniFile.java new file mode 100644 index 000000000000..20cede5b1c33 --- /dev/null +++ b/testgraphical/ui/java/ConvwatchGUIProject/src/IniFile.java @@ -0,0 +1,718 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +import java.io.File; +import java.io.RandomAccessFile; +import java.util.ArrayList; +import java.util.Enumeration; + + +/** + * Simple implementation of a inifile manager + */ +class GlobalLogWriter +{ + public static void println(String _s) + { + System.out.println(_s); + } +} + +/** + Helper class to give a simple API to read/write windows like ini files +*/ + +/* public */ // is only need, if we need this class outside package convwatch +public class IniFile implements Enumeration +{ + + /** + * internal representation of the ini file content. + * Problem, if ini file changed why other write something difference, we don't realise this. + */ + private String m_sFilename; + // private File m_aFile; + private ArrayList<String> m_aList; + boolean m_bListContainUnsavedChanges = false; + private int m_aEnumerationPos = 0; + + /** + open a ini file by it's name + @param _sFilename string a filename, if the file doesn't exist, a new empty ini file will create. + write back to disk only if there are really changes. + */ + public IniFile(String _sFilename) + { + m_sFilename = _sFilename; + // m_aFile = new File(_sFilename); + m_aList = loadLines(); + m_aEnumerationPos = findNextSection(0); + } + + /** + open a ini file by it's name + @param _aFile a java.io.File object, if the file doesn't exist, a new empty ini file will create. + write back to disk only if there are really changes. + */ + public IniFile(File _aFile) + { + m_sFilename = _aFile.getAbsolutePath(); + m_aList = loadLines(); + m_aEnumerationPos = findNextSection(0); + } + + public void insertFirstComment(String[] _aList) + { + if (m_aList.size() == 0) + { + // can only insert if there is nothing else already in the ini file + for (int i = 0; i < _aList.length; i++) + { + m_aList.add(_aList[i]); + } + } + } + + private ArrayList<String> loadLines() + { + ArrayList<String> aLines = new ArrayList<String>(); + File aFile = new File(m_sFilename); + if (!aFile.exists()) + { + // GlobalLogWriter.println("couldn't find file '" + m_sFilename + "', will be created."); + // DebugHelper.exception(BasicErrorCode.SbERR_FILE_NOT_FOUND, ""); + // m_bListContainUnsavedChanges = false; + return aLines; + } + RandomAccessFile aReader = null; + // BufferedReader aReader; + try + { + aReader = new RandomAccessFile(aFile, "r"); + String aLine = ""; + while (aLine != null) + { + aLine = aReader.readLine(); + if (aLine != null && aLine.length() > 0) + { + aLines.add(aLine); + } + } + } + catch (java.io.FileNotFoundException fne) + { + GlobalLogWriter.println("couldn't open file " + m_sFilename); + GlobalLogWriter.println("Message: " + fne.getMessage()); + // DebugHelper.exception(BasicErrorCode.SbERR_FILE_NOT_FOUND, ""); + } + catch (java.io.IOException ie) + { + GlobalLogWriter.println("Exception occurs while reading from file " + m_sFilename); + GlobalLogWriter.println("Message: " + ie.getMessage()); + // DebugHelper.exception(BasicErrorCode.SbERR_INTERNAL_ERROR, ie.getMessage()); + } + try + { + aReader.close(); + } + catch (java.io.IOException ie) + { + GlobalLogWriter.println("Couldn't close file " + m_sFilename); + GlobalLogWriter.println("Message: " + ie.getMessage()); + // DebugHelper.exception(BasicErrorCode.SbERR_INTERNAL_ERROR, ie.getMessage()); + } + return aLines; + } + + /** + * @return true, if the ini file contain some readable data + */ + public boolean is() + { + return m_aList.size() > 1 ? true : false; + } + + /** + * Check if a given Section and Key exists in the ini file + * @param _sSectionName + * @param _sKey + * @return true if the given Section, Key exists, now you can get the value + */ + public boolean hasValue(String _sSectionName, String _sKey) + { + int n = findKey(_sSectionName, _sKey); + if (n > 0) + { + return true; + } + return false; + } + // ----------------------------------------------------------------------------- + + private boolean isRemark(String _sLine) + { + if (((_sLine.length() < 2)) || + (_sLine.startsWith("#")) || + (_sLine.startsWith(";"))) + { + return true; + } + return false; + } + + private String getItem(int i) + { + return m_aList.get(i); + } + + private String buildSectionName(String _sSectionName) + { + String sFindSection = "[" + _sSectionName + "]"; + return sFindSection; + } + + private String sectionToString(String _sSectionName) + { + String sKeyName = _sSectionName; + if (sKeyName.startsWith("[") && + sKeyName.endsWith("]")) + { + sKeyName = sKeyName.substring(1, sKeyName.length() - 1); + } + return sKeyName; + } + + private String toLowerIfNeed(String _sName) + { + return _sName.toLowerCase(); + } + + // return the number where this section starts + private int findSection(String _sSection) + { + String sFindSection = toLowerIfNeed(buildSectionName(_sSection)); + // ----------- find _sSection --------------- + int i; + for (i = 0; i < m_aList.size(); i++) + { + String sLine = toLowerIfNeed(getItem(i).trim()); + if (isRemark(sLine)) + { + continue; + } + if (sFindSection.equals("[]")) + { + // special case, empty Section. + return i - 1; + } + if (sLine.startsWith(sFindSection)) + { + return i; + } + } + return -1; + } + + /** + * Checks if a given section exists in the ini file + * @param _sSection + * @return true if the given _sSection was found + */ + public boolean hasSection(String _sSection) + { + int i = findSection(_sSection); + if (i == -1) + { + return false; + } + return true; + } + + // return the line number, where the key is found. + private int findKey(String _sSection, String _sKey) + { + int i = findSection(_sSection); + if (i == -1) + { + // Section not found, therefore the value can't exist + return -1; + } + return findKeyFromKnownSection(i, _sKey); + } + + // i must be the index in the list, where the well known section starts + private int findKeyFromKnownSection(int _nSectionIndex, String _sKey) + { + _sKey = toLowerIfNeed(_sKey); + for (int j = _nSectionIndex + 1; j < m_aList.size(); j++) + { + String sLine = getItem(j).trim(); + + if (isRemark(sLine)) + { + continue; + } + if (sLine.startsWith("[") /* && sLine.endsWith("]") */) + { + // TODO: due to the fact we would like to insert an empty line before new sections + // TODO: we should check if we are in an empty line and if, go back one line. + + // found end. + break; + } + + int nEqual = sLine.indexOf("="); + if (nEqual >= 0) + { + String sKey = toLowerIfNeed(sLine.substring(0, nEqual).trim()); + if (sKey.equals(_sKey)) + { + return j; + } + } + } + return -1; + } + + // i must be the index in the list, where the well known section starts + private int findLastKnownKeyIndex(int _nSectionIndex, String _sKey) + { + _sKey = toLowerIfNeed(_sKey); + int i = _nSectionIndex + 1; + for (int j = i; j < m_aList.size(); j++) + { + String sLine = getItem(j).trim(); + + if (isRemark(sLine)) + { + continue; + } + + if (sLine.startsWith("[") /* && sLine.endsWith("]") */) + { + // found end. + return j; + } + + int nEqual = sLine.indexOf("="); + if (nEqual >= 0) + { + String sKey = toLowerIfNeed(sLine.substring(0, nEqual).trim()); + if (sKey.equals(_sKey)) + { + return j; + } + } + } + return i; + } + + private String getValue(int _nIndex) + { + String sLine = getItem(_nIndex).trim(); + if (isRemark(sLine)) + { + return ""; + } + int nEqual = sLine.indexOf("="); + if (nEqual >= 0) + { + String sKey = sLine.substring(0, nEqual).trim(); + String sValue = sLine.substring(nEqual + 1).trim(); + return sValue; + } + return ""; + } + + /** + @param _sSection string + @param _sKey string + @return the value found in the inifile which is given by the section and key parameter + */ + // private int m_nCurrentPosition; + // private String m_sOldKey; + public String getValue(String _sSection, String _sKey) + { + String sValue = ""; + int m_nCurrentPosition = findKey(_sSection, _sKey); + if (m_nCurrentPosition == -1) + { + // Section not found, therefore the value can't exist + return ""; + } + + // m_sOldKey = _sKey; + sValue = getValue(m_nCurrentPosition); + + return sValue; + } + +// private String getNextValue() +// { +// if (m_nCurrentPosition >= 0) +// { +// ++m_nCurrentPosition; +// String sValue = getValue(m_nCurrentPosition); +// return sValue; +// } +// return ""; +// } + /** + * Returns the value at Section, Key converted to an integer + * Check with hasValue(Section, Key) to check before you get into trouble. + * @param _sSection + * @param _sKey + * @param _nDefault if there is a problem, key not found... this value will return + * @return the value as integer if possible to convert, if not return default value. + */ + public int getIntValue(String _sSection, String _sKey, int _nDefault) + { + String sValue = getValue(_sSection, _sKey); + int nValue = _nDefault; + if (sValue.length() > 0) + { + try + { + nValue = Integer.valueOf(sValue).intValue(); + } + catch (java.lang.NumberFormatException e) + { + GlobalLogWriter.println("IniFile.getIntValue(): Caught a number format exception, return the default value."); + } + } + return nValue; + } + +/** + * close a open inifile. + * If there are changes, all changes will store back to disk. + */ + public void close() + { + store(); + } + + /** + write back the ini file to the disk, only if there exist changes + * @deprecated use close() instead! + */ + + // TODO: make private + private void store() + { + if (m_bListContainUnsavedChanges == false) + { + // nothing has changed, so no need to store + return; + } + + File aFile = new File(m_sFilename); + if (aFile.exists()) + { + // System.out.println("couldn't find file " + m_sFilename); + // TODO: little bit unsafe here, first rename, after write is complete, delete the old. + aFile.delete(); + if (aFile.exists()) + { + GlobalLogWriter.println("Couldn't delete the file " + m_sFilename); + return; + // DebugHelper.exception(BasicErrorCode.SbERR_INTERNAL_ERROR, "Couldn't delete the file " + m_sFilename); + } + } + // if (! aFile.canWrite()) + // { + // System.out.println("Couldn't write to file " + m_sFilename); + // DebugHelper.exception(BasicErrorCode.SbERR_INTERNAL_ERROR, ""); + // } + try + { + RandomAccessFile aWriter = new RandomAccessFile(aFile, "rw"); + for (int i = 0; i < m_aList.size(); i++) + { + String sLine = getItem(i); + if (sLine.startsWith("[")) + { + // write an extra empty line before next section. + aWriter.writeByte((int) '\n'); + } + aWriter.writeBytes(sLine); + aWriter.writeByte((int) '\n'); + } + aWriter.close(); + } + catch (java.io.FileNotFoundException fne) + { + GlobalLogWriter.println("couldn't open file for writing " + m_sFilename); + GlobalLogWriter.println("Message: " + fne.getMessage()); + // DebugHelper.exception(BasicErrorCode.SbERR_FILE_NOT_FOUND, ""); + } + catch (java.io.IOException ie) + { + GlobalLogWriter.println("Exception occurs while writing to file " + m_sFilename); + GlobalLogWriter.println("Message: " + ie.getMessage()); + // DebugHelper.exception(BasicErrorCode.SbERR_INTERNAL_ERROR, ie.getMessage()); + } + } + + public void insertValue(String _sSection, String _sKey, int _nValue) + { + insertValue(_sSection, _sKey, String.valueOf(_nValue)); + } + + public void insertValue(String _sSection, String _sKey, long _nValue) + { + insertValue(_sSection, _sKey, String.valueOf(_nValue)); + } + + /** + insert a value + there are 3 cases + 1. section doesn't exist, goto end and insert a new section, insert a new key value pair + 2. section exist but key not, search section, search key, if key is -1 get last known key position and insert new key value pair there + 3. section exist and key exist, remove the old key and insert the key value pair at the same position + * @param _sSection + * @param _sKey + * @param _sValue + */ + public void insertValue(String _sSection, String _sKey, String _sValue) + { + int i = findSection(_sSection); + if (i == -1) + { + // case 1: section doesn't exist + String sFindSection = buildSectionName(_sSection); + + // TODO: before create a new Section, insert a empty line + m_aList.add(sFindSection); + if (_sKey.length() > 0) + { + String sKeyValuePair = _sKey + "=" + _sValue; + m_aList.add(sKeyValuePair); + } + m_bListContainUnsavedChanges = true; + return; + } + int j = findKeyFromKnownSection(i, _sKey); + if (j == -1) + { + // case 2: section exist, but not the key + j = findLastKnownKeyIndex(i, _sKey); + if (_sKey.length() > 0) + { + String sKeyValuePair = _sKey + "=" + _sValue; + m_aList.add(j, sKeyValuePair); + m_bListContainUnsavedChanges = true; + } + return; + } + else + { + // case 3: section exist, and also the key + String sKeyValuePair = _sKey + "=" + _sValue; + m_aList.set(j, sKeyValuePair); + m_bListContainUnsavedChanges = true; + } + } + // ----------------------------------------------------------------------------- + // String replaceEvaluatedValue(String _sSection, String _sValue) + // { + // String sValue = _sValue; + // int nIndex = 0; + // while (( nIndex = sValue.indexOf("$(", nIndex)) >= 0) + // { + // int nNextIndex = sValue.indexOf(")", nIndex); + // if (nNextIndex >= 0) + // { + // String sKey = sValue.substring(nIndex + 2, nNextIndex); + // String sNewValue = getValue(_sSection, sKey); + // if (sNewValue != null && sNewValue.length() > 0) + // { + // String sRegexpKey = "\\$\\(" + sKey + "\\)"; + // sValue = sValue.replaceAll(sRegexpKey, sNewValue); + // } + // nIndex = nNextIndex; + // } + // else + // { + // nIndex += 2; + // } + // } + // return sValue; + // } + // ----------------------------------------------------------------------------- + + // public String getLocalEvaluatedValue(String _sSection, String _sKey) + // { + // String sValue = getValue(_sSection, _sKey); + // sValue = replaceEvaluatedValue(_sSection, sValue); + // return sValue; + // } + + // ----------------------------------------------------------------------------- + + // this is a special behaviour. + // public String getGlobalLocalEvaluatedValue(String _sSection, String _sKey) + // { + // String sGlobalValue = getKey("global", _sKey); + // String sLocalValue = getKey(_sSection, _sKey); + // if (sLocalValue.length() == 0) + // { + // sGlobalValue = replaceEvaluatedKey(_sSection, sGlobalValue); + // sGlobalValue = replaceEvaluatedKey("global", sGlobalValue); + // return sGlobalValue; + // } + // sLocalValue = replaceEvaluatedKey(_sSection, sLocalValue); + // sLocalValue = replaceEvaluatedKey("global", sLocalValue); + // + // return sLocalValue; + // } + public void removeSection(String _sSectionToRemove) + { + // first, search for the name + int i = findSection(_sSectionToRemove); + if (i == -1) + { + // Section to remove not found, do nothing. + return; + } + // second, find the next section + int j = findNextSection(i + 1); + if (j == -1) + { + // if we are at the end, use size() as second section + j = m_aList.size(); + } + // remove all between first and second section + for (int k = i; k < j; k++) + { + m_aList.remove(i); + } + // mark the list as changed + m_bListContainUnsavedChanges = true; + } + + /** + * some tests for this class + */ +// public static void main(String[] args) +// { +// String sTempFile = System.getProperty("java.io.tmpdir"); +// sTempFile += "inifile"; +// +// +// IniFile aIniFile = new IniFile(sTempFile); +// String sValue = aIniFile.getValue("Section", "Key"); +// // insert a new value to a already exist section +// aIniFile.insertValue("Section", "Key2", "a new value in a existing section"); +// // replace a value +// aIniFile.insertValue("Section", "Key", "replaced value"); +// // create a new value +// aIniFile.insertValue("New Section", "Key", "a new key value pair"); +// aIniFile.insertValue("New Section", "Key2", "a new second key value pair"); +// +// String sValue2 = aIniFile.getValue("Section2", "Key"); +// +// aIniFile.removeSection("Section"); +// aIniFile.removeSection("New Section"); +// +// aIniFile.close(); +// } + + /** + * Enumeration Interface + * @return true, if there are more Key values + */ + public boolean hasMoreElements() + { + if (m_aEnumerationPos >= 0 && + m_aEnumerationPos < m_aList.size()) + { + return true; + } + return false; + } + + /** + * Find the next line, which starts with '[' + * @param i start position + * @return the line where '[' found or -1 + */ + private int findNextSection(int i) + { + if (i >= 0) + { + while (i < m_aList.size()) + { + String sLine = m_aList.get(i); + if (sLine.startsWith("[")) + { + return i; + } + i++; + } + } + return -1; + } + + /** + * Enumeration Interface + * @return a key without the enveloped '[' ']' + */ + public Object nextElement() + { + int nLineWithSection = findNextSection(m_aEnumerationPos); + if (nLineWithSection != -1) + { + String sSection = m_aList.get(nLineWithSection); + m_aEnumerationPos = findNextSection(nLineWithSection + 1); + sSection = sectionToString(sSection); + return sSection; + } + else + { + m_aEnumerationPos = m_aList.size(); + } + return null; + } + + /** + * Helper to count the occurence of Sections + * @return returns the count of '^['.*']$' Elements + */ + public int getElementCount() + { + int nCount = 0; + int nPosition = 0; + while ((nPosition = findNextSection(nPosition)) != -1) + { + nCount++; + nPosition++; + } + return nCount; + } +} + diff --git a/testgraphical/ui/java/makefile.mk b/testgraphical/ui/java/makefile.mk new file mode 100644 index 000000000000..134787a17a08 --- /dev/null +++ b/testgraphical/ui/java/makefile.mk @@ -0,0 +1,53 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=..$/.. + +PRJNAME=gfxcmp_ui_java +TARGET=notargetyet + +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk + +.IF "$(SHOW)" == "" +nothing .PHONY: + +.ELSE + +# PERLDEBUG=-d:ptkdb +ALLTAR: + $(COPY) ConvwatchGUIProject$/dist/ConvwatchGUIProject.jar $(CLASSDIR) + +.END + +.INCLUDE : $(PRJ)$/util$/makefile.pmk + |