You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by tv...@apache.org on 2009/03/26 00:12:17 UTC
svn commit: r758461 [2/47] - in /incubator/pivot/branches: ./ 1.1/
1.1/charts-test/ 1.1/charts-test/src/ 1.1/charts-test/src/pivot/
1.1/charts-test/src/pivot/charts/ 1.1/charts-test/src/pivot/charts/test/
1.1/charts/ 1.1/charts/lib/ 1.1/charts/src/ 1.1...
Added: incubator/pivot/branches/1.1/build.xml
URL: http://svn.apache.org/viewvc/incubator/pivot/branches/1.1/build.xml?rev=758461&view=auto
==============================================================================
--- incubator/pivot/branches/1.1/build.xml (added)
+++ incubator/pivot/branches/1.1/build.xml Wed Mar 25 23:08:38 2009
@@ -0,0 +1,748 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="pivot" default="build">
+ <property name="src" value="src"/>
+ <property name="bin" value="ant-bin"/>
+ <property name="lib" value="lib"/>
+
+ <property name="doc" value="doc"/>
+ <property name="charts" value="charts"/>
+ <property name="chartstest" value="charts-test"/>
+ <property name="core" value="core"/>
+ <property name="coretest" value="core-test"/>
+ <property name="web" value="web"/>
+ <property name="webtest" value="web-test"/>
+ <property name="wtk" value="wtk"/>
+ <property name="wtktest" value="wtk-test"/>
+
+ <property name="demos" value="demos"/>
+ <property name="tutorials" value="tutorials"/>
+ <property name="tools" value="tools"/>
+
+ <property name="keystore" value="${user.home}/myKeystore"/>
+ <property name="storepass" value="keystore"/>
+ <property name="alias" value="myself"/>
+
+ <property name="deploy" value="${user.home}/${ant.project.name}-deploy"/>
+
+ <tstamp/>
+ <property file="build.properties"/>
+
+ <!-- Compiler properties -->
+ <property name="compiler.optimize" value="true"/>
+ <property name="compiler.deprecation" value="true"/>
+ <property name="compiler.debug" value="false"/>
+
+ <target name="build" depends="charts, charts-test, core, core-test, web, web-test, wtk, wtk-test, demos, tutorials, tools"/>
+ <target name="clean" depends="charts-clean, charts-test-clean, core-clean, core-test-clean, web-clean, web-test-clean, wtk-clean, wtk-test-clean, demos-clean, tutorials-clean, tools-clean"/>
+
+ <target name="doc">
+ <javadoc packagenames="pivot.*" destdir="${doc}" author="true" version="true" use="true">
+ <classpath>
+ <pathelement location="${charts}/lib/jcommon-1.0.12.jar"/>
+ <pathelement location="${charts}/lib/jfreechart-1.0.9.jar"/>
+ <pathelement location="${web}/lib/servlet-api.jar"/>
+ <pathelement location="${wtk}/lib/stax-api-1.0.jar"/>
+ <pathelement location="${wtk}/lib/stax-1.2.0.jar"/>
+ <pathelement location="${wtk}/lib/plugin.jar"/>
+ <fileset dir="${web}/${lib}" includes="**/*.jar"/>
+ </classpath>
+ <packageset dir="${charts}/${src}" includes="**/*"/>
+ <packageset dir="${core}/${src}" includes="**/*"/>
+ <packageset dir="${web}/${src}" includes="**/*"/>
+ <packageset dir="${wtk}/${src}" includes="**/*"/>
+ <header>
+ <![CDATA[
+ <script type="text/javascript">
+ var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+ document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+ </script>
+ <script type="text/javascript">
+ try {
+ var pageTracker = _gat._getTracker("UA-7977275-1");
+ pageTracker._trackPageview();
+ } catch(err) {}
+ </script>
+ ]]>
+ </header>
+ </javadoc>
+
+ <delete file="${ant.project.name}_${version}-${doc}.zip"/>
+ <zip destfile="${ant.project.name}_${version}-${doc}.zip" basedir="doc"/>
+ </target>
+
+ <!-- Build charts library -->
+ <target name="charts" depends="core, wtk">
+ <mkdir dir="${charts}/${bin}"/>
+
+ <!-- Compile source files -->
+ <javac srcdir="${charts}/${src}"
+ destDir="${charts}/${bin}"
+ optimize="${compiler.optimize}"
+ deprecation="${compiler.deprecation}"
+ debug="${compiler.debug}"
+ target="1.5"
+ failonerror="true">
+ <compilerarg value="-Xlint"/>
+ <classpath>
+ <pathelement location="${core}/${ant.project.name}-core.jar"/>
+ <pathelement location="${wtk}/${ant.project.name}-wtk.jar"/>
+ <pathelement location="${charts}/lib/jcommon-1.0.12.jar"/>
+ <pathelement location="${charts}/lib/jfreechart-1.0.9.jar"/>
+ </classpath>
+ </javac>
+
+ <!-- Rebuild the JAR file -->
+ <delete file="${charts}/${ant.project.name}-charts.jar"/>
+ <jar jarfile="${charts}/${ant.project.name}-charts.jar">
+ <manifest>
+ <attribute name="Sealed" value="true"/>
+ <attribute name="Built-On" value="${DSTAMP}-${TSTAMP}"/>
+ <attribute name="Implementation-Version" value="${version}"/>
+ </manifest>
+ <fileset dir="${charts}/${bin}"/>
+ <fileset dir="${charts}/${src}">
+ <exclude name="**/*.java"/>
+ <exclude name="**/package.html"/>
+ </fileset>
+ </jar>
+ </target>
+
+ <target name="charts-clean">
+ <delete dir="${charts}/${bin}"/>
+ <delete file="${charts}/${ant.project.name}-charts.jar"/>
+ </target>
+
+ <!-- Charts Test -->
+ <target name="charts-test" depends="charts, core, wtk">
+ <mkdir dir="${chartstest}/${bin}"/>
+
+ <!-- Compile source files -->
+ <javac srcdir="${chartstest}/${src}"
+ destDir="${chartstest}/${bin}"
+ optimize="${compiler.optimize}"
+ deprecation="${compiler.deprecation}"
+ debug="${compiler.debug}"
+ target="1.5"
+ failonerror="true">
+ <compilerarg value="-Xlint"/>
+ <classpath>
+ <pathelement location="charts/pivot-charts.jar"/>
+ <pathelement location="core/pivot-core.jar"/>
+ <pathelement location="wtk/pivot-wtk.jar"/>
+ </classpath>
+ </javac>
+
+ <!-- Rebuild the JAR file -->
+ <delete file="${chartstest}/${ant.project.name}-charts.test.jar"/>
+ <jar jarfile="${chartstest}/${ant.project.name}-charts.test.jar">
+ <fileset dir="${chartstest}/${bin}"/>
+ <fileset dir="${chartstest}/${src}">
+ <exclude name="**/*.java"/>
+ <exclude name="**/package.html"/>
+ </fileset>
+ </jar>
+ </target>
+
+ <target name="charts-test-clean">
+ <delete dir="${chartstest}/${bin}"/>
+ <delete file="${chartstest}/${ant.project.name}-charts.test.jar"/>
+ </target>
+
+ <!-- Core -->
+ <target name="core">
+ <mkdir dir="${core}/${bin}"/>
+
+ <!-- Compile source files -->
+ <javac srcdir="${core}/${src}"
+ destDir="${core}/${bin}"
+ optimize="${compiler.optimize}"
+ deprecation="${compiler.deprecation}"
+ debug="${compiler.debug}"
+ target="1.5"
+ failonerror="true">
+ <compilerarg value="-Xlint"/>
+ </javac>
+
+ <!-- Rebuild the JAR file -->
+ <delete file="${core}/${ant.project.name}-core.jar"/>
+ <jar jarfile="${core}/${ant.project.name}-core.jar">
+ <manifest>
+ <attribute name="Sealed" value="true"/>
+ <attribute name="Built-On" value="${DSTAMP}-${TSTAMP}"/>
+ <attribute name="Implementation-Version" value="${version}"/>
+ </manifest>
+ <fileset dir="${core}/${bin}"/>
+ <fileset dir="${core}/${src}">
+ <exclude name="**/*.java"/>
+ <exclude name="**/package.html"/>
+ </fileset>
+ </jar>
+ </target>
+
+ <target name="core-clean">
+ <delete dir="${core}/${bin}"/>
+ <delete file="${core}/${ant.project.name}-core.jar"/>
+ </target>
+
+ <!-- Core Test -->
+ <target name="core-test" depends="core">
+ <mkdir dir="${coretest}/${bin}"/>
+
+ <!-- Compile source files -->
+ <javac srcdir="${coretest}/${src}"
+ destDir="${coretest}/${bin}"
+ optimize="${compiler.optimize}"
+ deprecation="${compiler.deprecation}"
+ debug="${compiler.debug}"
+ target="1.5"
+ failonerror="true"
+ classpath="${core}/${ant.project.name}-core.jar:junit.jar">
+ <compilerarg value="-Xlint"/>
+ </javac>
+
+ <!-- Rebuild the JAR file -->
+ <delete file="${coretest}/${ant.project.name}-core.test.jar"/>
+ <jar jarfile="${coretest}/${ant.project.name}-core.test.jar">
+ <fileset dir="${coretest}/${bin}"/>
+ <fileset dir="${coretest}/${src}">
+ <exclude name="**/*.java"/>
+ <exclude name="**/package.html"/>
+ </fileset>
+ </jar>
+ </target>
+
+ <target name="core-test-clean">
+ <delete dir="${coretest}/${bin}"/>
+ <delete file="${coretest}/${ant.project.name}-core.test.jar"/>
+ </target>
+
+ <!-- Web -->
+ <target name="web" depends="core">
+ <mkdir dir="${web}/${bin}"/>
+
+ <!-- Compile source files -->
+ <javac srcdir="${web}/${src}"
+ destDir="${web}/${bin}"
+ optimize="${compiler.optimize}"
+ deprecation="${compiler.deprecation}"
+ debug="${compiler.debug}"
+ target="1.5"
+ failonerror="true">
+ <compilerarg value="-Xlint"/>
+ <classpath>
+ <pathelement location="${core}/${ant.project.name}-core.jar"/>
+ <fileset dir="${web}/${lib}" includes="**/*.jar"/>
+ </classpath>
+ </javac>
+
+ <!-- Rebuild the JAR files -->
+ <delete file="${web}/${ant.project.name}-web.jar"/>
+ <jar jarfile="${web}/${ant.project.name}-web.jar">
+ <manifest>
+ <attribute name="Sealed" value="true"/>
+ <attribute name="Built-On" value="${DSTAMP}-${TSTAMP}"/>
+ <attribute name="Implementation-Version" value="${version}"/>
+ </manifest>
+ <fileset dir="${web}/${bin}">
+ <exclude name="pivot/web/server/**"/>
+ </fileset>
+ <fileset dir="${web}/${src}">
+ <exclude name="pivot/web/server/**"/>
+ <exclude name="**/*.java"/>
+ <exclude name="**/package.html"/>
+ </fileset>
+ </jar>
+
+ <delete file="${web}/${ant.project.name}-web.server.jar"/>
+ <jar jarfile="${web}/${ant.project.name}-web.server.jar">
+ <manifest>
+ <attribute name="Sealed" value="true"/>
+ <attribute name="Built-On" value="${DSTAMP}-${TSTAMP}"/>
+ <attribute name="Implementation-Version" value="${version}"/>
+ </manifest>
+ <fileset dir="${web}/${bin}">
+ <include name="pivot/web/server/*"/>
+ </fileset>
+ <fileset dir="${web}/${src}">
+ <include name="pivot/web/server/**"/>
+ <exclude name="**/*.java"/>
+ <exclude name="**/package.html"/>
+ </fileset>
+ </jar>
+ </target>
+
+ <target name="web-clean">
+ <delete dir="${web}/${bin}"/>
+ <delete file="${web}/${ant.project.name}-web.jar"/>
+ <delete file="${web}/${ant.project.name}-web.server.jar"/>
+ </target>
+
+ <!-- Web Test -->
+ <target name="web-test" depends="web, wtk">
+ <mkdir dir="${webtest}/${bin}"/>
+
+ <!-- Compile source files -->
+ <javac srcdir="${webtest}/${src}"
+ destDir="${webtest}/${bin}"
+ optimize="${compiler.optimize}"
+ deprecation="${compiler.deprecation}"
+ debug="${compiler.debug}"
+ target="1.5"
+ failonerror="true">
+ <compilerarg value="-Xlint"/>
+ <classpath>
+ <pathelement location="${core}/${ant.project.name}-core.jar"/>
+ <pathelement location="${web}/${ant.project.name}-web.jar"/>
+ <pathelement location="${wtk}/${ant.project.name}-wtk.jar"/>
+ <fileset dir="${web}/${lib}" includes="**/*.jar"/>
+ </classpath>
+ </javac>
+
+ <!-- Rebuild the client JAR file -->
+ <delete file="${webtest}/${ant.project.name}-web.test.jar"/>
+ <jar jarfile="${webtest}/${ant.project.name}-web.test.jar">
+ <fileset dir="${webtest}/${bin}">
+ <exclude name="pivot/web/test/server/**"/>
+ </fileset>
+ <fileset dir="${webtest}/${src}">
+ <exclude name="pivot/web/test/server/**"/>
+ <exclude name="**/*.java"/>
+ <exclude name="**/package.html"/>
+ </fileset>
+ </jar>
+
+ <!-- Rebuild the server WAR file -->
+ <delete dir="${webtest}/www/${lib}" includes="*.jar"/>
+ <copy file="${core}/${ant.project.name}-core.jar" todir="${webtest}/www/${lib}"/>
+ <copy file="${web}/${ant.project.name}-web.jar" todir="${webtest}/www/${lib}"/>
+ <copy file="${wtk}/${ant.project.name}-wtk.jar" todir="${webtest}/www/${lib}"/>
+ <copy file="${wtk}/${ant.project.name}-wtk.terra.jar" todir="${webtest}/www/${lib}"/>
+ <copy file="${wtk}/lib/stax-api-1.0.jar" todir="${webtest}/www/${lib}"/>
+ <copy file="${wtk}/lib/stax-1.2.0.jar" todir="${webtest}/www/${lib}"/>
+ <copy file="${webtest}/${ant.project.name}-web.test.jar" todir="${webtest}/www/${lib}"/>
+
+ <mkdir dir="${webtest}/${lib}"/>
+ <copy file="${core}/${ant.project.name}-core.jar" todir="${webtest}/${lib}"/>
+ <copy file="${web}/${ant.project.name}-web.server.jar" todir="${webtest}/${lib}"/>
+ <delete file="${webtest}/${ant.project.name}_web_test.war"/>
+
+ <war destfile="${webtest}/${ant.project.name}_web_test.war" webxml="${webtest}/web.xml">
+ <fileset dir="${webtest}/www"/>
+ <classes dir="${webtest}/${bin}">
+ <include name="pivot/web/test/server/**"/>
+ </classes>
+ <classes dir="${webtest}/${src}">
+ <include name="pivot/web/test/server/**"/>
+ <exclude name="**/*.java"/>
+ <exclude name="**/package.html"/>
+ </classes>
+ <lib dir="${webtest}/${lib}"/>
+ </war>
+ </target>
+ <target name="web-test-clean">
+ <delete dir="${webtest}/www/${lib}" includes="*.jar"/>
+ <delete dir="${webtest}/${bin}"/>
+ <delete dir="${webtest}/${lib}"/>
+ <delete file="${webtest}/${ant.project.name}-web.test.jar"/>
+ <delete file="${webtest}/${ant.project.name}_web_test.war"/>
+ </target>
+
+ <!-- WTK -->
+ <target name="wtk" depends="core">
+ <mkdir dir="${wtk}/${bin}"/>
+
+ <!-- Compile source files -->
+ <javac srcdir="${wtk}/${src}"
+ destDir="${wtk}/${bin}"
+ optimize="${compiler.optimize}"
+ deprecation="${compiler.deprecation}"
+ debug="${compiler.debug}"
+ target="1.5"
+ failonerror="true">
+ <compilerarg value="-Xlint"/>
+ <classpath>
+ <pathelement location="${core}/${ant.project.name}-core.jar"/>
+ <pathelement location="${wtk}/lib/stax-api-1.0.jar"/>
+ <pathelement location="${wtk}/lib/stax-1.2.0.jar"/>
+ <pathelement location="${wtk}/lib/plugin.jar"/>
+ </classpath>
+ </javac>
+
+ <!-- Rebuild the JAR file -->
+ <delete file="${wtk}/${ant.project.name}-wtk.jar"/>
+ <jar jarfile="${wtk}/${ant.project.name}-wtk.jar">
+ <manifest>
+ <attribute name="Sealed" value="true"/>
+ <attribute name="Built-On" value="${DSTAMP}-${TSTAMP}"/>
+ <attribute name="Implementation-Version" value="${version}"/>
+ </manifest>
+ <fileset dir="${wtk}/${bin}">
+ <exclude name="pivot/wtk/skin/terra/**"/>
+ <exclude name="pivot/wtk/skin/obsidian/**"/>
+ </fileset>
+ <fileset dir="${wtk}/${src}">
+ <exclude name="pivot/wtk/skin/terra/**"/>
+ <exclude name="pivot/wtk/skin/obsidian/**"/>
+ <exclude name="**/*.java"/>
+ <exclude name="**/package.html"/>
+ </fileset>
+ </jar>
+
+ <delete file="${wtk}/${ant.project.name}-wtk.terra.jar"/>
+ <jar jarfile="${wtk}/${ant.project.name}-wtk.terra.jar">
+ <manifest>
+ <attribute name="Sealed" value="true"/>
+ <attribute name="Built-On" value="${DSTAMP}-${TSTAMP}"/>
+ <attribute name="Implementation-Version" value="${version}"/>
+ </manifest>
+ <fileset dir="${wtk}/${bin}">
+ <include name="pivot/wtk/skin/terra/**"/>
+ </fileset>
+ <fileset dir="${wtk}/${src}">
+ <include name="pivot/wtk/skin/terra/**"/>
+ <exclude name="**/*.java"/>
+ <exclude name="**/package.html"/>
+ </fileset>
+ </jar>
+
+ <delete file="${wtk}/${ant.project.name}-wtk.obsidian.jar"/>
+ <jar jarfile="${wtk}/${ant.project.name}-wtk.obsidian.jar">
+ <manifest>
+ <attribute name="Sealed" value="true"/>
+ <attribute name="Built-On" value="${DSTAMP}-${TSTAMP}"/>
+ <attribute name="Implementation-Version" value="${version}"/>
+ </manifest>
+ <fileset dir="${wtk}/${bin}">
+ <include name="pivot/wtk/skin/obsidian/**"/>
+ </fileset>
+ <fileset dir="${wtk}/${src}">
+ <include name="pivot/wtk/skin/obsidian/**"/>
+ <exclude name="**/*.java"/>
+ <exclude name="**/package.html"/>
+ </fileset>
+ </jar>
+ </target>
+
+ <target name="wtk-clean">
+ <delete dir="${wtk}/${bin}"/>
+ <delete file="${wtk}/${ant.project.name}-wtk.jar"/>
+ <delete file="${wtk}/${ant.project.name}-wtk.terra.jar"/>
+ <delete file="${wtk}/${ant.project.name}-wtk.obsidian.jar"/>
+ </target>
+
+ <!-- WTK Test -->
+ <target name="wtk-test" depends="core, wtk">
+ <mkdir dir="${wtktest}/${bin}"/>
+
+ <!-- Compile source files -->
+ <javac srcdir="${wtktest}/${src}"
+ destDir="${wtktest}/${bin}"
+ optimize="${compiler.optimize}"
+ deprecation="${compiler.deprecation}"
+ debug="${compiler.debug}"
+ target="1.5"
+ failonerror="true">
+ <compilerarg value="-Xlint"/>
+ <classpath>
+ <pathelement location="${core}/${ant.project.name}-core.jar"/>
+ <pathelement location="${wtk}/${ant.project.name}-wtk.jar"/>
+ </classpath>
+ </javac>
+
+ <!-- Rebuild the JAR file -->
+ <delete file="${wtktest}/${ant.project.name}-wtk.test.jar"/>
+ <jar jarfile="${wtktest}/${ant.project.name}-wtk.test.jar">
+ <fileset dir="${wtktest}/${bin}"/>
+ <fileset dir="${wtktest}/${src}">
+ <exclude name="**/*.java"/>
+ <exclude name="**/package.html"/>
+ </fileset>
+ </jar>
+ </target>
+
+ <target name="wtk-test-clean">
+ <delete dir="${wtktest}/${bin}"/>
+ <delete file="${wtktest}/${ant.project.name}-wtk.test.jar"/>
+ </target>
+
+ <!-- Build demos library -->
+ <target name="demos" depends="core, wtk, web, charts">
+ <mkdir dir="${demos}/${bin}"/>
+
+ <!-- Compile source files -->
+ <javac srcdir="${demos}/${src}"
+ destDir="${demos}/${bin}"
+ optimize="${compiler.optimize}"
+ deprecation="${compiler.deprecation}"
+ debug="${compiler.debug}"
+ target="1.5"
+ failonerror="true">
+ <compilerarg value="-Xlint"/>
+ <classpath>
+ <pathelement location="core/pivot-core.jar"/>
+ <pathelement location="web/pivot-web.jar"/>
+ <pathelement location="wtk/pivot-wtk.jar"/>
+ <pathelement location="demos/lib/flex-messaging-common.jar"/>
+ <pathelement location="demos/lib/flex-messaging-core.jar"/>
+ <pathelement location="demos/lib/gdata-base-1.0.jar"/>
+ <pathelement location="demos/lib/gdata-client-1.0.jar"/>
+ <pathelement location="demos/lib/gdata-client-meta-1.0.jar"/>
+ <pathelement location="demos/lib/gdata-contacts-1.0.jar"/>
+ <pathelement location="demos/lib/gdata-contacts-meta-1.0.jar"/>
+ <pathelement location="demos/lib/gdata-core-1.0.jar"/>
+ <pathelement location="demos/lib/smack.jar"/>
+ <pathelement location="demos/lib/smackx.jar"/>
+ </classpath>
+ </javac>
+
+ <!-- Rebuild the JAR file -->
+ <delete file="${demos}/${ant.project.name}-demos.jar"/>
+ <jar jarfile="${demos}/${ant.project.name}-demos.jar">
+ <manifest>
+ <attribute name="Built-On" value="${DSTAMP}-${TSTAMP}"/>
+ <attribute name="Implementation-Version" value="${version}"/>
+ </manifest>
+ <fileset dir="${demos}/${bin}"/>
+ <fileset dir="${demos}/${src}">
+ <exclude name="**/*.java"/>
+ </fileset>
+ </jar>
+ </target>
+
+ <!-- Clean the demos classes -->
+ <target name="demos-clean">
+ <delete dir="${demos}/${bin}"/>
+ <delete file="${demos}/${ant.project.name}-demos.jar"/>
+ </target>
+
+ <!-- Build tutorials library -->
+ <target name="tutorials" depends="core, wtk, web, charts">
+ <mkdir dir="${tutorials}/${bin}"/>
+
+ <!-- Compile source files -->
+ <javac srcdir="${tutorials}/${src}"
+ destDir="${tutorials}/${bin}"
+ optimize="${compiler.optimize}"
+ deprecation="${compiler.deprecation}"
+ debug="${compiler.debug}"
+ target="1.5"
+ failonerror="true">
+ <compilerarg value="-Xlint"/>
+ <classpath>
+ <pathelement location="core/pivot-core.jar"/>
+ <pathelement location="web/pivot-web.jar"/>
+ <pathelement location="wtk/pivot-wtk.jar"/>
+ </classpath>
+ </javac>
+
+ <!-- Rebuild the JAR files -->
+ <delete file="${tutorials}/${ant.project.name}-tutorials.jar"/>
+ <jar jarfile="${tutorials}/${ant.project.name}-tutorials.jar">
+ <manifest>
+ <attribute name="Built-On" value="${DSTAMP}-${TSTAMP}"/>
+ <attribute name="Implementation-Version" value="${version}"/>
+ </manifest>
+ <fileset dir="${tutorials}/${bin}">
+ <exclude name="pivot/tutorials/stocktracker/**"/>
+ </fileset>
+ <fileset dir="${tutorials}/${src}">
+ <exclude name="**/*.java"/>
+ <exclude name="pivot/tutorials/stocktracker/**"/>
+ </fileset>
+ </jar>
+
+ <delete file="${tutorials}/${ant.project.name}-stocktracker.jar"/>
+ <jar jarfile="${tutorials}/${ant.project.name}-stocktracker.jar">
+ <manifest>
+ <attribute name="Built-On" value="${DSTAMP}-${TSTAMP}"/>
+ <attribute name="Implementation-Version" value="${version}"/>
+ </manifest>
+ <fileset dir="${tutorials}/${bin}">
+ <include name="pivot/tutorials/stocktracker/*"/>
+ </fileset>
+ <fileset dir="${tutorials}/${src}">
+ <exclude name="**/*.java"/>
+ </fileset>
+ </jar>
+ </target>
+
+ <!-- Clean the tutorial classes -->
+ <target name="tutorials-clean">
+ <delete dir="${tutorials}/${bin}"/>
+ <delete file="${tutorials}/${ant.project.name}-tutorials.jar"/>
+ <delete file="${tutorials}/${ant.project.name}-stocktracker.jar"/>
+ </target>
+
+ <!-- Build tools library -->
+ <target name="tools" depends="core, wtk, web">
+ <mkdir dir="${tools}/${bin}"/>
+
+ <!-- Compile source files -->
+ <javac srcdir="${tools}/${src}"
+ destDir="${tools}/${bin}"
+ optimize="${compiler.optimize}"
+ deprecation="${compiler.deprecation}"
+ debug="${compiler.debug}"
+ target="1.5"
+ failonerror="true">
+ <compilerarg value="-Xlint"/>
+ <classpath>
+ <pathelement location="core/pivot-core.jar"/>
+ <pathelement location="web/pivot-web.jar"/>
+ <pathelement location="wtk/pivot-wtk.jar"/>
+ </classpath>
+ </javac>
+
+ <!-- Rebuild the JAR file -->
+ <delete file="${tools}/${ant.project.name}-tools.jar"/>
+ <jar jarfile="${tools}/${ant.project.name}-tools.jar">
+ <manifest>
+ <attribute name="Built-On" value="${DSTAMP}-${TSTAMP}"/>
+ <attribute name="Implementation-Version" value="${version}"/>
+ </manifest>
+ <fileset dir="${tools}/${bin}"/>
+ <fileset dir="${tools}/${src}">
+ <exclude name="**/*.java"/>
+ </fileset>
+ </jar>
+ </target>
+
+ <!-- Clean the tools classes -->
+ <target name="tools-clean">
+ <delete dir="${tools}/${bin}"/>
+ <delete file="${tools}/${ant.project.name}-tools.jar"/>
+ </target>
+
+ <!-- Package all binaries and source -->
+ <target name="package" depends="trim-whitespace, clean, build, doc">
+ <delete file="${ant.project.name}_${version}.zip"/>
+ <zip destfile="${ant.project.name}_${version}.zip">
+ <fileset dir=".">
+ <include name="pivot.sh"/>
+ <include name="pivot.bat"/>
+ </fileset>
+ <fileset dir="${charts}">
+ <include name="${ant.project.name}-charts.jar"/>
+ </fileset>
+ <fileset dir="${core}">
+ <include name="${ant.project.name}-core.jar"/>
+ </fileset>
+ <fileset dir="${web}">
+ <include name="${ant.project.name}-web.jar"/>
+ <include name="${ant.project.name}-web.server.jar"/>
+ </fileset>
+ <fileset dir="${wtk}">
+ <include name="${ant.project.name}-wtk.jar"/>
+ <include name="${ant.project.name}-wtk.terra.jar"/>
+ </fileset>
+ <fileset dir="${tools}">
+ <include name="${ant.project.name}-tools.jar"/>
+ </fileset>
+ </zip>
+
+ <!-- Package source -->
+ <delete file="${ant.project.name}_${version}-src.zip"/>
+ <zip destfile="${ant.project.name}_${version}-src.zip">
+ <fileset dir="${charts}/${src}"/>
+ <fileset dir="${core}/${src}"/>
+ <fileset dir="${web}/${src}"/>
+ <fileset dir="${wtk}/${src}"/>
+ </zip>
+ </target>
+
+ <!-- Generate deployment files for online demos and tutorials -->
+ <target name="deploy" depends="package">
+ <delete dir="${deploy}"/>
+ <mkdir dir="${deploy}"/>
+
+ <!-- Platform -->
+ <copy file="${charts}/${ant.project.name}-charts.jar" todir="${deploy}"/>
+ <signjar jar="${deploy}/${ant.project.name}-charts.jar" signedjar="${deploy}/${ant.project.name}-charts.signed.jar"
+ keystore="${keystore}" storepass="${storepass}" alias="${alias}"/>
+
+ <copy file="${core}/${ant.project.name}-core.jar" todir="${deploy}"/>
+ <signjar jar="${deploy}/${ant.project.name}-core.jar" signedjar="${deploy}/${ant.project.name}-core.signed.jar"
+ keystore="${keystore}" storepass="${storepass}" alias="${alias}"/>
+
+ <copy file="${web}/${ant.project.name}-web.jar" todir="${deploy}"/>
+ <signjar jar="${deploy}/${ant.project.name}-web.jar" signedjar="${deploy}/${ant.project.name}-web.signed.jar"
+ keystore="${keystore}" storepass="${storepass}" alias="${alias}"/>
+
+ <copy file="${wtk}/${ant.project.name}-wtk.jar" todir="${deploy}"/>
+ <signjar jar="${deploy}/${ant.project.name}-wtk.jar" signedjar="${deploy}/${ant.project.name}-wtk.signed.jar"
+ keystore="${keystore}" storepass="${storepass}" alias="${alias}"/>
+
+ <copy file="${wtk}/${ant.project.name}-wtk.terra.jar" todir="${deploy}"/>
+ <signjar jar="${deploy}/${ant.project.name}-wtk.terra.jar" signedjar="${deploy}/${ant.project.name}-wtk.terra.signed.jar"
+ keystore="${keystore}" storepass="${storepass}" alias="${alias}"/>
+
+ <!-- StAX -->
+ <copy file="${wtk}/lib/stax-api-1.0.jar" todir="${deploy}"/>
+ <signjar jar="${deploy}/stax-api-1.0.jar" signedjar="${deploy}/stax-api-1.0.signed.jar"
+ keystore="${keystore}" storepass="${storepass}" alias="${alias}"/>
+
+ <copy file="${wtk}/lib/stax-1.2.0.jar" todir="${deploy}"/>
+ <signjar jar="${deploy}/stax-1.2.0.jar" signedjar="${deploy}/stax-1.2.0.signed.jar"
+ keystore="${keystore}" storepass="${storepass}" alias="${alias}"/>
+
+ <!-- JFree -->
+ <copy file="${charts}/lib/jcommon-1.0.12.jar" todir="${deploy}"/>
+ <signjar jar="${deploy}/jcommon-1.0.12.jar" signedjar="${deploy}/jcommon-1.0.12.signed.jar"
+ keystore="${keystore}" storepass="${storepass}" alias="${alias}"/>
+
+ <copy file="${charts}/lib/jfreechart-1.0.9.jar" todir="${deploy}"/>
+ <signjar jar="${deploy}/jfreechart-1.0.9.jar" signedjar="${deploy}/jfreechart-1.0.9.signed.jar"
+ keystore="${keystore}" storepass="${storepass}" alias="${alias}"/>
+
+ <!-- Google Data -->
+ <signjar jar="${demos}/${lib}/gdata-base-1.0.jar" signedjar="${deploy}/gdata-base-1.0.signed.jar"
+ keystore="${keystore}" storepass="${storepass}" alias="${alias}"/>
+ <signjar jar="${demos}/${lib}/gdata-client-1.0.jar" signedjar="${deploy}/gdata-client-1.0.signed.jar"
+ keystore="${keystore}" storepass="${storepass}" alias="${alias}"/>
+ <signjar jar="${demos}/${lib}/gdata-client-meta-1.0.jar" signedjar="${deploy}/gdata-client-meta-1.0.signed.jar"
+ keystore="${keystore}" storepass="${storepass}" alias="${alias}"/>
+ <signjar jar="${demos}/${lib}/gdata-contacts-1.0.jar" signedjar="${deploy}/gdata-contacts-1.0.signed.jar"
+ keystore="${keystore}" storepass="${storepass}" alias="${alias}"/>
+ <signjar jar="${demos}/${lib}/gdata-contacts-meta-1.0.jar" signedjar="${deploy}/gdata-contacts-meta-1.0.signed.jar"
+ keystore="${keystore}" storepass="${storepass}" alias="${alias}"/>
+ <signjar jar="${demos}/${lib}/gdata-core-1.0.jar" signedjar="${deploy}/gdata-core-1.0.signed.jar"
+ keystore="${keystore}" storepass="${storepass}" alias="${alias}"/>
+ <signjar jar="${demos}/${lib}/gdata-media-1.0.jar" signedjar="${deploy}/gdata-media-1.0.signed.jar"
+ keystore="${keystore}" storepass="${storepass}" alias="${alias}"/>
+
+ <!-- Smack -->
+ <signjar jar="${demos}/${lib}/smack.jar" signedjar="${deploy}/smack.signed.jar"
+ keystore="${keystore}" storepass="${storepass}" alias="${alias}"/>
+ <signjar jar="${demos}/${lib}/smackx.jar" signedjar="${deploy}/smackx.signed.jar"
+ keystore="${keystore}" storepass="${storepass}" alias="${alias}"/>
+
+ <!-- Demos -->
+ <copy file="${chartstest}/${ant.project.name}-charts.test.jar" todir="${deploy}"/>
+ <copy file="${demos}/${ant.project.name}-demos.jar" todir="${deploy}"/>
+ <signjar jar="${deploy}/${ant.project.name}-demos.jar" signedjar="${deploy}/${ant.project.name}-demos.signed.jar"
+ keystore="${keystore}" storepass="${storepass}" alias="${alias}"/>
+
+ <!-- Tutorials -->
+ <copy file="${tutorials}/${ant.project.name}-tutorials.jar" todir="${deploy}"/>
+ <signjar jar="${deploy}/${ant.project.name}-tutorials.jar" signedjar="${deploy}/${ant.project.name}-tutorials.signed.jar"
+ keystore="${keystore}" storepass="${storepass}" alias="${alias}"/>
+ <copy file="${tutorials}/${ant.project.name}-stocktracker.jar" todir="${deploy}"/>
+ <signjar jar="${deploy}/${ant.project.name}-stocktracker.jar" signedjar="${deploy}/${ant.project.name}-stocktracker.signed.jar"
+ keystore="${keystore}" storepass="${storepass}" alias="${alias}"/>
+ </target>
+
+ <!-- Remove trailing white space in all source files -->
+ <target name="trim-whitespace">
+ <replaceregexp match="[\t ]+$" replace="" flags="gm" byline="true">
+ <fileset dir=".">
+ <include name="**/*.java"/>
+ <include name="**/*.html"/>
+ <include name="**/*.txt"/>
+ <include name="**/*.properties"/>
+ <include name="**/*.xml"/>
+ <include name="**/*.wtkx"/>
+ <include name="**/*.json"/>
+ </fileset>
+ </replaceregexp>
+ </target>
+</project>
Added: incubator/pivot/branches/1.1/charts-test/.classpath
URL: http://svn.apache.org/viewvc/incubator/pivot/branches/1.1/charts-test/.classpath?rev=758461&view=auto
==============================================================================
--- incubator/pivot/branches/1.1/charts-test/.classpath (added)
+++ incubator/pivot/branches/1.1/charts-test/.classpath Wed Mar 25 23:08:38 2009
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/charts"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/core"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/wtk"/>
+ <classpathentry kind="lib" path="/charts/lib/jcommon-1.0.12.jar"/>
+ <classpathentry kind="lib" path="/charts/lib/jfreechart-1.0.9.jar"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: incubator/pivot/branches/1.1/charts-test/.project
URL: http://svn.apache.org/viewvc/incubator/pivot/branches/1.1/charts-test/.project?rev=758461&view=auto
==============================================================================
--- incubator/pivot/branches/1.1/charts-test/.project (added)
+++ incubator/pivot/branches/1.1/charts-test/.project Wed Mar 25 23:08:38 2009
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>charts-test</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: incubator/pivot/branches/1.1/charts-test/src/pivot/charts/test/ChartsTest.java
URL: http://svn.apache.org/viewvc/incubator/pivot/branches/1.1/charts-test/src/pivot/charts/test/ChartsTest.java?rev=758461&view=auto
==============================================================================
--- incubator/pivot/branches/1.1/charts-test/src/pivot/charts/test/ChartsTest.java (added)
+++ incubator/pivot/branches/1.1/charts-test/src/pivot/charts/test/ChartsTest.java Wed Mar 25 23:08:38 2009
@@ -0,0 +1,117 @@
+package pivot.charts.test;
+
+import pivot.beans.BeanDictionary;
+import pivot.charts.AreaChartView;
+import pivot.charts.BarChartView;
+import pivot.charts.ChartView;
+import pivot.charts.HighLowChartView;
+import pivot.charts.LineChartView;
+import pivot.charts.PieChartView;
+import pivot.collections.Dictionary;
+import pivot.collections.List;
+import pivot.wtk.Alert;
+import pivot.wtk.Application;
+import pivot.wtk.Component;
+import pivot.wtk.ComponentMouseButtonListener;
+import pivot.wtk.Display;
+import pivot.wtk.Frame;
+import pivot.wtk.Mouse;
+import pivot.wtkx.WTKXSerializer;
+
+public class ChartsTest implements Application {
+ private class ChartViewMouseButtonHandler implements ComponentMouseButtonListener {
+ public boolean mouseDown(Component component, Mouse.Button button, int x, int y) {
+ return false;
+ }
+
+ public boolean mouseUp(Component component, Mouse.Button button, int x, int y) {
+ return false;
+ }
+
+ @SuppressWarnings("unchecked")
+ public boolean mouseClick(Component component, Mouse.Button button, int x, int y, int count) {
+ ChartView chartView = (ChartView)component;
+ ChartView.Element element = chartView.getElementAt(x, y);
+
+ if (element != null) {
+ int seriesIndex = element.getSeriesIndex();
+ int elementIndex = element.getElementIndex();
+
+ String elementLabel;
+ ChartView.CategorySequence categories = chartView.getCategories();
+ if (categories.getLength() > 0) {
+ elementLabel = "\"" + chartView.getCategories().get(elementIndex).getLabel() + "\"";
+ } else {
+ elementLabel = Integer.toString(elementIndex);
+ }
+
+ List<?> chartData = chartView.getChartData();
+ Object series = chartData.get(seriesIndex);
+
+ Dictionary<String, Object> seriesDictionary;
+ if (series instanceof Dictionary<?, ?>) {
+ seriesDictionary = (Dictionary<String, Object>)series;
+ } else {
+ seriesDictionary = new BeanDictionary(series);
+ }
+
+ String seriesNameKey = chartView.getSeriesNameKey();
+
+ Alert.alert("You clicked element " + elementLabel + " in \""
+ + seriesDictionary.get(seriesNameKey) + "\".", frame);
+ }
+
+ return false;
+ }
+ }
+
+ private Frame frame = null;
+
+ public void startup(Display display, Dictionary<String, String> properties)
+ throws Exception {
+ WTKXSerializer wtkxSerializer = new WTKXSerializer();
+
+ frame = new Frame((Component)wtkxSerializer.readObject(getClass().getResource("charts_test.wtkx")));
+ frame.setTitle("Charts Test");
+
+ ChartViewMouseButtonHandler chartViewMouseButtonHandler = new ChartViewMouseButtonHandler();
+
+ PieChartView pieChartView = (PieChartView)wtkxSerializer.getObjectByName("pieCharts.pieChartView");
+ pieChartView.getComponentMouseButtonListeners().add(chartViewMouseButtonHandler);
+
+ BarChartView categoryBarChartView = (BarChartView)wtkxSerializer.getObjectByName("barCharts.categoryBarChartView");
+ categoryBarChartView.getComponentMouseButtonListeners().add(chartViewMouseButtonHandler);
+
+ BarChartView xyBarChartView = (BarChartView)wtkxSerializer.getObjectByName("barCharts.xyBarChartView");
+ xyBarChartView.getComponentMouseButtonListeners().add(chartViewMouseButtonHandler);
+
+ LineChartView categoryLineChartView = (LineChartView)wtkxSerializer.getObjectByName("lineCharts.categoryLineChartView");
+ categoryLineChartView.getComponentMouseButtonListeners().add(chartViewMouseButtonHandler);
+
+ LineChartView xyLineChartView = (LineChartView)wtkxSerializer.getObjectByName("lineCharts.xyLineChartView");
+ xyLineChartView.getComponentMouseButtonListeners().add(chartViewMouseButtonHandler);
+
+ AreaChartView categoryAreaChartView = (AreaChartView)wtkxSerializer.getObjectByName("areaCharts.categoryAreaChartView");
+ categoryAreaChartView.getComponentMouseButtonListeners().add(chartViewMouseButtonHandler);
+
+ AreaChartView xyAreaChartView = (AreaChartView)wtkxSerializer.getObjectByName("areaCharts.xyAreaChartView");
+ xyAreaChartView.getComponentMouseButtonListeners().add(chartViewMouseButtonHandler);
+
+ HighLowChartView highLowChartView = (HighLowChartView)wtkxSerializer.getObjectByName("highLowCharts.highLowChartView");
+ highLowChartView.getComponentMouseButtonListeners().add(chartViewMouseButtonHandler);
+
+ frame.setPreferredSize(640, 480);
+ frame.open(display);
+ }
+
+ public boolean shutdown(boolean optional) throws Exception {
+ frame.close();
+ return true;
+ }
+
+ public void suspend() {
+ }
+
+ public void resume() {
+ }
+}
Added: incubator/pivot/branches/1.1/charts-test/src/pivot/charts/test/area_charts.wtkx
URL: http://svn.apache.org/viewvc/incubator/pivot/branches/1.1/charts-test/src/pivot/charts/test/area_charts.wtkx?rev=758461&view=auto
==============================================================================
--- incubator/pivot/branches/1.1/charts-test/src/pivot/charts/test/area_charts.wtkx (added)
+++ incubator/pivot/branches/1.1/charts-test/src/pivot/charts/test/area_charts.wtkx Wed Mar 25 23:08:38 2009
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (c) 2008 VMware, Inc.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<TabPane tabOrientation="vertical" selectedIndex="0"
+ xmlns:wtkx="http://pivot-toolkit.org/wtkx/2008"
+ xmlns:collections="pivot.collections"
+ xmlns:content="pivot.charts.content" xmlns:charts="pivot.charts"
+ xmlns="pivot.wtk">
+ <tabs>
+ <charts:AreaChartView wtkx:id="categoryAreaChartView" TabPane.name="Category"
+ seriesNameKey="name" title="Category Area Chart Example"
+ horizontalAxisLabel="Categories" verticalAxisLabel="Values"
+ showLegend="true">
+ <categories>
+ <charts:ChartView.Category key="a" label="A"/>
+ <charts:ChartView.Category key="b" label="B"/>
+ <charts:ChartView.Category key="c" label="C"/>
+ <charts:ChartView.Category key="d" label="D"/>
+ <charts:ChartView.Category key="e" label="E"/>
+ </categories>
+
+ <chartData>
+ <collections:ArrayList>
+ <content:CategorySeries name="Example Series 1" a="43.2" b="27.9" c="79.5" d="10.0" e="20.2"/>
+ <content:CategorySeries name="Example Series 2" a="27.9" b="43.2" c="79.5" d="19.0" e="31.6"/>
+ <content:CategorySeries name="Example Series 3" a="79.5" b="27.9" c="43.2" d="50.3" e="81.9"/>
+ </collections:ArrayList>
+ </chartData>
+ </charts:AreaChartView>
+
+ <charts:AreaChartView wtkx:id="xyAreaChartView" TabPane.name="XY"
+ seriesNameKey="name" title="XY Area Chart Example"
+ horizontalAxisLabel="X" verticalAxisLabel="Y">
+ <chartData>
+ <collections:ArrayList>
+ <content:ValueSeries name="Example Series 1">
+ <content:Point x="1.0" y="1.0"/>
+ <content:Point x="2.0" y="4.0"/>
+ <content:Point x="3.0" y="3.0"/>
+ <content:Point x="4.0" y="5.0"/>
+ </content:ValueSeries>
+ <content:ValueSeries name="Example Series 2">
+ <content:Point x="1.0" y="5.0"/>
+ <content:Point x="2.0" y="7.0"/>
+ <content:Point x="3.0" y="6.0"/>
+ <content:Point x="4.0" y="8.0"/>
+ </content:ValueSeries>
+ <content:ValueSeries name="Example Series 3">
+ <content:Point x="3.0" y="4.0"/>
+ <content:Point x="4.0" y="3.0"/>
+ <content:Point x="5.0" y="2.0"/>
+ <content:Point x="6.0" y="3.0"/>
+ </content:ValueSeries>
+ </collections:ArrayList>
+ </chartData>
+ </charts:AreaChartView>
+ </tabs>
+</TabPane>
Added: incubator/pivot/branches/1.1/charts-test/src/pivot/charts/test/bar_charts.wtkx
URL: http://svn.apache.org/viewvc/incubator/pivot/branches/1.1/charts-test/src/pivot/charts/test/bar_charts.wtkx?rev=758461&view=auto
==============================================================================
--- incubator/pivot/branches/1.1/charts-test/src/pivot/charts/test/bar_charts.wtkx (added)
+++ incubator/pivot/branches/1.1/charts-test/src/pivot/charts/test/bar_charts.wtkx Wed Mar 25 23:08:38 2009
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (c) 2008 VMware, Inc.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<TabPane tabOrientation="vertical" selectedIndex="0"
+ xmlns:wtkx="http://pivot-toolkit.org/wtkx/2008"
+ xmlns:collections="pivot.collections"
+ xmlns:content="pivot.charts.content" xmlns:charts="pivot.charts"
+ xmlns="pivot.wtk">
+ <tabs>
+ <charts:BarChartView wtkx:id="categoryBarChartView" TabPane.name="Category"
+ seriesNameKey="name" title="Category Bar Chart Example"
+ horizontalAxisLabel="Categories" verticalAxisLabel="Values"
+ showLegend="true"
+ styles="{stacked:true, threeDimensional:true}">
+ <categories>
+ <charts:ChartView.Category key="a" label="A"/>
+ <charts:ChartView.Category key="b" label="B"/>
+ <charts:ChartView.Category key="c" label="C"/>
+ </categories>
+
+ <chartData>
+ <collections:ArrayList>
+ <content:CategorySeries name="Example Series 1" a="43.2" b="27.9" c="79.5"/>
+ <content:CategorySeries name="Example Series 2" a="27.9" b="43.2" c="79.5"/>
+ <content:CategorySeries name="Example Series 3" a="79.5" b="27.9" c="43.2"/>
+ </collections:ArrayList>
+ </chartData>
+ </charts:BarChartView>
+
+ <charts:BarChartView wtkx:id="xyBarChartView" TabPane.name="XY"
+ seriesNameKey="name" title="XY Bar Chart Example"
+ horizontalAxisLabel="X" verticalAxisLabel="Y">
+ <chartData>
+ <collections:ArrayList>
+ <content:ValueSeries name="Example Series 1">
+ <content:Interval x="1.0" y="1.0" width="2"/>
+ <content:Interval x="2.0" y="4.0" width="1"/>
+ <content:Interval x="3.0" y="3.0" width="3"/>
+ <content:Interval x="4.0" y="5.0" width="1"/>
+ </content:ValueSeries>
+ <content:ValueSeries name="Example Series 2">
+ <content:Interval x="1.0" y="5.0" width="2"/>
+ <content:Interval x="2.0" y="7.0" width="2"/>
+ <content:Interval x="3.0" y="6.0" width="2"/>
+ <content:Interval x="4.0" y="8.0" width="1"/>
+ </content:ValueSeries>
+ <content:ValueSeries name="Example Series 3">
+ <content:Interval x="3.0" y="4.0" width="1"/>
+ <content:Interval x="4.0" y="3.0" width="2"/>
+ <content:Interval x="5.0" y="2.0" width="1"/>
+ <content:Interval x="6.0" y="3.0" width="1"/>
+ </content:ValueSeries>
+ </collections:ArrayList>
+ </chartData>
+ </charts:BarChartView>
+ </tabs>
+</TabPane>
Added: incubator/pivot/branches/1.1/charts-test/src/pivot/charts/test/charts_test.wtkx
URL: http://svn.apache.org/viewvc/incubator/pivot/branches/1.1/charts-test/src/pivot/charts/test/charts_test.wtkx?rev=758461&view=auto
==============================================================================
--- incubator/pivot/branches/1.1/charts-test/src/pivot/charts/test/charts_test.wtkx (added)
+++ incubator/pivot/branches/1.1/charts-test/src/pivot/charts/test/charts_test.wtkx Wed Mar 25 23:08:38 2009
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (c) 2008 VMware, Inc.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<TabPane selectedIndex="0"
+ xmlns:wtkx="http://pivot-toolkit.org/wtkx/2008"
+ xmlns="pivot.wtk" xmlns:charts="pivot.charts">
+ <tabs>
+ <wtkx:include src="pie_charts.wtkx" namespace="pieCharts" TabPane.name="Pie Chart"/>
+ <wtkx:include src="bar_charts.wtkx" namespace="barCharts" TabPane.name="Bar Chart"/>
+ <wtkx:include src="line_charts.wtkx" namespace="lineCharts" TabPane.name="Line Chart"/>
+ <wtkx:include src="area_charts.wtkx" namespace="areaCharts" TabPane.name="Area Chart"/>
+ <wtkx:include src="high_low_charts.wtkx" namespace="highLowCharts" TabPane.name="High Low Chart"/>
+ </tabs>
+</TabPane>
+
+
Added: incubator/pivot/branches/1.1/charts-test/src/pivot/charts/test/high_low_charts.wtkx
URL: http://svn.apache.org/viewvc/incubator/pivot/branches/1.1/charts-test/src/pivot/charts/test/high_low_charts.wtkx?rev=758461&view=auto
==============================================================================
--- incubator/pivot/branches/1.1/charts-test/src/pivot/charts/test/high_low_charts.wtkx (added)
+++ incubator/pivot/branches/1.1/charts-test/src/pivot/charts/test/high_low_charts.wtkx Wed Mar 25 23:08:38 2009
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (c) 2008 VMware, Inc.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<charts:HighLowChartView wtkx:id="highLowChartView"
+ seriesNameKey="name" title="High Low Chart Example"
+ horizontalAxisLabel="Date" verticalAxisLabel="Value"
+ styles="{candlestick:true}"
+ xmlns:wtkx="http://pivot-toolkit.org/wtkx/2008"
+ xmlns:collections="pivot.collections"
+ xmlns:content="pivot.charts.content" xmlns:charts="pivot.charts"
+ xmlns="pivot.wtk">
+ <chartData>
+ <collections:ArrayList>
+ <content:ValueSeries name="Example Series 1">
+ <content:Candlestick date="8/26/2008" open="155.84" high="178.50" low="155.84" close="165.00"/>
+ <content:Candlestick date="8/27/2008" open="172.84" high="173.50" low="169.04" close="174.00"/>
+ <content:Candlestick date="8/28/2008" open="170.44" high="176.50" low="162.04" close="173.00"/>
+ <content:Candlestick date="8/29/2008" open="155.84" high="178.50" low="155.84" close="165.00"/>
+ <content:Candlestick date="8/30/2008" open="172.33" high="175.50" low="166.04" close="172.00"/>
+ <content:Candlestick date="8/31/2008" open="155.84" high="178.50" low="155.84" close="165.00"/>
+ </content:ValueSeries>
+ </collections:ArrayList>
+ </chartData>
+</charts:HighLowChartView>
Added: incubator/pivot/branches/1.1/charts-test/src/pivot/charts/test/line_charts.wtkx
URL: http://svn.apache.org/viewvc/incubator/pivot/branches/1.1/charts-test/src/pivot/charts/test/line_charts.wtkx?rev=758461&view=auto
==============================================================================
--- incubator/pivot/branches/1.1/charts-test/src/pivot/charts/test/line_charts.wtkx (added)
+++ incubator/pivot/branches/1.1/charts-test/src/pivot/charts/test/line_charts.wtkx Wed Mar 25 23:08:38 2009
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (c) 2008 VMware, Inc.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<TabPane tabOrientation="vertical" selectedIndex="0"
+ xmlns:wtkx="http://pivot-toolkit.org/wtkx/2008"
+ xmlns:collections="pivot.collections"
+ xmlns:content="pivot.charts.content" xmlns:charts="pivot.charts"
+ xmlns="pivot.wtk">
+ <tabs>
+ <charts:LineChartView wtkx:id="categoryLineChartView" TabPane.name="Category"
+ seriesNameKey="name" title="Category Line Chart Example"
+ horizontalAxisLabel="Categories" verticalAxisLabel="Values"
+ showLegend="false"
+ styles="{threeDimensional:true}">
+ <categories>
+ <charts:ChartView.Category key="a" label="A"/>
+ <charts:ChartView.Category key="b" label="B"/>
+ <charts:ChartView.Category key="c" label="C"/>
+ <charts:ChartView.Category key="d" label="D"/>
+ <charts:ChartView.Category key="e" label="E"/>
+ </categories>
+
+ <chartData>
+ <collections:ArrayList>
+ <content:CategorySeries name="Example Series 1" a="43.2" b="27.9" c="79.5" d="10.0" e="20.2"/>
+ <content:CategorySeries name="Example Series 2" a="27.9" b="43.2" c="79.5" d="19.0" e="31.6"/>
+ <content:CategorySeries name="Example Series 3" a="79.5" b="27.9" c="43.2" d="50.3" e="81.9"/>
+ </collections:ArrayList>
+ </chartData>
+ </charts:LineChartView>
+
+ <charts:LineChartView wtkx:id="xyLineChartView" TabPane.name="XY"
+ seriesNameKey="name" title="XY Line Chart Example"
+ horizontalAxisLabel="X" verticalAxisLabel="Y">
+ <chartData>
+ <collections:ArrayList>
+ <content:ValueSeries name="Example Series 1">
+ <content:Point x="1.0" y="1.0"/>
+ <content:Point x="2.0" y="4.0"/>
+ <content:Point x="3.0" y="3.0"/>
+ <content:Point x="4.0" y="5.0"/>
+ </content:ValueSeries>
+ <content:ValueSeries name="Example Series 2">
+ <content:Point x="1.0" y="5.0"/>
+ <content:Point x="2.0" y="7.0"/>
+ <content:Point x="3.0" y="6.0"/>
+ <content:Point x="4.0" y="8.0"/>
+ </content:ValueSeries>
+ <content:ValueSeries name="Example Series 3">
+ <content:Point x="3.0" y="4.0"/>
+ <content:Point x="4.0" y="3.0"/>
+ <content:Point x="5.0" y="2.0"/>
+ <content:Point x="6.0" y="3.0"/>
+ </content:ValueSeries>
+ </collections:ArrayList>
+ </chartData>
+ </charts:LineChartView>
+ </tabs>
+</TabPane>
Added: incubator/pivot/branches/1.1/charts-test/src/pivot/charts/test/pie_charts.wtkx
URL: http://svn.apache.org/viewvc/incubator/pivot/branches/1.1/charts-test/src/pivot/charts/test/pie_charts.wtkx?rev=758461&view=auto
==============================================================================
--- incubator/pivot/branches/1.1/charts-test/src/pivot/charts/test/pie_charts.wtkx (added)
+++ incubator/pivot/branches/1.1/charts-test/src/pivot/charts/test/pie_charts.wtkx Wed Mar 25 23:08:38 2009
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (c) 2008 VMware, Inc.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<charts:PieChartView wtkx:id="pieChartView"
+ seriesNameKey="name" title="Pie Chart Example"
+ styles="{explodePercentages:{a:0.30}}"
+ xmlns:wtkx="http://pivot-toolkit.org/wtkx/2008"
+ xmlns:collections="pivot.collections"
+ xmlns:content="pivot.charts.content" xmlns:charts="pivot.charts"
+ xmlns="pivot.wtk">
+ <categories>
+ <charts:ChartView.Category key="a" label="A"/>
+ <charts:ChartView.Category key="b" label="B"/>
+ <charts:ChartView.Category key="c" label="C"/>
+ </categories>
+
+ <chartData>
+ <collections:ArrayList>
+ <content:CategorySeries name="Example Series 1" a="43.2" b="27.9" c="79.5"/>
+ </collections:ArrayList>
+ </chartData>
+</charts:PieChartView>
Added: incubator/pivot/branches/1.1/charts/.classpath
URL: http://svn.apache.org/viewvc/incubator/pivot/branches/1.1/charts/.classpath?rev=758461&view=auto
==============================================================================
--- incubator/pivot/branches/1.1/charts/.classpath (added)
+++ incubator/pivot/branches/1.1/charts/.classpath Wed Mar 25 23:08:38 2009
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/core"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/wtk"/>
+ <classpathentry kind="lib" path="lib/jcommon-1.0.12.jar"/>
+ <classpathentry kind="lib" path="lib/jfreechart-1.0.9.jar"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: incubator/pivot/branches/1.1/charts/.project
URL: http://svn.apache.org/viewvc/incubator/pivot/branches/1.1/charts/.project?rev=758461&view=auto
==============================================================================
--- incubator/pivot/branches/1.1/charts/.project (added)
+++ incubator/pivot/branches/1.1/charts/.project Wed Mar 25 23:08:38 2009
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>charts</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: incubator/pivot/branches/1.1/charts/lib/jcommon-1.0.12.jar
URL: http://svn.apache.org/viewvc/incubator/pivot/branches/1.1/charts/lib/jcommon-1.0.12.jar?rev=758461&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/pivot/branches/1.1/charts/lib/jcommon-1.0.12.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/pivot/branches/1.1/charts/lib/jfreechart-1.0.9.jar
URL: http://svn.apache.org/viewvc/incubator/pivot/branches/1.1/charts/lib/jfreechart-1.0.9.jar?rev=758461&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/pivot/branches/1.1/charts/lib/jfreechart-1.0.9.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/pivot/branches/1.1/charts/src/pivot/charts/AreaChartView.java
URL: http://svn.apache.org/viewvc/incubator/pivot/branches/1.1/charts/src/pivot/charts/AreaChartView.java?rev=758461&view=auto
==============================================================================
--- incubator/pivot/branches/1.1/charts/src/pivot/charts/AreaChartView.java (added)
+++ incubator/pivot/branches/1.1/charts/src/pivot/charts/AreaChartView.java Wed Mar 25 23:08:38 2009
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2008 VMware, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package pivot.charts;
+
+import pivot.charts.skin.AreaChartViewSkin;
+
+/**
+ * Presents chart data using an area plot.
+ *
+ * @author gbrown
+ */
+public class AreaChartView extends ChartView {
+ public AreaChartView() {
+ setSkin(new AreaChartViewSkin());
+ }
+}
Added: incubator/pivot/branches/1.1/charts/src/pivot/charts/BarChartView.java
URL: http://svn.apache.org/viewvc/incubator/pivot/branches/1.1/charts/src/pivot/charts/BarChartView.java?rev=758461&view=auto
==============================================================================
--- incubator/pivot/branches/1.1/charts/src/pivot/charts/BarChartView.java (added)
+++ incubator/pivot/branches/1.1/charts/src/pivot/charts/BarChartView.java Wed Mar 25 23:08:38 2009
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2008 VMware, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package pivot.charts;
+
+import pivot.charts.skin.BarChartViewSkin;
+
+/**
+ * Presents chart data using a bar plot.
+ *
+ * @author gbrown
+ */
+public class BarChartView extends ChartView {
+ public BarChartView() {
+ setSkin(new BarChartViewSkin());
+ }
+}
Added: incubator/pivot/branches/1.1/charts/src/pivot/charts/ChartView.java
URL: http://svn.apache.org/viewvc/incubator/pivot/branches/1.1/charts/src/pivot/charts/ChartView.java?rev=758461&view=auto
==============================================================================
--- incubator/pivot/branches/1.1/charts/src/pivot/charts/ChartView.java (added)
+++ incubator/pivot/branches/1.1/charts/src/pivot/charts/ChartView.java Wed Mar 25 23:08:38 2009
@@ -0,0 +1,497 @@
+/*
+ * Copyright (c) 2008 VMware, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package pivot.charts;
+
+import java.util.Comparator;
+
+import pivot.collections.ArrayList;
+import pivot.collections.List;
+import pivot.collections.ListListener;
+import pivot.collections.Sequence;
+import pivot.util.ListenerList;
+import pivot.wtk.Component;
+
+/**
+ * Abstract base class for chart views.
+ *
+ * @author gbrown
+ */
+public abstract class ChartView extends Component {
+ /**
+ * Represents a chart category.
+ */
+ public static class Category {
+ private ChartView chartView = null;
+
+ private String key;
+ private String label;
+
+ public Category() {
+ this(null, null);
+ }
+
+ public Category(String key) {
+ this(key, key);
+ }
+
+ public Category(String key, String label) {
+ this.key = key;
+ this.label = label;
+ }
+
+ public ChartView getChartView() {
+ return chartView;
+ }
+
+ private void setChartView(ChartView chartView) {
+ this.chartView = chartView;
+ }
+
+ public String getKey() {
+ return key;
+ }
+
+ public void setKey(String key) {
+ if (key == null) {
+ throw new IllegalArgumentException("key is null.");
+ }
+
+ String previousKey = this.key;
+
+ if (previousKey != key) {
+ this.key = key;
+
+ if (chartView != null) {
+ chartView.chartViewCategoryListeners.categoryKeyChanged(chartView,
+ chartView.categories.indexOf(this), previousKey);
+ }
+ }
+ }
+
+ public String getLabel() {
+ return label;
+ }
+
+ public void setLabel(String label) {
+ if (label == null) {
+ throw new IllegalArgumentException("label is null.");
+ }
+
+ String previousLabel = this.label;
+
+ if (previousLabel != label) {
+ this.label = label;
+
+ if (chartView != null) {
+ chartView.chartViewCategoryListeners.categoryLabelChanged(chartView,
+ chartView.categories.indexOf(this), previousLabel);
+ }
+ }
+ }
+ }
+
+ /**
+ * Represents an element of a chart, such as a bar or a pie wedge.
+ */
+ public static class Element {
+ private int seriesIndex;
+ private int elementIndex;
+
+ public Element(int seriesIndex, int elementIndex) {
+ this.seriesIndex = seriesIndex;
+ this.elementIndex = elementIndex;
+ }
+
+ /**
+ * Returns the element's series index.
+ *
+ * @return
+ * The element's series index.
+ */
+ public int getSeriesIndex() {
+ return seriesIndex;
+ }
+
+ /**
+ * Returns the element's index within its series. For a category series,
+ * the element index represents the index of the category in the
+ * category sequence. Otherwise, it represents the index of the item
+ * within the series.
+ *
+ * @return
+ * The element index.
+ */
+ public int getElementIndex() {
+ return elementIndex;
+ }
+
+ public String toString() {
+ String string = getClass().getName()
+ + seriesIndex + ", " + elementIndex;
+ return string;
+ }
+ }
+
+ /**
+ * Chart view skin interface.
+ */
+ public interface Skin {
+ public Element getElementAt(int x, int y);
+ }
+
+ /**
+ * Internal class for managing the chart's category list.
+ */
+ public final class CategorySequence implements Sequence<Category> {
+ public int add(Category category) {
+ int i = getLength();
+ insert(category, i);
+
+ return i;
+ }
+
+ public void insert(Category category, int index) {
+ if (category == null) {
+ throw new IllegalArgumentException("category is null.");
+ }
+
+ if (category.getChartView() != null) {
+ throw new IllegalArgumentException("category is already in use by another chart view.");
+ }
+
+ categories.insert(category, index);
+ category.setChartView(ChartView.this);
+
+ chartViewCategoryListeners.categoryInserted(ChartView.this, index);
+ }
+
+ public Category update(int index, Category category) {
+ throw new UnsupportedOperationException();
+ }
+
+ public int remove(Category category) {
+ int index = indexOf(category);
+ if (index != -1) {
+ remove(index, 1);
+ }
+
+ return index;
+ }
+
+ public Sequence<Category> remove(int index, int count) {
+ Sequence<Category> removed = categories.remove(index, count);
+
+ if (count > 0) {
+ for (int i = 0, n = removed.getLength(); i < n; i++) {
+ removed.get(i).setChartView(null);
+ }
+
+ chartViewCategoryListeners.categoriesRemoved(ChartView.this, index, removed);
+ }
+
+ return removed;
+ }
+
+ public Category get(int index) {
+ return categories.get(index);
+ }
+
+ public int indexOf(Category category) {
+ return categories.indexOf(category);
+ }
+
+ public int getLength() {
+ return categories.getLength();
+ }
+ }
+
+ /**
+ * List event handler.
+ */
+ private class ListHandler implements ListListener<Object> {
+ public void itemInserted(List<Object> list, int index) {
+ // Notify listeners that items were inserted
+ chartViewSeriesListeners.seriesInserted(ChartView.this, index);
+ }
+
+ public void itemsRemoved(List<Object> list, int index, Sequence<Object> items) {
+ if (items == null) {
+ // All items were removed; clear the selection and notify
+ // listeners
+ chartViewSeriesListeners.seriesRemoved(ChartView.this, index, -1);
+ } else {
+ // Notify listeners that items were removed
+ int count = items.getLength();
+ chartViewSeriesListeners.seriesRemoved(ChartView.this, index, count);
+ }
+ }
+
+ public void itemUpdated(List<Object> list, int index, Object previousItem) {
+ chartViewSeriesListeners.seriesUpdated(ChartView.this, index);
+ }
+
+ public void comparatorChanged(List<Object> list,
+ Comparator<Object> previousComparator) {
+ if (list.getComparator() != null) {
+ chartViewSeriesListeners.seriesSorted(ChartView.this);
+ }
+ }
+ }
+
+ /**
+ * Chart view listener list.
+ */
+ private class ChartViewListenerList extends ListenerList<ChartViewListener>
+ implements ChartViewListener {
+ public void chartDataChanged(ChartView chartView, List<?> previousChartData) {
+ for (ChartViewListener listener : this) {
+ listener.chartDataChanged(chartView, previousChartData);
+ }
+ }
+
+ public void seriesNameKeyChanged(ChartView chartView, String previousSeriesNameKey) {
+ for (ChartViewListener listener : this) {
+ listener.seriesNameKeyChanged(chartView, previousSeriesNameKey);
+ }
+ }
+
+ public void titleChanged(ChartView chartView, String previousTitle) {
+ for (ChartViewListener listener : this) {
+ listener.titleChanged(chartView, previousTitle);
+ }
+ }
+
+ public void horizontalAxisLabelChanged(ChartView chartView, String previousXAxisLabel) {
+ for (ChartViewListener listener : this) {
+ listener.horizontalAxisLabelChanged(chartView, previousXAxisLabel);
+ }
+ }
+
+ public void verticalAxisLabelChanged(ChartView chartView, String previousYAxisLabel) {
+ for (ChartViewListener listener : this) {
+ listener.verticalAxisLabelChanged(chartView, previousYAxisLabel);
+ }
+ }
+
+ public void showLegendChanged(ChartView chartView) {
+ for (ChartViewListener listener : this) {
+ listener.showLegendChanged(chartView);
+ }
+ }
+ }
+
+ /**
+ * Chart view category listener list.
+ */
+ private class ChartViewCategoryListenerList extends ListenerList<ChartViewCategoryListener>
+ implements ChartViewCategoryListener {
+ public void categoryInserted(ChartView chartView, int index) {
+ for (ChartViewCategoryListener listener : this) {
+ listener.categoryInserted(chartView, index);
+ }
+ }
+
+ public void categoriesRemoved(ChartView chartView, int index, Sequence<ChartView.Category> categories) {
+ for (ChartViewCategoryListener listener : this) {
+ listener.categoriesRemoved(chartView, index, categories);
+ }
+ }
+
+ public void categoryKeyChanged(ChartView chartView, int index, String previousKey) {
+ for (ChartViewCategoryListener listener : this) {
+ listener.categoryKeyChanged(chartView, index, previousKey);
+ }
+ }
+
+ public void categoryLabelChanged(ChartView chartView, int index, String previousLabel) {
+ for (ChartViewCategoryListener listener : this) {
+ listener.categoryLabelChanged(chartView, index, previousLabel);
+ }
+ }
+ }
+
+ /**
+ * Chart view series listener list.
+ */
+ private class ChartViewSeriesListenerList extends ListenerList<ChartViewSeriesListener>
+ implements ChartViewSeriesListener {
+ public void seriesInserted(ChartView chartView, int index) {
+ for (ChartViewSeriesListener listener : this) {
+ listener.seriesInserted(chartView, index);
+ }
+ }
+
+ public void seriesRemoved(ChartView chartView, int index, int count) {
+ for (ChartViewSeriesListener listener : this) {
+ listener.seriesRemoved(chartView, index, count);
+ }
+ }
+
+ public void seriesUpdated(ChartView chartView, int index) {
+ for (ChartViewSeriesListener listener : this) {
+ listener.seriesUpdated(chartView, index);
+ }
+ }
+
+ public void seriesSorted(ChartView chartView) {
+ for (ChartViewSeriesListener listener : this) {
+ listener.seriesSorted(chartView);
+ }
+ }
+ }
+
+ private List<?> chartData;
+ private String seriesNameKey;
+
+ private String title = null;
+ private String horizontalAxisLabel = null;
+ private String verticalAxisLabel = null;
+ private boolean showLegend;
+
+ private ArrayList<Category> categories = new ArrayList<Category>();
+ private CategorySequence categorySequence = new CategorySequence();
+
+ private ListHandler chartDataHandler = new ListHandler();
+
+ private ChartViewListenerList chartViewListeners = new ChartViewListenerList();
+ private ChartViewCategoryListenerList chartViewCategoryListeners = new ChartViewCategoryListenerList();
+ private ChartViewSeriesListenerList chartViewSeriesListeners = new ChartViewSeriesListenerList();
+
+ public static final String DEFAULT_SERIES_NAME_KEY = "name";
+
+ public ChartView() {
+ this(DEFAULT_SERIES_NAME_KEY, new ArrayList<Object>());
+ }
+
+ public ChartView(String seriesNameKey, List<?> chartData) {
+ setSeriesNameKey(seriesNameKey);
+ setTitle(title);
+ setChartData(chartData);
+ setShowLegend(showLegend);
+ }
+
+ public CategorySequence getCategories() {
+ return categorySequence;
+ }
+
+ public List<?> getChartData() {
+ return chartData;
+ }
+
+ @SuppressWarnings("unchecked")
+ public void setChartData(List<?> chartData) {
+ if (chartData == null) {
+ throw new IllegalArgumentException("chartData is null.");
+ }
+
+ List<?> previousChartData = this.chartData;
+
+ if (previousChartData != chartData) {
+ if (previousChartData != null) {
+ ((List<Object>)previousChartData).getListListeners().remove(chartDataHandler);
+ }
+
+ ((List<Object>)chartData).getListListeners().add(chartDataHandler);
+
+ this.chartData = chartData;
+ chartViewListeners.chartDataChanged(this, previousChartData);
+ }
+ }
+
+ public String getSeriesNameKey() {
+ return seriesNameKey;
+ }
+
+ public void setSeriesNameKey(String seriesNameKey) {
+ if (seriesNameKey == null) {
+ throw new IllegalArgumentException("seriesNameKey is null.");
+ }
+
+ String previousSeriesNameKey = this.seriesNameKey;
+
+ if (previousSeriesNameKey != seriesNameKey) {
+ this.seriesNameKey = seriesNameKey;
+ chartViewListeners.seriesNameKeyChanged(this, previousSeriesNameKey);
+ }
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ String previousTitle = this.title;
+
+ if (previousTitle != title) {
+ this.title = title;
+ chartViewListeners.titleChanged(this, previousTitle);
+ }
+ }
+
+ public String getHorizontalAxisLabel() {
+ return horizontalAxisLabel;
+ }
+
+ public void setHorizontalAxisLabel(String horizontalAxisLabel) {
+ String previousHorizontalAxisLabel = this.horizontalAxisLabel;
+
+ if (previousHorizontalAxisLabel != horizontalAxisLabel) {
+ this.horizontalAxisLabel = horizontalAxisLabel;
+ chartViewListeners.horizontalAxisLabelChanged(this, previousHorizontalAxisLabel);
+ }
+ }
+
+ public String getVerticalAxisLabel() {
+ return verticalAxisLabel;
+ }
+
+ public void setVerticalAxisLabel(String verticalAxisLabel) {
+ String previousVerticalAxisLabel = this.verticalAxisLabel;
+
+ if (previousVerticalAxisLabel != verticalAxisLabel) {
+ this.verticalAxisLabel = verticalAxisLabel;
+ chartViewListeners.verticalAxisLabelChanged(this, previousVerticalAxisLabel);
+ }
+ }
+
+ public boolean getShowLegend() {
+ return showLegend;
+ }
+
+ public void setShowLegend(boolean showLegend) {
+ if (this.showLegend != showLegend) {
+ this.showLegend = showLegend;
+ chartViewListeners.showLegendChanged(this);
+ }
+ }
+
+ public Element getElementAt(int x, int y) {
+ return ((Skin)getSkin()).getElementAt(x, y);
+ }
+
+ public ListenerList<ChartViewListener> getChartViewListeners() {
+ return chartViewListeners;
+ }
+
+ public ListenerList<ChartViewCategoryListener> getChartViewCategoryListeners() {
+ return chartViewCategoryListeners;
+ }
+
+ public ListenerList<ChartViewSeriesListener> getChartViewSeriesListeners() {
+ return chartViewSeriesListeners;
+ }
+}
+
Added: incubator/pivot/branches/1.1/charts/src/pivot/charts/ChartViewCategoryListener.java
URL: http://svn.apache.org/viewvc/incubator/pivot/branches/1.1/charts/src/pivot/charts/ChartViewCategoryListener.java?rev=758461&view=auto
==============================================================================
--- incubator/pivot/branches/1.1/charts/src/pivot/charts/ChartViewCategoryListener.java (added)
+++ incubator/pivot/branches/1.1/charts/src/pivot/charts/ChartViewCategoryListener.java Wed Mar 25 23:08:38 2009
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2008 VMware, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package pivot.charts;
+
+import pivot.collections.Sequence;
+
+/**
+ * Chart view category listener interface.
+ *
+ * @author gbrown
+ */
+public interface ChartViewCategoryListener {
+ /**
+ * Fired when a category is inserted into a chart view.
+ *
+ * @param chartView
+ * @param index
+ */
+ public void categoryInserted(ChartView chartView, int index);
+
+ /**
+ * Fired when a category is removed from a chart view.
+ *
+ * @param chartView
+ * @param index
+ * @param categories
+ */
+ public void categoriesRemoved(ChartView chartView, int index, Sequence<ChartView.Category> categories);
+
+ /**
+ * Fired when a chart view's category key changes.
+ *
+ * @param chartView
+ * @param index
+ * @param previousKey
+ */
+ public void categoryKeyChanged(ChartView chartView, int index, String previousKey);
+
+ /**
+ * Fired when a chart view's category label changes.
+ *
+ * @param chartView
+ * @param index
+ * @param previousLabel
+ */
+ public void categoryLabelChanged(ChartView chartView, int index, String previousLabel);
+}
Added: incubator/pivot/branches/1.1/charts/src/pivot/charts/ChartViewListener.java
URL: http://svn.apache.org/viewvc/incubator/pivot/branches/1.1/charts/src/pivot/charts/ChartViewListener.java?rev=758461&view=auto
==============================================================================
--- incubator/pivot/branches/1.1/charts/src/pivot/charts/ChartViewListener.java (added)
+++ incubator/pivot/branches/1.1/charts/src/pivot/charts/ChartViewListener.java Wed Mar 25 23:08:38 2009
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2008 VMware, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package pivot.charts;
+
+import pivot.collections.List;
+
+/**
+ * Chart view listener interface.
+ *
+ * @author gbrown
+ */
+public interface ChartViewListener {
+ /**
+ * Fired when a chart view's data changes.
+ *
+ * @param chartView
+ * @param previousChartData
+ */
+ public void chartDataChanged(ChartView chartView, List<?> previousChartData);
+
+ /**
+ * Fired when a chart view's series name key changes.
+ *
+ * @param chartView
+ * @param previousSeriesNameKey
+ */
+ public void seriesNameKeyChanged(ChartView chartView, String previousSeriesNameKey);
+
+ /**
+ * Fired when a chart view's title changes.
+ *
+ * @param chartView
+ * @param previousTitle
+ */
+ public void titleChanged(ChartView chartView, String previousTitle);
+
+ /**
+ * Fired when a chart view's horizontal axis label changes.
+ *
+ * @param chartView
+ * @param previousHorizontalAxisLabel
+ */
+ public void horizontalAxisLabelChanged(ChartView chartView, String previousHorizontalAxisLabel);
+
+ /**
+ * Fired when a chart view's vertical axis label changes.
+ *
+ * @param chartView
+ * @param previousVerticalAxisLabel
+ */
+ public void verticalAxisLabelChanged(ChartView chartView, String previousVerticalAxisLabel);
+
+ /**
+ * Fired when a chart view's "show legend" flag changes.
+ *
+ * @param chartView
+ */
+ public void showLegendChanged(ChartView chartView);
+}
Added: incubator/pivot/branches/1.1/charts/src/pivot/charts/ChartViewSeriesListener.java
URL: http://svn.apache.org/viewvc/incubator/pivot/branches/1.1/charts/src/pivot/charts/ChartViewSeriesListener.java?rev=758461&view=auto
==============================================================================
--- incubator/pivot/branches/1.1/charts/src/pivot/charts/ChartViewSeriesListener.java (added)
+++ incubator/pivot/branches/1.1/charts/src/pivot/charts/ChartViewSeriesListener.java Wed Mar 25 23:08:38 2009
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2008 VMware, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package pivot.charts;
+
+/**
+ * Chart view series listener interface.
+ *
+ * @author gbrown
+ */
+public interface ChartViewSeriesListener {
+ /**
+ * Fired when a series is inserted into a chart view's data set.
+ *
+ * @param chartView
+ * @param index
+ */
+ public void seriesInserted(ChartView chartView, int index);
+
+ /**
+ * Fired when a series is removed from a chart view's data set.
+ *
+ * @param chartView
+ * @param index
+ * @param count
+ */
+ public void seriesRemoved(ChartView chartView, int index, int count);
+
+ /**
+ * Fired when a series is updated in a chart view's data set.
+ * @param chartView
+ * @param index
+ */
+ public void seriesUpdated(ChartView chartView, int index);
+
+ /**
+ * Fired when a chart view's series data is sorted.
+ *
+ * @param chartView
+ */
+ public void seriesSorted(ChartView chartView);
+}
Added: incubator/pivot/branches/1.1/charts/src/pivot/charts/HighLowChartView.java
URL: http://svn.apache.org/viewvc/incubator/pivot/branches/1.1/charts/src/pivot/charts/HighLowChartView.java?rev=758461&view=auto
==============================================================================
--- incubator/pivot/branches/1.1/charts/src/pivot/charts/HighLowChartView.java (added)
+++ incubator/pivot/branches/1.1/charts/src/pivot/charts/HighLowChartView.java Wed Mar 25 23:08:38 2009
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2008 VMware, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package pivot.charts;
+
+import pivot.charts.skin.HighLowChartViewSkin;
+
+/**
+ * Presents chart data using "open/high/low/close" plot.
+ *
+ * @author gbrown
+ */
+public class HighLowChartView extends ChartView {
+ public HighLowChartView() {
+ setSkin(new HighLowChartViewSkin());
+ }
+}