Begin restructuring using Griffon
0
.gitignore
vendored
Normal file → Executable file
3
.hgignore
Normal file → Executable file
@ -1,4 +1,3 @@
|
||||
release
|
||||
build
|
||||
.*.swp
|
||||
.*.swo
|
||||
staging
|
||||
|
43
TimeStamper.iml
Executable file
@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module relativePaths="true" type="GRIFFON_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="Griffon" name="Griffon">
|
||||
<configuration />
|
||||
</facet>
|
||||
<!--
|
||||
<facet type="Spring" name="Spring">
|
||||
<configuration>
|
||||
<fileset id="Griffon" name="Griffon" removed="false">
|
||||
<file>file://$MODULE_DIR$/web-app/WEB-INF/applicationContext.xml</file>
|
||||
</fileset>
|
||||
</configuration>
|
||||
</facet>
|
||||
-->
|
||||
</component>
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/griffon-app/conf" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/griffon-app/models" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/griffon-app/views" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/griffon-app/controllers" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/griffon-app/lifecycle" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/test/integration" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/test/unit" isTestSource="true" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="Griffon 0.2" level="project" />
|
||||
<orderEntry type="module-library">
|
||||
<library name="Griffon User Library">
|
||||
<CLASSES>
|
||||
<root url="file://$MODULE_DIR$/lib" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
<jarDirectory url="file://$MODULE_DIR$/lib" recursive="false" />
|
||||
</library>
|
||||
</orderEntry>
|
||||
</component>
|
||||
</module>
|
63
TimeStamper.ipr
Executable file
@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project relativePaths="false" version="4">
|
||||
<component name="ProjectFileVersion" converted="true" />
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/TimeStamper.iml" filepath="$PROJECT_DIR$/TimeStamper.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_5" assert-keyword="true" jdk-15="true" project-jdk-name="1.6" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
<component name="libraryTable">
|
||||
<library name="Griffon 0.2">
|
||||
<CLASSES>
|
||||
<root url="jar://c:\Program Files\griffon-0.2/lib/ant-junit.jar!/" />
|
||||
|
||||
<root url="jar://c:\Program Files\griffon-0.2/lib/ant-launcher.jar!/" />
|
||||
|
||||
<root url="jar://c:\Program Files\griffon-0.2/lib/ant-nodeps.jar!/" />
|
||||
|
||||
<root url="jar://c:\Program Files\griffon-0.2/lib/ant-trax.jar!/" />
|
||||
|
||||
<root url="jar://c:\Program Files\griffon-0.2/lib/ant.jar!/" />
|
||||
|
||||
<root url="jar://c:\Program Files\griffon-0.2/lib/asm-2.2.3.jar!/" />
|
||||
|
||||
<root url="jar://c:\Program Files\griffon-0.2/lib/commons-cli-1.0.jar!/" />
|
||||
|
||||
<root url="jar://c:\Program Files\griffon-0.2/lib/commons-lang-2.1.jar!/" />
|
||||
|
||||
<root url="jar://c:\Program Files\griffon-0.2/lib/commons-logging-1.1.jar!/" />
|
||||
|
||||
<root url="jar://c:\Program Files\griffon-0.2/lib/groovy-all-1.6.4.jar!/" />
|
||||
|
||||
<root url="jar://c:\Program Files\griffon-0.2/lib/jline-0.9.94.jar!/" />
|
||||
|
||||
<root url="jar://c:\Program Files\griffon-0.2/lib/junit-3.8.2.jar!/" />
|
||||
|
||||
<root url="jar://c:\Program Files\griffon-0.2/lib/log4j-1.2.15.jar!/" />
|
||||
|
||||
<root url="jar://c:\Program Files\griffon-0.2/lib/MultipleGradientPaint.jar!/" />
|
||||
|
||||
<root url="jar://c:\Program Files\griffon-0.2/lib/spring-2.5.6.jar!/" />
|
||||
|
||||
<root url="jar://c:\Program Files\griffon-0.2/lib/svnkit-1.2.0.jar!/" />
|
||||
|
||||
<root url="jar://c:\Program Files\griffon-0.2/lib/swing-worker.jar!/" />
|
||||
|
||||
<root url="jar://c:\Program Files\griffon-0.2/lib/swingx-0.9.3.jar!/" />
|
||||
|
||||
<root url="jar://c:\Program Files\griffon-0.2/lib/swingxbuilder-0.1.6-SNAPSHOT.jar!/" />
|
||||
|
||||
<root url="jar://c:\Program Files\griffon-0.2/dist/griffon-cli-0.2.jar!/" />
|
||||
|
||||
<root url="jar://c:\Program Files\griffon-0.2/dist/griffon-resources-0.2.jar!/" />
|
||||
|
||||
<root url="jar://c:\Program Files\griffon-0.2/dist/griffon-rt-0.2.jar!/" />
|
||||
|
||||
|
||||
</CLASSES>
|
||||
</library>
|
||||
</component>
|
||||
</project>
|
65
TimeStamper.iws
Executable file
@ -0,0 +1,65 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project relativePaths="false" version="4">
|
||||
<component name="ProjectPane">
|
||||
<subPane>
|
||||
<PATH>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="TimeStamper" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="TimeStamper" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="TimeStamper" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
||||
</PATH_ELEMENT>
|
||||
</PATH>
|
||||
</subPane>
|
||||
</component>
|
||||
<component name="ProjectView">
|
||||
<navigator currentView="ProjectPane" proportions="0.5" version="1" splitterProportion="0.5">
|
||||
<flattenPackages />
|
||||
<showMembers />
|
||||
<showModules />
|
||||
<showLibraryContents />
|
||||
<hideEmptyPackages />
|
||||
<abbreviatePackageNames />
|
||||
<showStructure ProjectPane="false" />
|
||||
<autoscrollToSource />
|
||||
<autoscrollFromSource />
|
||||
<sortByType />
|
||||
</navigator>
|
||||
</component>
|
||||
<!--
|
||||
<component name="RunManager" selected="Griffon Application.Griffon:TimeStamper">
|
||||
<configuration default="false" name="Griffon:TimeStamper" type="GriffonRunConfigurationType" factoryName="Griffon Application">
|
||||
<module name="TimeStamper" />
|
||||
<setting name="vmparams" value="" />
|
||||
<setting name="griffonparams" value="" />
|
||||
<setting name="hostik" value="localhost" />
|
||||
<setting name="port" value="8080" />
|
||||
<setting name="jndi" value="false" />
|
||||
<setting name="recomp" value="false" />
|
||||
<setting name="recompileFreq" value="3" />
|
||||
<setting name="launchBrowser" value="true" />
|
||||
<RunnerSettings RunnerId="Run" />
|
||||
<ConfigurationWrapper RunnerId="Run" />
|
||||
<method>
|
||||
<option name="Make" value="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<list size="1">
|
||||
<item index="0" class="java.lang.String" itemvalue="Griffon Application.Griffon:TimeStamper" />
|
||||
</list>
|
||||
</component>
|
||||
-->
|
||||
<component name="ToolWindowManager">
|
||||
<frame x="10" y="10" width="1260" height="984" extended-state="0" />
|
||||
<editor active="false" />
|
||||
<layout>
|
||||
<window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.25" sideWeight="0.6623068" order="0" side_tool="false" />
|
||||
</layout>
|
||||
</component>
|
||||
</project>
|
20
TimeStamper.launch
Executable file
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.codehaus.griffon.GriffonMain"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS" value="true"/>
|
||||
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER" javaProject="TimeStamper" path="1" type="4"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry id="org.eclipse.jdt.launching.classpathentry.defaultClasspath"> <memento exportedEntriesOnly="false" project="TimeStamper"/> </runtimeClasspathEntry> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/TimeStamper" path="3" type="2"/> "/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="4"/>
|
||||
</listAttribute>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="TimeStamper"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dbase.dir=${project_loc} -Dgriffon.env=development"/>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/TimeStamper"/>
|
||||
</listAttribute>
|
||||
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
|
||||
</launchConfiguration>
|
73
TimeStamper.tmproj
Executable file
@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>documents</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>filename</key>
|
||||
<string>TimeStamper.launch</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>filename</key>
|
||||
<string>build.xml</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>griffon-app</string>
|
||||
<key>regexFolderFilter</key>
|
||||
<string>!.*/(\.[^/]*|CVS|_darcs|_MTN|\{arch\}|blib|.*~\.nib|.*\.(framework|app|pbproj|pbxproj|xcode(proj)?|bundle))$</string>
|
||||
<key>sourceDirectory</key>
|
||||
<string>griffon-app</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>test</string>
|
||||
<key>regexFolderFilter</key>
|
||||
<string>!.*/(\.[^/]*|CVS|_darcs|_MTN|\{arch\}|blib|.*~\.nib|.*\.(framework|app|pbproj|pbxproj|xcode(proj)?|bundle))$</string>
|
||||
<key>sourceDirectory</key>
|
||||
<string>test</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>lib</string>
|
||||
<key>regexFolderFilter</key>
|
||||
<string>!.*/(\.[^/]*|CVS|_darcs|_MTN|\{arch\}|blib|.*~\.nib|.*\.(framework|app|pbproj|pbxproj|xcode(proj)?|bundle))$</string>
|
||||
<key>sourceDirectory</key>
|
||||
<string>lib</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>scripts</string>
|
||||
<key>regexFolderFilter</key>
|
||||
<string>!.*/(\.[^/]*|CVS|_darcs|_MTN|\{arch\}|blib|.*~\.nib|.*\.(framework|app|pbproj|pbxproj|xcode(proj)?|bundle))$</string>
|
||||
<key>sourceDirectory</key>
|
||||
<string>scripts</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>src</string>
|
||||
<key>regexFolderFilter</key>
|
||||
<string>!.*/(\.[^/]*|CVS|_darcs|_MTN|\{arch\}|blib|.*~\.nib|.*\.(framework|app|pbproj|pbxproj|xcode(proj)?|bundle))$</string>
|
||||
<key>sourceDirectory</key>
|
||||
<string>src</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>web-app</string>
|
||||
<key>regexFolderFilter</key>
|
||||
<string>!.*/(\.[^/]*|CVS|_darcs|_MTN|\{arch\}|blib|.*~\.nib|.*\.(framework|app|pbproj|pbxproj|xcode(proj)?|bundle))$</string>
|
||||
<key>sourceDirectory</key>
|
||||
<string>web-app</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>fileHierarchyDrawerWidth</key>
|
||||
<integer>200</integer>
|
||||
<key>metaData</key>
|
||||
<dict/>
|
||||
<key>showFileHierarchyDrawer</key>
|
||||
<true/>
|
||||
<key>windowFrame</key>
|
||||
<string>{{237, 127}, {742, 553}}</string>
|
||||
</dict>
|
||||
</plist>
|
4
application.properties
Executable file
@ -0,0 +1,4 @@
|
||||
#Thu Dec 17 08:19:45 CST 2009
|
||||
app.version=0.1
|
||||
app.griffon.version=0.2
|
||||
app.name=TimeStamper
|
168
build.xml
@ -1,95 +1,97 @@
|
||||
<?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.) -->
|
||||
<project name="TimeStamper" default="default" basedir=".">
|
||||
<description>Builds, tests, and runs the project TimeStamper.</description>
|
||||
<import file="nbproject/build-impl.xml"/>
|
||||
<!--
|
||||
<project name="timestamper" default="test">
|
||||
|
||||
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:
|
||||
<!-- =================================
|
||||
target: clean
|
||||
================================= -->
|
||||
<target name="clean" description="--> Cleans a Griffon application">
|
||||
<griffon>
|
||||
<arg value="clean"/>
|
||||
</griffon>
|
||||
</target>
|
||||
|
||||
-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
|
||||
<!-- =================================
|
||||
target: package
|
||||
================================= -->
|
||||
<target name="package" description="--> Packages up Griffon artifacts">
|
||||
<griffon>
|
||||
<arg value="package"/>
|
||||
</griffon>
|
||||
</target>
|
||||
|
||||
(Targets beginning with '-' are not intended to be called on their own.)
|
||||
<!-- =================================
|
||||
target: run-app
|
||||
================================= -->
|
||||
<target name="run-app" description="--> Run a Griffon application in standalone mode">
|
||||
<griffon>
|
||||
<arg value="run-app"/>
|
||||
</griffon>
|
||||
</target>
|
||||
|
||||
Example of inserting an obfuscator after compilation could look like this:
|
||||
<!-- =================================
|
||||
target: debug-app
|
||||
================================= -->
|
||||
<target name="debug-app" description="--> Run a Griffon application in standalone mode with debugging turned on">
|
||||
<griffon>
|
||||
<arg value="run-app"/>
|
||||
<arg value="-debug"/>
|
||||
</griffon>
|
||||
</target>
|
||||
|
||||
<target name="-post-compile">
|
||||
<obfuscate>
|
||||
<fileset dir="${build.classes.dir}"/>
|
||||
</obfuscate>
|
||||
</target>
|
||||
<!-- =================================
|
||||
target: run-webstart
|
||||
================================= -->
|
||||
<target name="run-webstart" description="--> Run a Griffon application in webstart mode">
|
||||
<griffon>
|
||||
<arg value="run-webstart"/>
|
||||
</griffon>
|
||||
</target>
|
||||
|
||||
For list of available properties check the imported
|
||||
nbproject/build-impl.xml file.
|
||||
<!-- =================================
|
||||
target: run-applet
|
||||
================================= -->
|
||||
<target name="run-applet" description="--> Run a Griffon application in applet mode">
|
||||
<griffon>
|
||||
<arg value="run-applet"/>
|
||||
</griffon>
|
||||
</target>
|
||||
|
||||
<!-- =================================
|
||||
target: test
|
||||
================================= -->
|
||||
<target name="test" description="--> Run a Griffon applications unit tests">
|
||||
<griffon>
|
||||
<arg value="test-app"/>
|
||||
</griffon>
|
||||
</target>
|
||||
|
||||
Another way to customize the build is by overriding existing main targets.
|
||||
The targets of interest are:
|
||||
<!-- =================================
|
||||
target: dist
|
||||
================================= -->
|
||||
<target name="dist" description="--> Packages up Griffon artifacts in the Production Environment">
|
||||
<griffon>
|
||||
<arg value="prod"/>
|
||||
<arg value="package"/>
|
||||
</griffon>
|
||||
</target>
|
||||
|
||||
-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="TimeStamper-impl.jar">
|
||||
<exec dir="bin" executable="launcher.exe">
|
||||
<arg file="${dist.jar}"/>
|
||||
<!-- set up the griffon macro -->
|
||||
<property environment="env"/>
|
||||
<property name="griffon.home" value="${env.GRIFFON_HOME}"/>
|
||||
<property name="jdk.home" value="${env.JAVA_HOME}"/>
|
||||
<condition property="griffon" value="griffon.bat">
|
||||
<os family="windows"/>
|
||||
</condition>
|
||||
<property name="griffon" value="griffon" />
|
||||
<macrodef name="griffon">
|
||||
<element name="griffon-args" implicit="yes"/>
|
||||
<sequential>
|
||||
<exec executable="${griffon.home}/bin/${griffon}" failonerror="true">
|
||||
<env key="JAVA_HOME" value="${jdk.home}"/>
|
||||
<env key="GRIFFON_HOME" value="${griffon.home}"/>
|
||||
<griffon-args/>
|
||||
</exec>
|
||||
</target>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
<!-- end set up the griffon macro -->
|
||||
|
||||
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.
|
||||
|
||||
-->
|
||||
<target name="release" depends="compile,jar">
|
||||
<mkdir dir="release" />
|
||||
<delete file="${dist.dir}/README.TXT" />
|
||||
<unjar dest="${build.classes.dir}">
|
||||
<fileset dir="lib">
|
||||
<include name="*.jar" />
|
||||
</fileset>
|
||||
</unjar>
|
||||
<jar destfile="release/TimeStamper_v${application.version}.jar" basedir="${build.classes.dir}">
|
||||
<manifest>
|
||||
<attribute name="Main-Class" value="jdbernard.timestamper.TimeStamperApp" />
|
||||
</manifest>
|
||||
</jar>
|
||||
<tar destfile="release/TimeStamper_v${application.version}.tar.gz" basedir="${dist.dir}" compression="gzip" />
|
||||
|
||||
</target>
|
||||
|
||||
<target name="-post-clean" >
|
||||
<delete>
|
||||
<fileset dir="${basedir}">
|
||||
<include name="*.log" />
|
||||
<include name="*.log.*" />
|
||||
<include name="timestamper.config" />
|
||||
</fileset>
|
||||
</delete>
|
||||
</target>
|
||||
</project>
|
||||
|
0
doc/feed.pdf
Normal file → Executable file
0
doc/feed.rst
Normal file → Executable file
0
doc/sample-txt-timeline-with-sync-info.txt
Normal file → Executable file
19
griffon-app/conf/Application.groovy
Executable file
@ -0,0 +1,19 @@
|
||||
application {
|
||||
title='TimeStamper'
|
||||
startupGroups = ['TimeStamperMain']
|
||||
|
||||
// Should Griffon exit when no Griffon created frames are showing?
|
||||
autoShutdown = true
|
||||
|
||||
// If you want some non-standard application class, apply it here
|
||||
//frameClass = 'javax.swing.JFrame'
|
||||
}
|
||||
mvcGroups {
|
||||
// MVC Group for "com.jdbernard.timestamper.TimeStamperMain"
|
||||
'TimeStamperMain' {
|
||||
model = 'com.jdbernard.timestamper.TimeStamperMainModel'
|
||||
controller = 'com.jdbernard.timestamper.TimeStamperMainController'
|
||||
view = 'com.jdbernard.timestamper.TimeStamperMainView'
|
||||
}
|
||||
|
||||
}
|
9
griffon-app/conf/Builder.groovy
Executable file
@ -0,0 +1,9 @@
|
||||
root {
|
||||
'groovy.swing.SwingBuilder' {
|
||||
controller = ['Threading']
|
||||
view = '*'
|
||||
}
|
||||
'griffon.app.ApplicationBuilder' {
|
||||
view = '*'
|
||||
}
|
||||
}
|
94
griffon-app/conf/Config.groovy
Executable file
@ -0,0 +1,94 @@
|
||||
// log4j configuration
|
||||
log4j {
|
||||
appender.stdout = 'org.apache.log4j.ConsoleAppender'
|
||||
appender.'stdout.layout'='org.apache.log4j.PatternLayout'
|
||||
appender.'stdout.layout.ConversionPattern'='[%r] %c{2} %m%n'
|
||||
appender.errors = 'org.apache.log4j.FileAppender'
|
||||
appender.'errors.layout'='org.apache.log4j.PatternLayout'
|
||||
appender.'errors.layout.ConversionPattern'='[%r] %c{2} %m%n'
|
||||
appender.'errors.File'='stacktrace.log'
|
||||
rootLogger='error,stdout'
|
||||
logger {
|
||||
griffon='error'
|
||||
StackTrace='error,errors'
|
||||
org {
|
||||
codehaus.griffon.commons='info' // core / classloading
|
||||
}
|
||||
}
|
||||
additivity.StackTrace=false
|
||||
}
|
||||
|
||||
// key signing information
|
||||
environments {
|
||||
development {
|
||||
signingkey {
|
||||
params {
|
||||
sigfile = 'GRIFFON'
|
||||
keystore = "${basedir}/griffon-app/conf/keys/devKeystore"
|
||||
alias = 'development'
|
||||
storepass = 'BadStorePassword'
|
||||
keypass = 'BadKeyPassword'
|
||||
lazy = true // only sign when unsigned
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
test {
|
||||
griffon {
|
||||
jars {
|
||||
sign = false
|
||||
pack = false
|
||||
}
|
||||
}
|
||||
}
|
||||
production {
|
||||
signingkey {
|
||||
params {
|
||||
sigfile = 'GRIFFON'
|
||||
keystore = 'CHANGE ME'
|
||||
alias = 'CHAMGE ME'
|
||||
// NOTE: for production keys it is more secure to rely on key prompting
|
||||
// no value means we will prompt //storepass = 'BadStorePassword'
|
||||
// no value means we will prompt //keypass = 'BadKeyPassword'
|
||||
lazy = false // sign, regardless of existing signatures
|
||||
}
|
||||
}
|
||||
|
||||
griffon {
|
||||
jars {
|
||||
sign = true
|
||||
pack = true
|
||||
destDir = "${basedir}/staging"
|
||||
}
|
||||
webstart {
|
||||
codebase = 'CHANGE ME'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
griffon {
|
||||
memory {
|
||||
//max = '64m'
|
||||
//min = '2m'
|
||||
//maxPermSize = '64m'
|
||||
}
|
||||
jars {
|
||||
sign = false
|
||||
pack = false
|
||||
destDir = "${basedir}/staging"
|
||||
jarName = "${appName}.jar"
|
||||
}
|
||||
extensions {
|
||||
jarUrls = []
|
||||
jnlpUrls = []
|
||||
}
|
||||
webstart {
|
||||
codebase = "${new File(griffon.jars.destDir).toURI().toASCIIString()}"
|
||||
jnlp = 'application.jnlp'
|
||||
}
|
||||
applet {
|
||||
jnlp = 'applet.jnlp'
|
||||
html = 'applet.html'
|
||||
}
|
||||
}
|
43
griffon-app/conf/webstart/applet.html
Executable file
@ -0,0 +1,43 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<script src="http://java.com/js/deployJava.js"></script>
|
||||
<script>
|
||||
var attributes = {id: '@griffonAppName@',
|
||||
codebase:'@griffonAppCodebase@',
|
||||
code:'@griffonAppletClass@',
|
||||
archive:'@appletJars@',
|
||||
width:'240', height:'320'} ;
|
||||
var parameters = {fontSize:16,
|
||||
java_arguments: "-Djnlp.packEnabled=true",
|
||||
jnlp_href:'@griffonAppCodebase@/applet.jnlp',
|
||||
draggable:'true',
|
||||
image:'griffon.png',
|
||||
boxmessage:'Loading @griffonAppName@',
|
||||
boxbgcolor:'#FFFFFF', boxfgcolor:'#000000',
|
||||
codebase_lookup: 'false'} ;
|
||||
var version = '1.5.0' ;
|
||||
deployJava.runApplet(attributes, parameters, version);
|
||||
</script>
|
||||
<!--
|
||||
<APPLET CODEBASE='@griffonAppCodebase@'
|
||||
CODE='@griffonAppletClass@'
|
||||
ARCHIVE='@appletJars@'
|
||||
WIDTH='240' HEIGHT='320'>
|
||||
<PARAM NAME="java_arguments" VALUE="-Djnlp.packEnabled=true">
|
||||
<PARAM NAME='jnlp_href' VALUE='@griffonAppCodebase@/applet.jnlp'>
|
||||
<PARAM NAME='dragggable' VALUE='true'>
|
||||
<PARAM NAME='image' VALUE='griffon.png'>
|
||||
<PARAM NAME='boxmessage' VALUE='Loading @griffonAppName@'>
|
||||
<PARAM NAME='boxbgcolor' VALUE='#FFFFFF'>
|
||||
<PARAM NAME='boxfgcolor' VALUE='#000000'>
|
||||
<PARAM NAME='codebase_lookup' VALUE='false'>
|
||||
</APPLET>
|
||||
-->
|
||||
</body>
|
||||
</html>
|
55
griffon-app/conf/webstart/applet.jnlp
Executable file
@ -0,0 +1,55 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE jnlp SYSTEM "http://java.sun.com/dtd/JNLP-1.5.dtd">
|
||||
<jnlp
|
||||
version="@griffonAppVersion@"
|
||||
codebase="@griffonAppCodebase@"
|
||||
href="@jnlpFileName@"
|
||||
>
|
||||
<information>
|
||||
<title>@griffonAppName@</title>
|
||||
<vendor>@griffonAppName@</vendor>
|
||||
<!--<homepage href="http://app.example.com/"/>-->
|
||||
<!--fallback description-->
|
||||
<description>@griffonAppName@</description>
|
||||
<description kind="one-line">@griffonAppName@</description>
|
||||
<description kind="short">@griffonAppName@</description>
|
||||
<description kind="tooltip">@griffonAppName@</description>
|
||||
<!-- fallback icon -->
|
||||
<icon href="griffon-icon-48x48.png" kind="default" width="48" height="48"/>
|
||||
<!-- icon used for splash screen -->
|
||||
<icon href="griffon.png" kind="splash" width="381" height="123"/>
|
||||
<!-- icon used in menu -->
|
||||
<icon href="griffon-icon-16x16.png" kind="shortcut" width="16" height="16"/>
|
||||
<!-- icon used on desktop -->
|
||||
<icon href="griffon-icon-32x32.png" kind="shortcut" width="32" height="32"/>
|
||||
<!-- to create shortcuts, uncomment this
|
||||
<shortcut online="true">
|
||||
<desktop/>
|
||||
<menu submenu="@griffonAppName@"/>
|
||||
</shortcut>
|
||||
-->
|
||||
<offline-allowed/>
|
||||
</information>
|
||||
<security>
|
||||
<all-permissions/>
|
||||
<!--<j2ee-application-client-permissions/>-->
|
||||
</security>
|
||||
<resources>
|
||||
<property name="jnlp.packEnabled" value="true"/>
|
||||
<j2se version="1.5+" @memoryOptions@/>
|
||||
<!-- auto-added jars follow, griffon-rt, app, and groovy -->
|
||||
@jnlpJars@
|
||||
<!-- Add all extra jars below here, or the app may break -->
|
||||
@jnlpExtensions@
|
||||
</resources>
|
||||
<applet-desc
|
||||
documentbase="@griffonAppCodebase@"
|
||||
name="@griffonAppName@Applet"
|
||||
main-class="@griffonAppletClass@"
|
||||
width="320"
|
||||
height="640">
|
||||
<!-- params are ignored when referenced from web page for 6u10 -->
|
||||
<!--<param name="key1" value="value1"/>-->
|
||||
<!--<param name="key2" value="value2"/>-->
|
||||
</applet-desc>
|
||||
</jnlp>
|
50
griffon-app/conf/webstart/application.jnlp
Executable file
@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE jnlp SYSTEM "http://java.sun.com/dtd/JNLP-1.5.dtd">
|
||||
<jnlp
|
||||
version="@griffonAppVersion@"
|
||||
codebase="@griffonAppCodebase@"
|
||||
href="@jnlpFileName@"
|
||||
>
|
||||
<information>
|
||||
<title>@griffonAppName@</title>
|
||||
<vendor>@griffonAppName@</vendor>
|
||||
<!--<homepage href="http://app.example.com/"/>-->
|
||||
<!--fallback description-->
|
||||
<description>@griffonAppName@</description>
|
||||
<description kind="one-line">@griffonAppName@</description>
|
||||
<description kind="short">@griffonAppName@</description>
|
||||
<description kind="tooltip">@griffonAppName@</description>
|
||||
<!-- fallback icon -->
|
||||
<icon href="griffon-icon-48x48.png" kind="default" width="48" height="48"/>
|
||||
<!-- icon used for splash screen -->
|
||||
<icon href="griffon.png" kind="splash" width="381" height="123"/>
|
||||
<!-- icon used in menu -->
|
||||
<icon href="griffon-icon-16x16.png" kind="shortcut" width="16" height="16"/>
|
||||
<!-- icon used on desktop -->
|
||||
<icon href="griffon-icon-32x32.png" kind="shortcut" width="32" height="32"/>
|
||||
<!-- to create shortcuts, uncomment this
|
||||
<shortcut online="true">
|
||||
<desktop/>
|
||||
<menu submenu="@griffonAppName@"/>
|
||||
</shortcut>
|
||||
<offline-allowed/>
|
||||
-->
|
||||
</information>
|
||||
<security>
|
||||
<all-permissions/>
|
||||
<!--<j2ee-application-client-permissions/>-->
|
||||
</security>
|
||||
<resources>
|
||||
<property name="jnlp.packEnabled" value="true"/>
|
||||
<j2se version="1.5+" @memoryOptions@/>
|
||||
<!-- auto-added jars follow, griffon-rt, app, and groovy -->
|
||||
@jnlpJars@
|
||||
<!-- Add all extra jars below here, or the app may break -->
|
||||
@jnlpExtensions@
|
||||
</resources>
|
||||
<application-desc main-class="@griffonApplicationClass@">
|
||||
<!-- params are ignored when referenced from web page for 6u10 -->
|
||||
<!--<param name="key1" value="value1"/>-->
|
||||
<!--<param name="key2" value="value2"/>-->
|
||||
</application-desc>
|
||||
</jnlp>
|
BIN
griffon-app/conf/webstart/griffon-icon-128x128.png
Executable file
After Width: | Height: | Size: 14 KiB |
BIN
griffon-app/conf/webstart/griffon-icon-16x16.png
Executable file
After Width: | Height: | Size: 1.0 KiB |
BIN
griffon-app/conf/webstart/griffon-icon-24x24.png
Executable file
After Width: | Height: | Size: 1.9 KiB |
BIN
griffon-app/conf/webstart/griffon-icon-256x256.png
Executable file
After Width: | Height: | Size: 31 KiB |
BIN
griffon-app/conf/webstart/griffon-icon-32x32.png
Executable file
After Width: | Height: | Size: 2.5 KiB |
BIN
griffon-app/conf/webstart/griffon-icon-48x48.png
Executable file
After Width: | Height: | Size: 5.1 KiB |
BIN
griffon-app/conf/webstart/griffon-icon-64x64.png
Executable file
After Width: | Height: | Size: 5.8 KiB |
BIN
griffon-app/conf/webstart/griffon.png
Executable file
After Width: | Height: | Size: 15 KiB |
@ -0,0 +1,16 @@
|
||||
package com.jdbernard.timestamper
|
||||
|
||||
class TimeStamperMainController {
|
||||
// these will be injected by Griffon
|
||||
def model
|
||||
def view
|
||||
|
||||
void mvcGroupInit(Map args) {
|
||||
// this method is called after model and view are injected
|
||||
}
|
||||
|
||||
/*
|
||||
def action = { evt = null ->
|
||||
}
|
||||
*/
|
||||
}
|
24
griffon-app/lifecycle/Initialize.groovy
Executable file
@ -0,0 +1,24 @@
|
||||
/*
|
||||
* This script is executed inside the EDT, so be sure to
|
||||
* call long running code in another thread.
|
||||
*
|
||||
* You have the following options
|
||||
* - SwingBuilder.doOutside { // your code }
|
||||
* - Thread.start { // your code }
|
||||
* - SwingXBuilder.withWorker( start: true ) {
|
||||
* onInit { // initialization (optional, runs in current thread) }
|
||||
* work { // your code }
|
||||
* onDone { // finish (runs inside EDT) }
|
||||
* }
|
||||
*
|
||||
* You have the following options to run code again inside EDT
|
||||
* - SwingBuilder.doLater { // your code }
|
||||
* - SwingBuilder.edt { // your code }
|
||||
* - SwingUtilities.invokeLater { // your code }
|
||||
*/
|
||||
|
||||
import groovy.swing.SwingBuilder
|
||||
import griffon.util.GriffonPlatformHelper
|
||||
|
||||
GriffonPlatformHelper.tweakForNativePlatform(app)
|
||||
SwingBuilder.lookAndFeel('mac', 'nimbus', 'gtk', ['metal', [boldFonts: false]])
|
18
griffon-app/lifecycle/Ready.groovy
Executable file
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* This script is executed inside the EDT, so be sure to
|
||||
* call long running code in another thread.
|
||||
*
|
||||
* You have the following options
|
||||
* - SwingBuilder.doOutside { // your code }
|
||||
* - Thread.start { // your code }
|
||||
* - SwingXBuilder.withWorker( start: true ) {
|
||||
* onInit { // initialization (optional, runs in current thread) }
|
||||
* work { // your code }
|
||||
* onDone { // finish (runs inside EDT) }
|
||||
* }
|
||||
*
|
||||
* You have the following options to run code again inside EDT
|
||||
* - SwingBuilder.doLater { // your code }
|
||||
* - SwingBuilder.edt { // your code }
|
||||
* - SwingUtilities.invokeLater { // your code }
|
||||
*/
|
18
griffon-app/lifecycle/Shutdown.groovy
Executable file
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* This script is executed inside the EDT, so be sure to
|
||||
* call long running code in another thread.
|
||||
*
|
||||
* You have the following options
|
||||
* - SwingBuilder.doOutside { // your code }
|
||||
* - Thread.start { // your code }
|
||||
* - SwingXBuilder.withWorker( start: true ) {
|
||||
* onInit { // initialization (optional, runs in current thread) }
|
||||
* work { // your code }
|
||||
* onDone { // finish (runs inside EDT) }
|
||||
* }
|
||||
*
|
||||
* You have the following options to run code again inside EDT
|
||||
* - SwingBuilder.doLater { // your code }
|
||||
* - SwingBuilder.edt { // your code }
|
||||
* - SwingUtilities.invokeLater { // your code }
|
||||
*/
|
18
griffon-app/lifecycle/Startup.groovy
Executable file
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* This script is executed inside the EDT, so be sure to
|
||||
* call long running code in another thread.
|
||||
*
|
||||
* You have the following options
|
||||
* - SwingBuilder.doOutside { // your code }
|
||||
* - Thread.start { // your code }
|
||||
* - SwingXBuilder.withWorker( start: true ) {
|
||||
* onInit { // initialization (optional, runs in current thread) }
|
||||
* work { // your code }
|
||||
* onDone { // finish (runs inside EDT) }
|
||||
* }
|
||||
*
|
||||
* You have the following options to run code again inside EDT
|
||||
* - SwingBuilder.doLater { // your code }
|
||||
* - SwingBuilder.edt { // your code }
|
||||
* - SwingUtilities.invokeLater { // your code }
|
||||
*/
|
0
timeline.default.txt → griffon-app/lifecycle/Stop.groovy
Normal file → Executable file
@ -0,0 +1,12 @@
|
||||
package com.jdbernard.timestamper
|
||||
|
||||
import groovy.beans.Bindable
|
||||
import com.jdbernard.timestamper.core.Timeline
|
||||
import com.jdbernard.timestamper.core.TimelineMarker
|
||||
import com.jdbernard.timestamper.core.TimelineProperties
|
||||
|
||||
class TimeStamperMainModel {
|
||||
@Bindable TimelineMarker currentMarker
|
||||
@Bindable Timeline timeline
|
||||
@Bindable TimelineProperties properties
|
||||
}
|
0
src/jdbernard/timestamper/gui/resources/icons/appointment-new-16x16.png → griffon-app/resources/appointment-new-16x16.png
Normal file → Executable file
Before Width: | Height: | Size: 897 B After Width: | Height: | Size: 897 B |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
BIN
griffon-app/resources/griffon-icon-128x128.png
Executable file
After Width: | Height: | Size: 14 KiB |
BIN
griffon-app/resources/griffon-icon-16x16.png
Executable file
After Width: | Height: | Size: 1.0 KiB |
BIN
griffon-app/resources/griffon-icon-24x24.png
Executable file
After Width: | Height: | Size: 1.9 KiB |
BIN
griffon-app/resources/griffon-icon-256x256.png
Executable file
After Width: | Height: | Size: 31 KiB |
BIN
griffon-app/resources/griffon-icon-32x32.png
Executable file
After Width: | Height: | Size: 2.5 KiB |
BIN
griffon-app/resources/griffon-icon-48x48.png
Executable file
After Width: | Height: | Size: 5.1 KiB |
BIN
griffon-app/resources/griffon-icon-64x64.png
Executable file
After Width: | Height: | Size: 5.8 KiB |
BIN
griffon-app/resources/griffon.png
Executable file
After Width: | Height: | Size: 15 KiB |
@ -0,0 +1,17 @@
|
||||
package com.jdbernard.timestamper
|
||||
|
||||
import java.awt.Color
|
||||
|
||||
application(title:'TimeStamper',
|
||||
//size:[320,480],
|
||||
pack:true,
|
||||
//location:[50,50],
|
||||
undecorated:true,
|
||||
locationByPlatform:true,
|
||||
iconImage: imageIcon('/appointment-new-32x32.png').image,
|
||||
iconImages: [imageIcon('/appointment-new-32x32.png').image,
|
||||
imageIcon('/appointment-new-16x16.png').image]
|
||||
) {
|
||||
// add content here
|
||||
label('Content Goes Here') // deleteme
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
Manifest-Version: 1.0
|
||||
X-COMMENT: Main-Class will be added automatically by build
|
||||
|
21
master.jnlp
@ -1,21 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<jnlp spec="1.0+" codebase="${jnlp.codebase}" href="launch.jnlp">
|
||||
<information>
|
||||
<title>${APPLICATION.TITLE}</title>
|
||||
<vendor>${APPLICATION.VENDOR}</vendor>
|
||||
<homepage href="${APPLICATION.HOMEPAGE}"/>
|
||||
<description>${APPLICATION.DESC}</description>
|
||||
<description kind="short">${APPLICATION.DESC.SHORT}</description>
|
||||
<!--${JNLP.ICONS}-->
|
||||
<!--${JNLP.OFFLINE.ALLOWED}-->
|
||||
</information>
|
||||
<!--${JNLP.SECURITY}-->
|
||||
<resources>
|
||||
<!--${JNLP.RESOURCES.RUNTIME}-->
|
||||
<!--${JNLP.RESOURCES.MAIN.JAR}-->
|
||||
<!--${JNLP.RESOURCES.JARS}-->
|
||||
</resources>
|
||||
<application-desc main-class="${jnlp.main.class}">
|
||||
<!--${JNLP.APPLICATION.ARGS}-->
|
||||
</application-desc>
|
||||
</jnlp>
|
@ -1,701 +0,0 @@
|
||||
<?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="TimeStamper-impl">
|
||||
<import file="jnlp-impl.xml"/>
|
||||
<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="manifest.available+main.class">
|
||||
<and>
|
||||
<isset property="manifest.available"/>
|
||||
<isset property="main.class"/>
|
||||
<not>
|
||||
<equals arg1="${main.class}" arg2="" trim="true"/>
|
||||
</not>
|
||||
</and>
|
||||
</condition>
|
||||
<condition property="manifest.available+main.class+mkdist.available">
|
||||
<and>
|
||||
<istrue value="${manifest.available+main.class}"/>
|
||||
<isset property="libs.CopyLibs.classpath"/>
|
||||
</and>
|
||||
</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}"/>
|
||||
<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>
|
||||
<condition else="" property="javac.compilerargs.jaxws" value="-Djava.endorsed.dirs='${jaxws.endorsed.dir}'">
|
||||
<and>
|
||||
<isset property="jaxws.endorsed.dir"/>
|
||||
<available file="nbproject/jaxws-build.xml"/>
|
||||
</and>
|
||||
</condition>
|
||||
</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}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}">
|
||||
<src>
|
||||
<dirset dir="@{gensrcdir}" erroronmissingdir="false">
|
||||
<include name="*"/>
|
||||
</dirset>
|
||||
</src>
|
||||
<classpath>
|
||||
<path path="@{classpath}"/>
|
||||
</classpath>
|
||||
<compilerarg line="${javac.compilerargs} ${javac.compilerargs.jaxws}"/>
|
||||
<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">
|
||||
<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="${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="${debug-args-line}"/>
|
||||
<jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
|
||||
<jvmarg value="-Dfile.encoding=${source.encoding}"/>
|
||||
<redirector errorencoding="${source.encoding}" inputencoding="${source.encoding}" outputencoding="${source.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 value="-Dfile.encoding=${source.encoding}"/>
|
||||
<redirector errorencoding="${source.encoding}" inputencoding="${source.encoding}" outputencoding="${source.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 depends="init" name="deps-jar" unless="no.deps"/>
|
||||
<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">
|
||||
<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">
|
||||
<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="libs.CopyLibs.classpath" name="-do-jar-with-libraries-without-manifest" unless="manifest.available+main.class">
|
||||
<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}"/>
|
||||
</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-manifest,-post-jar,jnlp" 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,-do-not-recompile,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,-do-not-recompile,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,-do-not-recompile,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,-do-not-recompile,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,-do-not-recompile,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
|
||||
<!--
|
||||
=======================
|
||||
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,-do-not-recompile,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 depends="init" name="deps-clean" unless="no.deps"/>
|
||||
<target depends="init" name="-do-clean">
|
||||
<delete dir="${build.dir}"/>
|
||||
<delete dir="${dist.dir}"/>
|
||||
</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"/>
|
||||
</project>
|
@ -1,4 +0,0 @@
|
||||
#Tue Sep 09 15:11:02 CDT 2008
|
||||
$label=Web Start
|
||||
$target.debug=jws-debug
|
||||
$target.run=jws-run
|
@ -1,8 +0,0 @@
|
||||
build.xml.data.CRC32=6a978a17
|
||||
build.xml.script.CRC32=6e5ad54e
|
||||
build.xml.stylesheet.CRC32=be360661
|
||||
# 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=618e720f
|
||||
nbproject/build-impl.xml.script.CRC32=70e39602
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=5c621a33@1.26.2.45
|
@ -1,461 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
|
||||
|
||||
Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
|
||||
|
||||
|
||||
The contents of this file are subject to the terms of either the GNU
|
||||
General Public License Version 2 only ("GPL") or the Common
|
||||
Development and Distribution License("CDDL") (collectively, the
|
||||
"License"). You may not use this file except in compliance with the
|
||||
License. You can obtain a copy of the License at
|
||||
http://www.netbeans.org/cddl-gplv2.html
|
||||
or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
|
||||
specific language governing permissions and limitations under the
|
||||
License. When distributing the software, include this License Header
|
||||
Notice in each file and include the License file at
|
||||
nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
|
||||
particular file as subject to the "Classpath" exception as provided
|
||||
by Sun in the GPL Version 2 section of the License file that
|
||||
accompanied this code. If applicable, add the following below the
|
||||
License Header, with the fields enclosed by brackets [] replaced by
|
||||
your own identifying information:
|
||||
"Portions Copyrighted [year] [name of copyright owner]"
|
||||
|
||||
Contributor(s):
|
||||
|
||||
The Original Software is NetBeans. The Initial Developer of the Original
|
||||
Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
|
||||
Microsystems, Inc. All Rights Reserved.
|
||||
|
||||
If you wish your version of this file to be governed by only the CDDL
|
||||
or only the GPL Version 2, indicate your decision by adding
|
||||
"[Contributor] elects to include this software in this distribution
|
||||
under the [CDDL or GPL Version 2] license." If you do not indicate a
|
||||
single choice of license, a recipient has the option to distribute
|
||||
your version of this file under either the CDDL, the GPL Version 2 or
|
||||
to extend the choice of license to its licensees as provided above.
|
||||
However, if you add GPL Version 2 code and therefore, elected the GPL
|
||||
Version 2 license, then the option applies only if the new code is
|
||||
made subject to such option by the copyright holder.
|
||||
-->
|
||||
|
||||
<project name="jnlp-impl" default="default" basedir="..">
|
||||
|
||||
<property name="master.jnlp.file" location="master.jnlp"/>
|
||||
<property name="launch.jnlp.file" value="launch.jnlp"/>
|
||||
<property name="jnlp.dest.dir" location="dist"/>
|
||||
|
||||
<!-- helper file to create list of arguments, etc. -->
|
||||
<property name="helper.file" location="helper.txt"/>
|
||||
|
||||
<target name="default">
|
||||
<echo message="Default target is not set."/>
|
||||
</target>
|
||||
|
||||
<!-- Main target -->
|
||||
|
||||
<target name="jnlp" depends="-init-check,-test-jnlp-enabled" if="is.jnlp.enabled">
|
||||
<delete file="dist/lib/javaws.jar" failonerror="false"/>
|
||||
<antcall target="generate-jnlp"/>
|
||||
</target>
|
||||
|
||||
<!-- Generate master -->
|
||||
|
||||
<target name="-check-for-master.jnlp">
|
||||
<available file="${master.jnlp.file}" property="master.jnlp.exists"/>
|
||||
</target>
|
||||
<target name="jnlp-init-generate-master" depends="-check-for-master.jnlp" unless="master.jnlp.exists">
|
||||
<echo file="${master.jnlp.file}" encoding="UTF-8"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
|
||||
<jnlp spec="1.0+" codebase="$${jnlp.codebase}" href="launch.jnlp">
|
||||
<information>
|
||||
<title>$${APPLICATION.TITLE}</title>
|
||||
<vendor>$${APPLICATION.VENDOR}</vendor>
|
||||
<homepage href="$${APPLICATION.HOMEPAGE}"/>
|
||||
<description>$${APPLICATION.DESC}</description>
|
||||
<description kind="short">$${APPLICATION.DESC.SHORT}</description>
|
||||
<!--$${JNLP.ICONS}-->
|
||||
<!--$${JNLP.OFFLINE.ALLOWED}-->
|
||||
</information>
|
||||
<!--$${JNLP.SECURITY}-->
|
||||
<resources>
|
||||
<!--$${JNLP.RESOURCES.RUNTIME}-->
|
||||
<!--$${JNLP.RESOURCES.MAIN.JAR}-->
|
||||
<!--$${JNLP.RESOURCES.JARS}-->
|
||||
</resources>
|
||||
<application-desc main-class="$${jnlp.main.class}">
|
||||
<!--$${JNLP.APPLICATION.ARGS}-->
|
||||
</application-desc>
|
||||
</jnlp>
|
||||
]]></echo>
|
||||
</target>
|
||||
|
||||
<!-- Initial check -->
|
||||
|
||||
<target name="-init-check">
|
||||
<fail unless="application.title" message="Must set application title."/>
|
||||
<fail unless="application.vendor" message="Must set application vendor."/>
|
||||
</target>
|
||||
|
||||
<!-- Icons -->
|
||||
|
||||
<target name="-init-icons" depends="-preinit-icons,-set-icon-elem,-set-splash-elem">
|
||||
<property name="jnlp.icon.elem" value=""/>
|
||||
<property name="application.splash.elem" value=""/>
|
||||
<property name="icon.separator" value=""/>
|
||||
<property name="jnlp.icons.value" value="${jnlp.icon.elem}${icon.separator}${application.splash.elem}"/>
|
||||
</target>
|
||||
<target name="-preinit-icons" depends="-copy-app-icon,-copy-app-splash"/>
|
||||
<target name="-copy-app-icon" if="jnlp.icon" depends="-get-app-icon-name">
|
||||
<copy file="${jnlp.icon}" todir="${jnlp.dest.dir}" failonerror="false"/>
|
||||
<available file="${jnlp.dest.dir}${file.separator}${jnlp.icon.name}" property="jnlp.icon.copied"/>
|
||||
</target>
|
||||
<target name="-copy-app-splash" if="application.splash" depends="-get-app-splash-name">
|
||||
<copy file="${application.splash}" todir="${jnlp.dest.dir}" failonerror="false"/>
|
||||
<available file="${jnlp.dest.dir}${file.separator}${application.splash.name}" property="application.splash.copied"/>
|
||||
</target>
|
||||
<target name="-get-app-icon-name" if="jnlp.icon">
|
||||
<dirname file="${jnlp.icon}" property="jnlp.icon.basedir"/>
|
||||
<pathconvert property="jnlp.icon.name" setonempty="false">
|
||||
<path location="${jnlp.icon}"/>
|
||||
<map from="${jnlp.icon.basedir}${file.separator}" to=""/>
|
||||
</pathconvert>
|
||||
</target>
|
||||
<target name="-get-app-splash-name" if="application.splash">
|
||||
<dirname file="${application.splash}" property="application.splash.basedir"/>
|
||||
<pathconvert property="application.splash.name" setonempty="false">
|
||||
<path location="${application.splash}"/>
|
||||
<map from="${application.splash.basedir}${file.separator}" to=""/>
|
||||
</pathconvert>
|
||||
</target>
|
||||
<target name="-set-icon-elem" if="jnlp.icon.copied">
|
||||
<property name="jnlp.icon.elem" value=' <icon href="${jnlp.icon.name}" kind="default"/>'/>
|
||||
</target>
|
||||
<target name="-set-splash-elem" if="application.splash.copied" depends="-set-icon-elem">
|
||||
<property name="application.splash.elem" value=' <icon href="${application.splash.name}" kind="splash"/>'/>
|
||||
<condition property="icon.separator" value="${line.separator}">
|
||||
<isset property="jnlp.icon.elem"/>
|
||||
</condition>
|
||||
</target>
|
||||
|
||||
<!-- Offline-Allowed -->
|
||||
|
||||
<target name="-init-offline" if="offline.allowed.set" depends="-preinit-offline">
|
||||
<property name="jnlp.offline.allowed.value" value=" <offline-allowed/>"/>
|
||||
</target>
|
||||
<target name="-preinit-offline">
|
||||
<condition property="offline.allowed.set">
|
||||
<equals arg1="${jnlp.offline-allowed}" arg2="true" trim="true"/>
|
||||
</condition>
|
||||
</target>
|
||||
|
||||
<!-- Descriptions -->
|
||||
|
||||
<target name="-init-descriptions" depends="-descriptions-props-check,-init-desc-value,-init-desc-value-short">
|
||||
<property name="application.desc.value" value="${application.title}"/>
|
||||
<property name="application.desc.short.value" value="${application.title}"/>
|
||||
</target>
|
||||
<target name="-descriptions-props-check">
|
||||
<condition property="application.desc.set">
|
||||
<and>
|
||||
<isset property="application.desc"/>
|
||||
<not>
|
||||
<equals arg1="${application.desc}" arg2="" trim="true"/>
|
||||
</not>
|
||||
</and>
|
||||
</condition>
|
||||
<condition property="application.desc.short.set">
|
||||
<and>
|
||||
<isset property="application.desc.short"/>
|
||||
<not>
|
||||
<equals arg1="${application.desc.short}" arg2="" trim="true"/>
|
||||
</not>
|
||||
</and>
|
||||
</condition>
|
||||
</target>
|
||||
<target name="-init-desc-value" if="application.desc.set">
|
||||
<property name="application.desc.value" value="${application.desc}"/>
|
||||
</target>
|
||||
<target name="-init-desc-value-short" if="application.desc.short.set">
|
||||
<property name="application.desc.short.value" value="${application.desc.short}"/>
|
||||
</target>
|
||||
|
||||
<!-- Security -->
|
||||
|
||||
<target name="-init-security" depends="-check-signing-possible" if="jnlp.signed.true+signjarstask.available">
|
||||
<property name="jnlp.security" value=" <security>${line.separator} <all-permissions/>${line.separator} </security>"/>
|
||||
</target>
|
||||
<target name="-security-props-check">
|
||||
<condition property="jnlp.signed.true">
|
||||
<istrue value="${jnlp.signed}"/>
|
||||
</condition>
|
||||
</target>
|
||||
<target name="-jnlp-init-keystore" depends="-jnlp-init-keystore-props,-check-keystore-exists" unless="jnlp.signjar.keystore.exists">
|
||||
<echo message="${application.vendor}" file="${helper.file}"/>
|
||||
<loadfile property="application.vendor.filtered" srcfile="${helper.file}">
|
||||
<filterchain>
|
||||
<deletecharacters chars=","/>
|
||||
</filterchain>
|
||||
</loadfile>
|
||||
<delete file="${helper.file}"/>
|
||||
<property name="jnlp.signjar.vendor" value="CN=${application.vendor.filtered}"/>
|
||||
<echo message="Going to create default keystore in ${jnlp.signjar.keystore}"/>
|
||||
<genkey dname="${jnlp.signjar.vendor}" alias="${jnlp.signjar.alias}" keystore="${jnlp.signjar.keystore}"
|
||||
storepass="${jnlp.signjar.storepass}" keypass="${jnlp.signjar.keypass}"/>
|
||||
</target>
|
||||
<target name="-check-keystore-exists">
|
||||
<available property="jnlp.signjar.keystore.exists" file="${jnlp.signjar.keystore}"/>
|
||||
</target>
|
||||
<target name="-jnlp-init-keystore-props">
|
||||
<property name="jnlp.signjar.keystore" value="${basedir}/build/nb-jws.ks"/>
|
||||
<property name="jnlp.signjar.storepass" value="storepass"/>
|
||||
<property name="jnlp.signjar.keypass" value="keypass"/>
|
||||
<property name="jnlp.signjar.alias" value="nb-jws"/>
|
||||
</target>
|
||||
|
||||
<!-- Generating JNLP file -->
|
||||
|
||||
<target name="generate-jnlp" depends="jnlp-init-generate-master,-init-codebase,-init-resources-runtime,-init-security,-init-resources-jars,-init-application-args,-init-icons,-init-offline,-init-descriptions,jnlp-init-notinited">
|
||||
<copy file="${master.jnlp.file}" tofile="${jnlp.dest.dir}/${launch.jnlp.file}__" overwrite="true" encoding="UTF-8">
|
||||
<filterchain>
|
||||
<replacestring from="$${jnlp.codebase}" to="${jnlp.codebase.value}"/>
|
||||
<replacestring from="<!--$${JNLP.ICONS}-->" to="${jnlp.icons.value}"/>
|
||||
<replacestring from="<!--$${JNLP.SECURITY}-->" to="${jnlp.security}"/>
|
||||
<replacestring from="<!--$${JNLP.OFFLINE.ALLOWED}-->" to="${jnlp.offline.allowed.value}"/>
|
||||
<replacestring from="<!--$${JNLP.RESOURCES.RUNTIME}-->" to="${jnlp.resources.runtime.value}"/>
|
||||
<replacestring from="<!--$${JNLP.RESOURCES.MAIN.JAR}-->" to="${jnlp.resources.main.jar.value}"/>
|
||||
<replacestring from="<!--$${JNLP.RESOURCES.JARS}-->" to="${jnlp.resources.jars.value}"/>
|
||||
<replacestring from="<!--$${JNLP.APPLICATION.ARGS}-->" to="${jnlp.application.args.value}"/>
|
||||
<replacestring from="$${APPLICATION.TITLE}" to="${application.title}"/>
|
||||
<replacestring from="$${APPLICATION.VENDOR}" to="${application.vendor}"/>
|
||||
<replacestring from="$${APPLICATION.DESC}" to="${application.desc.value}"/>
|
||||
<replacestring from="$${APPLICATION.DESC.SHORT}" to="${application.desc.short.value}"/>
|
||||
<replacestring from="$${APPLICATION.HOMEPAGE}" to="${application.homepage}"/>
|
||||
<replacestring from="$${jnlp.main.class}" to="${main.class}"/>
|
||||
</filterchain>
|
||||
</copy>
|
||||
<antcall target="-strip-empty-lines"/>
|
||||
<antcall target="-generate-html-page"/>
|
||||
</target>
|
||||
<target name="jnlp-init-notinited">
|
||||
<property name="jnlp.security" value=""/>
|
||||
<property name="jnlp.offline.allowed.value" value=""/>
|
||||
<property name="application.homepage" value=""/>
|
||||
<property name="jnlp.application.args.value" value=""/>
|
||||
</target>
|
||||
<target name="-strip-empty-lines">
|
||||
<move file="${jnlp.dest.dir}/${launch.jnlp.file}__" tofile="${jnlp.dest.dir}/${launch.jnlp.file}" overwrite="true" encoding="UTF-8">
|
||||
<filterchain>
|
||||
<linecontainsregexp>
|
||||
<regexp pattern=".+"/>
|
||||
</linecontainsregexp>
|
||||
</filterchain>
|
||||
</move>
|
||||
</target>
|
||||
|
||||
<!-- Codebase processing -->
|
||||
|
||||
<target name="-init-codebase" depends="-codebase-props-check,-init-non-user-codebase,-init-user-codebase"/>
|
||||
<target name="-codebase-props-check">
|
||||
<condition property="local.codebase">
|
||||
<or>
|
||||
<not>
|
||||
<isset property="jnlp.codebase.type"/>
|
||||
</not>
|
||||
<equals arg1="${jnlp.codebase.type}" arg2="local" trim="true"/>
|
||||
</or>
|
||||
</condition>
|
||||
<condition property="non.user.codebase">
|
||||
<or>
|
||||
<not>
|
||||
<isset property="jnlp.codebase.type"/>
|
||||
</not>
|
||||
<equals arg1="${jnlp.codebase.type}" arg2="local" trim="true"/>
|
||||
<equals arg1="${jnlp.codebase.type}" arg2="web" trim="true"/>
|
||||
</or>
|
||||
</condition>
|
||||
<condition property="user.codebase">
|
||||
<equals arg1="${jnlp.codebase.type}" arg2="user" trim="true"/>
|
||||
</condition>
|
||||
</target>
|
||||
<target name="-init-non-user-codebase" if="non.user.codebase">
|
||||
<property name="jnlp.codebase.value" value="${jnlp.codebase.url}"/>
|
||||
</target>
|
||||
<target name="-init-user-codebase" if="user.codebase">
|
||||
<property name="jnlp.codebase.value" value="${jnlp.codebase.user}"/>
|
||||
</target>
|
||||
|
||||
<!-- j2se resources -->
|
||||
|
||||
<target name="-init-resources-runtime" depends="-init-runtime-props">
|
||||
<property name="run.jvmargs.value" value=""/>
|
||||
<property name="initial-heap-size.value" value=""/>
|
||||
<property name="max-heap-size.value" value=""/>
|
||||
<property name="jnlp.resources.runtime.value"
|
||||
value=' <j2se version="${javac.target}+"${initial-heap-size.value}${max-heap-size.value}${run.jvmargs.value}/>'/>
|
||||
</target>
|
||||
<target name="-init-runtime-props" depends="-runtime-props-check,-init-run-jvmargs-value,-init-initial-heap-size-value,-init-max-heap-size-value"/>
|
||||
<target name="-runtime-props-check">
|
||||
<condition property="run.jvmargs.set">
|
||||
<and>
|
||||
<isset property="run.jvmargs"/>
|
||||
<not>
|
||||
<equals arg1="${run.jvmargs}" arg2="" trim="true"/>
|
||||
</not>
|
||||
</and>
|
||||
</condition>
|
||||
<condition property="jnlp.initial-heap-size.set">
|
||||
<and>
|
||||
<isset property="jnlp.initial-heap-size"/>
|
||||
<not>
|
||||
<equals arg1="${jnlp.initial-heap-size}" arg2="" trim="true"/>
|
||||
</not>
|
||||
</and>
|
||||
</condition>
|
||||
<condition property="jnlp.max-heap-size.set">
|
||||
<and>
|
||||
<isset property="jnlp.max-heap-size"/>
|
||||
<not>
|
||||
<equals arg1="${jnlp.max-heap-size}" arg2="" trim="true"/>
|
||||
</not>
|
||||
</and>
|
||||
</condition>
|
||||
</target>
|
||||
<target name="-init-run-jvmargs-value" if="run.jvmargs.set">
|
||||
<property name="run.jvmargs.value" value=' java-vm-args="${run.jvmargs}"'/>
|
||||
</target>
|
||||
<target name="-init-initial-heap-size-value" if="jnlp.initial-heap-size.set">
|
||||
<property name="initial-heap-size.value" value=' initial-heap-size="${jnlp.initial-heap-size}"'/>
|
||||
</target>
|
||||
<target name="-init-max-heap-size-value" if="jnlp.max-heap-size.set">
|
||||
<property name="max-heap-size.value" value=' max-heap-size="${jnlp.max-heap-size}"'/>
|
||||
</target>
|
||||
|
||||
<!-- JAR resources -->
|
||||
|
||||
<target name="-init-resources-jars" depends="-preinit-resources-unsigned-jars,-preinit-resources-signed-jars,-preinit-resources-main-jar"/>
|
||||
<target name="-preinit-resources-unsigned-jars" depends="-exclude-javaws-from-cp,-check-signing-possible" unless="jnlp.signed.true+signjarstask.available">
|
||||
<pathconvert pathsep="${line.separator}" property="jnlp.resources.jars.value">
|
||||
<path path="${run.classpath.without.javaws.jar}"/>
|
||||
<mapper type="regexp" from="^.*[/\\]([^/\\]+\.jar)"
|
||||
to=' <jar href="lib/\1" download="eager"/>'/>
|
||||
</pathconvert>
|
||||
</target>
|
||||
<target name="-preinit-resources-main-jar">
|
||||
<pathconvert pathsep="${line.separator}" property="jnlp.resources.main.jar.value">
|
||||
<path location="${dist.jar}"/>
|
||||
<mapper type="regexp" from="^.*[/\\]([^/\\]+\.jar)"
|
||||
to=' <jar href="\1" main="true" download="eager"/>'/>
|
||||
</pathconvert>
|
||||
</target>
|
||||
<target name="-exclude-javaws-from-cp">
|
||||
<pathconvert property="path.element.to.be.removed">
|
||||
<path path="${run.classpath}"/>
|
||||
<mapper type="regexp" from="(^.*[/\\]javaws.jar)" to="\1"/>
|
||||
</pathconvert>
|
||||
<pathconvert property="run.classpath.without.javaws.jar">
|
||||
<path path="${run.classpath}"/>
|
||||
<map from="${path.element.to.be.removed}" to=""/>
|
||||
</pathconvert>
|
||||
</target>
|
||||
<target name="-check-task-available">
|
||||
<condition property="signjarstask.available">
|
||||
<isset property="netbeans.home"/>
|
||||
</condition>
|
||||
</target>
|
||||
<target name="-check-signing-possible" depends="-security-props-check,-check-task-available">
|
||||
<condition property="jnlp.signed.true+signjarstask.available">
|
||||
<and>
|
||||
<isset property="jnlp.signed.true"/>
|
||||
<isset property="signjarstask.available"/>
|
||||
</and>
|
||||
</condition>
|
||||
</target>
|
||||
<target name="-unavailable-task-warning" depends="-check-task-available" unless="signjarstask.available">
|
||||
<echo message="Signtask is not available, jar files will not be signed. Task is available only when running inside NetBeans IDE."/>
|
||||
<echo message="You can fix the problem by adding following jar file to Ant classpath: [NetBeans install dir]/java2/ant/nblib/org-netbeans-modules-javawebstart-signtask.jar"/>
|
||||
</target>
|
||||
<target name="-preinit-resources-signed-jars" depends="-unavailable-task-warning,-sign-jars" if="jnlp.signed.true+signjarstask.available">
|
||||
<property name="jnlp.resources.jars.value" value="${jnlp.signed.jars}${jnlp.components}"/>
|
||||
</target>
|
||||
<target name="-sign-jars" depends="-jnlp-init-keystore,-check-signing-possible" if="jnlp.signed.true+signjarstask.available">
|
||||
<jnlpsignjars keystore="${jnlp.signjar.keystore}" storepass="${jnlp.signjar.storepass}"
|
||||
keypass="${jnlp.signjar.keypass}" alias="${jnlp.signjar.alias}" mainjar="${dist.jar}" destdir="dist"
|
||||
codebase="${jnlp.codebase.value}" signedjarsprop="jnlp.signed.jars"
|
||||
componentsprop="jnlp.components">
|
||||
<fileset dir="dist/lib">
|
||||
<include name="*.jar"/>
|
||||
</fileset>
|
||||
</jnlpsignjars>
|
||||
</target>
|
||||
|
||||
<!-- Application arguments -->
|
||||
|
||||
<target name="-init-application-args" if="application.args">
|
||||
<echo message="${application.args}" file="${helper.file}"/>
|
||||
<loadfile srcfile="${helper.file}" property="jnlp.application.args.value">
|
||||
<filterchain>
|
||||
<tokenfilter delimoutput="\n">
|
||||
<stringtokenizer/>
|
||||
<replaceregex pattern="(.+)" replace=" <argument>\1</argument>"/>
|
||||
</tokenfilter>
|
||||
</filterchain>
|
||||
</loadfile>
|
||||
<delete file="${helper.file}"/>
|
||||
</target>
|
||||
|
||||
<!-- Running/Debugging -->
|
||||
|
||||
<target name="jws-run" depends="jar,-verify-jnlp-enabled,-verify-codebase" description="Start javaws execution">
|
||||
<exec executable="${java.home}/bin/javaws">
|
||||
<arg file="${jnlp.dest.dir}/${launch.jnlp.file}"/>
|
||||
</exec>
|
||||
</target>
|
||||
<target name="jws-debug" if="netbeans.home" depends="jar,-verify-jnlp-enabled,-verify-codebase,-debug-start-debugger,-debug-javaws-debuggee"
|
||||
description="Debug javaws project in IDE"/>
|
||||
<target name="-debug-javaws-debuggee">
|
||||
<exec executable="${java.home}/bin/javaws">
|
||||
<env key="JAVAWS_VM_ARGS" value="-Xdebug -Xnoagent -Djava.compiler=none -Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
|
||||
<arg file="${jnlp.dest.dir}/${launch.jnlp.file}"/>
|
||||
</exec>
|
||||
</target>
|
||||
<target name="-verify-codebase" depends="-codebase-props-check" unless="local.codebase">
|
||||
<fail message="Project cannot be run with non-local codebase. Open project properties dialog and set Web Start Codebase to Local Execution."/>
|
||||
</target>
|
||||
<target name="-verify-jnlp-enabled" depends="-test-jnlp-enabled" unless="is.jnlp.enabled">
|
||||
<fail message="Project cannot be run with selected Run Configuration when Java Web Start is disabled."/>
|
||||
</target>
|
||||
|
||||
<!-- Test JNLP enabled-->
|
||||
|
||||
<target name="-test-jnlp-enabled">
|
||||
<condition property="is.jnlp.enabled">
|
||||
<equals arg1="${jnlp.enabled}" arg2="true" casesensitive="false" trim="true"/>
|
||||
</condition>
|
||||
</target>
|
||||
|
||||
<!-- Generate simple HTML test page -->
|
||||
|
||||
<target name="-generate-html-page">
|
||||
<echo file="${jnlp.dest.dir}/launch.html"><![CDATA[<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>Test page for launching the application via JNLP</title>
|
||||
</head>
|
||||
<body>
|
||||
<h3>Test page for launching the application via JNLP</h3>
|
||||
<a href="launch.jnlp">Launch the application</a>
|
||||
<!-- or use following script element to launch via Deployment Toolkit
|
||||
<script src="http://java.com/js/deployJava.js"></script>
|
||||
<script>
|
||||
var url="http://[fill in your URL]/launch.jnlp";
|
||||
deployJava.createWebStartLaunchButton(url, "1.6");
|
||||
</script>
|
||||
-->
|
||||
</body>
|
||||
</html>
|
||||
]]></echo>
|
||||
</target>
|
||||
|
||||
</project>
|
@ -1,8 +0,0 @@
|
||||
compile.on.save=false
|
||||
do.depend=false
|
||||
do.jar=true
|
||||
javac.debug=true
|
||||
javadoc.preview=true
|
||||
jaxws.endorsed.dir=C:\\Program Files\\NetBeans 6.7.1\\java2\\modules\\ext\\jaxws21\\api:C:\\Program Files\\NetBeans 6.7.1\\ide11\\modules\\ext\\jaxb\\api
|
||||
user.properties.file=C:\\Documents and Settings\\jbernard\\.netbeans\\6.7\\build.properties
|
||||
axis2.deploy.war=C:\\Program Files\\glassfish-v2ur2\\domains\\domain1\\autodeploy\\axis2.war
|
@ -1,4 +0,0 @@
|
||||
<?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>
|
@ -1,77 +0,0 @@
|
||||
application.desc=Simple application used to track activities throughout time.
|
||||
application.homepage=
|
||||
application.title=TimeStamper
|
||||
application.vendor=Jonathan Bernard
|
||||
application.version=1.7
|
||||
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
|
||||
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}/TimeStamper.jar
|
||||
dist.javadoc.dir=${dist.dir}/javadoc
|
||||
excludes=
|
||||
file.reference.appframework-1.0.3.jar=lib/appframework-1.0.3.jar
|
||||
file.reference.jcalendar-1.3.2.jar=lib/jcalendar-1.3.2.jar
|
||||
file.reference.swing-worker-1.1.jar=lib/swing-worker-1.1.jar
|
||||
includes=**
|
||||
jar.compress=false
|
||||
javac.classpath=\
|
||||
${file.reference.appframework-1.0.3.jar}:\
|
||||
${file.reference.swing-worker-1.1.jar}:\
|
||||
${file.reference.jcalendar-1.3.2.jar}
|
||||
# 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.codebase.url=file:/C:/Documents%20and%20Settings/jbernard/My%20Documents/Development/TimeStamper/dist/
|
||||
jnlp.enabled=false
|
||||
jnlp.icon=C:\\Documents and Settings\\jbernard\\My Documents\\Development\\TimeStamper\\src\\jdbernard\\timestamper\\resources\\icons\\appointment-new-16x16.png
|
||||
jnlp.offline-allowed=true
|
||||
jnlp.signed=true
|
||||
main.class=jdbernard.timestamper.gui.TimeStamperApp
|
||||
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
|
@ -1,24 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<type>org.netbeans.modules.java.j2seproject</type>
|
||||
<configuration>
|
||||
<buildExtensions xmlns="http://www.netbeans.org/ns/ant-build-extender/1">
|
||||
<extension file="jnlp-impl.xml" id="jws">
|
||||
<dependency dependsOn="jnlp" target="jar"/>
|
||||
</extension>
|
||||
</buildExtensions>
|
||||
<data xmlns="http://www.netbeans.org/ns/j2se-project/3">
|
||||
<name>TimeStamper</name>
|
||||
<minimum-ant-version>1.6.5</minimum-ant-version>
|
||||
<source-roots>
|
||||
<root id="src.dir"/>
|
||||
</source-roots>
|
||||
<test-roots>
|
||||
<root id="test.src.dir"/>
|
||||
</test-roots>
|
||||
</data>
|
||||
<swingapp xmlns="http://www.netbeans.org/ns/form-swingapp/1">
|
||||
<application-class name="jdbernard.timestamper.gui.TimeStamperApp"/>
|
||||
</swingapp>
|
||||
</configuration>
|
||||
</project>
|
@ -1 +0,0 @@
|
||||
jdbernard.timestamper.TimeStamperApp
|
@ -1,26 +0,0 @@
|
||||
package jdbernard.timestamper;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.PrintWriter;
|
||||
import jdbernard.timestamper.core.TimelineProperties;
|
||||
|
||||
public class Test {
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
||||
System.out.println("Enter config file, terminate with EOF");
|
||||
BufferedReader bin = new BufferedReader(new InputStreamReader(System.in));
|
||||
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
PrintWriter pw = new PrintWriter(baos);
|
||||
|
||||
for(String line = bin.readLine(); line != null && !"EOF".equals(line); line = bin.readLine())
|
||||
pw.println(line);
|
||||
|
||||
pw.flush();
|
||||
pw.close();
|
||||
|
||||
}
|
||||
}
|
@ -1,181 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<Form version="1.5" maxVersion="1.6" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
|
||||
<Properties>
|
||||
<Property name="defaultCloseOperation" type="int" value="2"/>
|
||||
<Property name="name" type="java.lang.String" value="Form" noResource="true"/>
|
||||
<Property name="undecorated" type="boolean" value="true"/>
|
||||
</Properties>
|
||||
<SyntheticProperties>
|
||||
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||
</SyntheticProperties>
|
||||
<AuxValues>
|
||||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="2"/>
|
||||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="true"/>
|
||||
<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">
|
||||
<Component id="aboutPanel" alignment="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="aboutPanel" alignment="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Container class="javax.swing.JPanel" name="aboutPanel">
|
||||
<Properties>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo">
|
||||
<LineBorder thickness="2"/>
|
||||
</Border>
|
||||
</Property>
|
||||
<Property name="name" type="java.lang.String" value="aboutPanel" noResource="true"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="mousePressed" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="aboutPanelMousePressed"/>
|
||||
</Events>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_ListenersCodePost" type="java.lang.String" value="aboutPanel.addMouseMotionListener(this);"/>
|
||||
</AuxValues>
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="iconLabel" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="nameLabel" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="10" pref="10" max="10" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="versionLabel" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="versionValueLabel" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="authorLabel" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||
<Component id="websiteLabel" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
||||
<Component id="nameLabel" max="32767" attributes="1"/>
|
||||
<Component id="iconLabel" alignment="0" max="32767" attributes="1"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Component id="authorLabel" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="versionLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="versionValueLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<Component id="websiteLabel" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JLabel" name="iconLabel">
|
||||
<Properties>
|
||||
<Property name="icon" type="javax.swing.Icon" resourceKey="iconLabel.icon"/>
|
||||
<Property name="text" type="java.lang.String" resourceKey="iconLabel.text"/>
|
||||
<Property name="name" type="java.lang.String" value="iconLabel" noResource="true"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="nameLabel">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" noResource="true" editor="org.netbeans.modules.form.editors2.FontEditor">
|
||||
<FontInfo relative="true">
|
||||
<Font bold="true" component="nameLabel" property="font" relativeSize="true" size="5"/>
|
||||
</FontInfo>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="jdbernard/timestamper/resources/TimeStamperApp.properties" key="Application.name" replaceFormat="java.util.ResourceBundle.getBundle("{bundleNameSlashes}").getString("{key}")"/>
|
||||
</Property>
|
||||
<Property name="name" type="java.lang.String" value="nameLabel" noResource="true"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="authorLabel">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" noResource="true" editor="org.netbeans.modules.form.editors2.FontEditor">
|
||||
<FontInfo relative="true">
|
||||
<Font component="authorLabel" property="font" relativeSize="true" size="1"/>
|
||||
</FontInfo>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="jdbernard/timestamper/resources/TimeStamperApp.properties" key="Application.vendor" replaceFormat="java.util.ResourceBundle.getBundle("{bundleNameSlashes}").getString("{key}")"/>
|
||||
</Property>
|
||||
<Property name="name" type="java.lang.String" value="authorLabel" noResource="true"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="versionLabel">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" noResource="true" editor="org.netbeans.modules.form.editors2.FontEditor">
|
||||
<FontInfo relative="true">
|
||||
<Font component="versionLabel" property="font" relativeSize="true" size="1"/>
|
||||
</FontInfo>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" resourceKey="versionLabel.text"/>
|
||||
<Property name="name" type="java.lang.String" value="versionLabel" noResource="true"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="versionValueLabel">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" noResource="true" editor="org.netbeans.modules.form.editors2.FontEditor">
|
||||
<FontInfo relative="true">
|
||||
<Font component="versionValueLabel" property="font" relativeSize="true" size="1"/>
|
||||
</FontInfo>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="jdbernard/timestamper/resources/TimeStamperApp.properties" key="Application.version" replaceFormat="java.util.ResourceBundle.getBundle("{bundleNameSlashes}").getString("{key}")"/>
|
||||
</Property>
|
||||
<Property name="name" type="java.lang.String" value="versionValueLabel" noResource="true"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="websiteLabel">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" noResource="true" editor="org.netbeans.modules.form.editors2.FontEditor">
|
||||
<FontInfo relative="true">
|
||||
<Font component="websiteLabel" property="font" relativeSize="true" size="1"/>
|
||||
</FontInfo>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" resourceKey="websiteLabel.text"/>
|
||||
<Property name="name" type="java.lang.String" value="websiteLabel" noResource="true"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
</Form>
|
@ -1,185 +0,0 @@
|
||||
/*
|
||||
* AboutDialog.java
|
||||
*
|
||||
* Created on October 19, 2008, 3:14 PM
|
||||
*/
|
||||
|
||||
package jdbernard.timestamper.gui;
|
||||
|
||||
import java.awt.Frame;
|
||||
import java.awt.Point;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.Toolkit;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.event.MouseMotionListener;
|
||||
import javax.swing.JDialog;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jbernard
|
||||
*/
|
||||
public class AboutDialog extends JDialog implements MouseMotionListener {
|
||||
|
||||
/** Creates new form AboutDialog */
|
||||
public AboutDialog(Frame parent, boolean modal) {
|
||||
super(parent, modal);
|
||||
initComponents();
|
||||
}
|
||||
|
||||
/** 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() {
|
||||
|
||||
aboutPanel = new javax.swing.JPanel();
|
||||
iconLabel = new javax.swing.JLabel();
|
||||
nameLabel = new javax.swing.JLabel();
|
||||
authorLabel = new javax.swing.JLabel();
|
||||
versionLabel = new javax.swing.JLabel();
|
||||
versionValueLabel = new javax.swing.JLabel();
|
||||
websiteLabel = new javax.swing.JLabel();
|
||||
|
||||
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
||||
setName("Form"); // NOI18N
|
||||
setUndecorated(true);
|
||||
|
||||
aboutPanel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 2));
|
||||
aboutPanel.setName("aboutPanel"); // NOI18N
|
||||
aboutPanel.addMouseListener(new java.awt.event.MouseAdapter() {
|
||||
public void mousePressed(java.awt.event.MouseEvent evt) {
|
||||
aboutPanelMousePressed(evt);
|
||||
}
|
||||
});
|
||||
aboutPanel.addMouseMotionListener(this);
|
||||
|
||||
org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(jdbernard.timestamper.gui.TimeStamperApp.class).getContext().getResourceMap(AboutDialog.class);
|
||||
iconLabel.setIcon(resourceMap.getIcon("iconLabel.icon")); // NOI18N
|
||||
iconLabel.setText(resourceMap.getString("iconLabel.text")); // NOI18N
|
||||
iconLabel.setName("iconLabel"); // NOI18N
|
||||
|
||||
nameLabel.setFont(nameLabel.getFont().deriveFont(nameLabel.getFont().getStyle() | java.awt.Font.BOLD, nameLabel.getFont().getSize()+5));
|
||||
java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("jdbernard/timestamper/resources/TimeStamperApp"); // NOI18N
|
||||
nameLabel.setText(bundle.getString("Application.name")); // NOI18N
|
||||
nameLabel.setName("nameLabel"); // NOI18N
|
||||
|
||||
authorLabel.setFont(authorLabel.getFont().deriveFont(authorLabel.getFont().getSize()+1f));
|
||||
authorLabel.setText(bundle.getString("Application.vendor")); // NOI18N
|
||||
authorLabel.setName("authorLabel"); // NOI18N
|
||||
|
||||
versionLabel.setFont(versionLabel.getFont().deriveFont(versionLabel.getFont().getSize()+1f));
|
||||
versionLabel.setText(resourceMap.getString("versionLabel.text")); // NOI18N
|
||||
versionLabel.setName("versionLabel"); // NOI18N
|
||||
|
||||
versionValueLabel.setFont(versionValueLabel.getFont().deriveFont(versionValueLabel.getFont().getSize()+1f));
|
||||
versionValueLabel.setText(bundle.getString("Application.version")); // NOI18N
|
||||
versionValueLabel.setName("versionValueLabel"); // NOI18N
|
||||
|
||||
websiteLabel.setFont(websiteLabel.getFont().deriveFont(websiteLabel.getFont().getSize()+1f));
|
||||
websiteLabel.setText(resourceMap.getString("websiteLabel.text")); // NOI18N
|
||||
websiteLabel.setName("websiteLabel"); // NOI18N
|
||||
|
||||
javax.swing.GroupLayout aboutPanelLayout = new javax.swing.GroupLayout(aboutPanel);
|
||||
aboutPanel.setLayout(aboutPanelLayout);
|
||||
aboutPanelLayout.setHorizontalGroup(
|
||||
aboutPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(aboutPanelLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(aboutPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(aboutPanelLayout.createSequentialGroup()
|
||||
.addComponent(iconLabel)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(nameLabel))
|
||||
.addGroup(aboutPanelLayout.createSequentialGroup()
|
||||
.addGap(10, 10, 10)
|
||||
.addGroup(aboutPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(aboutPanelLayout.createSequentialGroup()
|
||||
.addComponent(versionLabel)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(versionValueLabel))
|
||||
.addGroup(aboutPanelLayout.createSequentialGroup()
|
||||
.addComponent(authorLabel)
|
||||
.addGap(18, 18, 18)
|
||||
.addComponent(websiteLabel)))))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
aboutPanelLayout.setVerticalGroup(
|
||||
aboutPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(aboutPanelLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(aboutPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
||||
.addComponent(nameLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(iconLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(aboutPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(aboutPanelLayout.createSequentialGroup()
|
||||
.addComponent(authorLabel)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(aboutPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(versionLabel)
|
||||
.addComponent(versionValueLabel)))
|
||||
.addComponent(websiteLabel))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
||||
getContentPane().setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(aboutPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(aboutPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
);
|
||||
|
||||
pack();
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
private void aboutPanelMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_aboutPanelMousePressed
|
||||
mousePressRelativeToWindow = evt.getPoint();//GEN-LAST:event_aboutPanelMousePressed
|
||||
}
|
||||
|
||||
/**
|
||||
* @param args the command line arguments
|
||||
*/
|
||||
public static void main(String args[]) {
|
||||
java.awt.EventQueue.invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
AboutDialog dialog = new AboutDialog(new javax.swing.JFrame(), true);
|
||||
dialog.addWindowListener(new java.awt.event.WindowAdapter() {
|
||||
public void windowClosing(java.awt.event.WindowEvent e) {
|
||||
System.exit(0);
|
||||
}
|
||||
});
|
||||
dialog.setVisible(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JPanel aboutPanel;
|
||||
private javax.swing.JLabel authorLabel;
|
||||
private javax.swing.JLabel iconLabel;
|
||||
private javax.swing.JLabel nameLabel;
|
||||
private javax.swing.JLabel versionLabel;
|
||||
private javax.swing.JLabel versionValueLabel;
|
||||
private javax.swing.JLabel websiteLabel;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
|
||||
private Point mousePressRelativeToWindow;
|
||||
|
||||
public void mouseDragged(MouseEvent e) {
|
||||
setLocation(TimeStamperView.calculateWindowMovement(
|
||||
e.getLocationOnScreen(),
|
||||
mousePressRelativeToWindow, getBounds(),
|
||||
new Rectangle(Toolkit.getDefaultToolkit().getScreenSize())));
|
||||
}
|
||||
|
||||
public void mouseMoved(MouseEvent e) {
|
||||
}
|
||||
|
||||
}
|
@ -1,104 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<Form version="1.5" maxVersion="1.6" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
|
||||
<Properties>
|
||||
<Property name="defaultCloseOperation" type="int" value="2"/>
|
||||
<Property name="name" type="java.lang.String" value="Form" noResource="true"/>
|
||||
<Property name="undecorated" type="boolean" value="true"/>
|
||||
</Properties>
|
||||
<SyntheticProperties>
|
||||
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||
</SyntheticProperties>
|
||||
<AuxValues>
|
||||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="2"/>
|
||||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="true"/>
|
||||
<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">
|
||||
<Component id="mainPanel" alignment="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="mainPanel" alignment="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Container class="javax.swing.JPanel" name="mainPanel">
|
||||
<Properties>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="org.netbeans.modules.form.compat2.border.MatteColorBorderInfo">
|
||||
<MatteColorBorder bottom="2" left="2" right="2" top="2"/>
|
||||
</Border>
|
||||
</Property>
|
||||
<Property name="toolTipText" type="java.lang.String" resourceKey="mainPanel.toolTipText"/>
|
||||
<Property name="name" type="java.lang.String" value="mainPanel" noResource="true"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="mousePressed" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="mainPanelMousePressed"/>
|
||||
</Events>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_ListenersCodePost" type="java.lang.String" value="mainPanel.addMouseMotionListener(this);"/>
|
||||
</AuxValues>
|
||||
|
||||
<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="notesScollPane" pref="258" 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="1" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="notesScollPane" pref="174" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Container class="javax.swing.JScrollPane" name="notesScollPane">
|
||||
<Properties>
|
||||
<Property name="name" type="java.lang.String" value="notesScollPane" noResource="true"/>
|
||||
</Properties>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JTextArea" name="notesTextArea">
|
||||
<Properties>
|
||||
<Property name="columns" type="int" value="20"/>
|
||||
<Property name="font" type="java.awt.Font" noResource="true" editor="org.netbeans.modules.form.editors2.FontEditor">
|
||||
<FontInfo relative="true">
|
||||
<Font bold="false" component="notesTextArea" italic="false" property="font" relativeSize="true" size="-2"/>
|
||||
</FontInfo>
|
||||
</Property>
|
||||
<Property name="lineWrap" type="boolean" value="true"/>
|
||||
<Property name="rows" type="int" value="5"/>
|
||||
<Property name="wrapStyleWord" type="boolean" value="true"/>
|
||||
<Property name="name" type="java.lang.String" value="notesTextArea" noResource="true"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="keyReleased" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="notesTextAreaKeyReleased"/>
|
||||
</Events>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
</Form>
|
@ -1,152 +0,0 @@
|
||||
/*
|
||||
* NotesDialog.java
|
||||
*
|
||||
* Created on September 3, 2008, 4:53 PM
|
||||
*/
|
||||
|
||||
package jdbernard.timestamper.gui;
|
||||
|
||||
import java.awt.Font;
|
||||
import java.awt.Point;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.Toolkit;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.event.MouseMotionListener;
|
||||
import javax.swing.JDialog;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jbernard
|
||||
*/
|
||||
public class NotesDialog extends JDialog implements MouseMotionListener {
|
||||
|
||||
/** Creates new form NotesDialog */
|
||||
public NotesDialog(TimeStamperView parent, boolean modal) {
|
||||
super(parent.getFrame(), modal);
|
||||
initComponents();
|
||||
|
||||
setSize(325, 200);
|
||||
thinNotesFont = notesTextArea.getFont().deriveFont(Font.PLAIN);
|
||||
boldNotesFont = notesTextArea.getFont().deriveFont(Font.BOLD);
|
||||
|
||||
setLocationRelativeTo(parent.getFrame());
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public void setNotes(String notes) {
|
||||
notesTextArea.setText(notes);
|
||||
notesTextArea.setFont(boldNotesFont);
|
||||
}
|
||||
|
||||
public String getNotes() {
|
||||
return notesTextArea.getText();
|
||||
}
|
||||
|
||||
/** 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() {
|
||||
|
||||
mainPanel = new javax.swing.JPanel();
|
||||
notesScollPane = new javax.swing.JScrollPane();
|
||||
notesTextArea = new javax.swing.JTextArea();
|
||||
|
||||
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
||||
setName("Form"); // NOI18N
|
||||
setUndecorated(true);
|
||||
|
||||
mainPanel.setBorder(javax.swing.BorderFactory.createMatteBorder(2, 2, 2, 2, new java.awt.Color(0, 0, 0)));
|
||||
org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(jdbernard.timestamper.gui.TimeStamperApp.class).getContext().getResourceMap(NotesDialog.class);
|
||||
mainPanel.setToolTipText(resourceMap.getString("mainPanel.toolTipText")); // NOI18N
|
||||
mainPanel.setName("mainPanel"); // NOI18N
|
||||
mainPanel.addMouseListener(new java.awt.event.MouseAdapter() {
|
||||
public void mousePressed(java.awt.event.MouseEvent evt) {
|
||||
mainPanelMousePressed(evt);
|
||||
}
|
||||
});
|
||||
mainPanel.addMouseMotionListener(this);
|
||||
|
||||
notesScollPane.setName("notesScollPane"); // NOI18N
|
||||
|
||||
notesTextArea.setColumns(20);
|
||||
notesTextArea.setFont(notesTextArea.getFont().deriveFont((notesTextArea.getFont().getStyle() & ~java.awt.Font.ITALIC) & ~java.awt.Font.BOLD, notesTextArea.getFont().getSize()-2));
|
||||
notesTextArea.setLineWrap(true);
|
||||
notesTextArea.setRows(5);
|
||||
notesTextArea.setWrapStyleWord(true);
|
||||
notesTextArea.setName("notesTextArea"); // NOI18N
|
||||
notesTextArea.addKeyListener(new java.awt.event.KeyAdapter() {
|
||||
public void keyReleased(java.awt.event.KeyEvent evt) {
|
||||
notesTextAreaKeyReleased(evt);
|
||||
}
|
||||
});
|
||||
notesScollPane.setViewportView(notesTextArea);
|
||||
|
||||
javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);
|
||||
mainPanel.setLayout(mainPanelLayout);
|
||||
mainPanelLayout.setHorizontalGroup(
|
||||
mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(mainPanelLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(notesScollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 258, Short.MAX_VALUE)
|
||||
.addContainerGap())
|
||||
);
|
||||
mainPanelLayout.setVerticalGroup(
|
||||
mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(notesScollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 174, Short.MAX_VALUE)
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
||||
getContentPane().setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(mainPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(mainPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
);
|
||||
|
||||
pack();
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
private void notesTextAreaKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_notesTextAreaKeyReleased
|
||||
if ((evt.getKeyCode() == KeyEvent.VK_ENTER) && evt.isControlDown()) {
|
||||
parent.setNotesForActiveTask(notesTextArea.getText());
|
||||
notesTextArea.setFont(boldNotesFont);
|
||||
} else if (evt.getKeyCode() != KeyEvent.VK_CONTROL)
|
||||
notesTextArea.setFont(thinNotesFont);
|
||||
}//GEN-LAST:event_notesTextAreaKeyReleased
|
||||
|
||||
private void mainPanelMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_mainPanelMousePressed
|
||||
mousePressRelativeToWindow = evt.getPoint();
|
||||
}//GEN-LAST:event_mainPanelMousePressed
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JPanel mainPanel;
|
||||
private javax.swing.JScrollPane notesScollPane;
|
||||
private javax.swing.JTextArea notesTextArea;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
|
||||
private TimeStamperView parent;
|
||||
Font thinNotesFont;
|
||||
Font boldNotesFont;
|
||||
Point mousePressRelativeToWindow;
|
||||
|
||||
public void mouseDragged(MouseEvent e) {
|
||||
setLocation(TimeStamperView.calculateWindowMovement(
|
||||
e.getLocationOnScreen(), mousePressRelativeToWindow,
|
||||
getBounds(), parent.getFrame().getBounds(),
|
||||
new Rectangle(Toolkit.getDefaultToolkit().getScreenSize())));
|
||||
}
|
||||
|
||||
public void mouseMoved(MouseEvent e) {
|
||||
}
|
||||
}
|
@ -1,334 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<Form version="1.5" maxVersion="1.6" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
|
||||
<NonVisualComponents>
|
||||
<Container class="jdbernard.timestamper.gui.TimelineDayDisplay" name="dayDisplay">
|
||||
<Properties>
|
||||
<Property name="name" type="java.lang.String" value="dayDisplay" noResource="true"/>
|
||||
</Properties>
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<EmptySpace min="0" pref="100" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<EmptySpace min="0" pref="100" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
</Container>
|
||||
</NonVisualComponents>
|
||||
<Properties>
|
||||
<Property name="defaultCloseOperation" type="int" value="2"/>
|
||||
<Property name="name" type="java.lang.String" value="Form" noResource="true"/>
|
||||
<Property name="undecorated" type="boolean" value="true"/>
|
||||
</Properties>
|
||||
<SyntheticProperties>
|
||||
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||
</SyntheticProperties>
|
||||
<AuxValues>
|
||||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="2"/>
|
||||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="true"/>
|
||||
<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">
|
||||
<Component id="mainPanel" alignment="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="mainPanel" alignment="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Container class="javax.swing.JPanel" name="mainPanel">
|
||||
<Properties>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo">
|
||||
<LineBorder thickness="2"/>
|
||||
</Border>
|
||||
</Property>
|
||||
<Property name="name" type="java.lang.String" value="mainPanel" noResource="true"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="mousePressed" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="mainPanelMousePressed"/>
|
||||
</Events>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_ListenersCodePost" type="java.lang.String" value="mainPanel.addMouseMotionListener(this);"/>
|
||||
</AuxValues>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
|
||||
<SubComponents>
|
||||
<Container class="javax.swing.JPanel" name="detailPanel">
|
||||
<Properties>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo">
|
||||
<LineBorder/>
|
||||
</Border>
|
||||
</Property>
|
||||
<Property name="name" type="java.lang.String" value="detailPanel" noResource="true"/>
|
||||
</Properties>
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="textPane" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="buttonPanel" min="-2" pref="139" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="buttonPanel" alignment="0" max="32767" attributes="0"/>
|
||||
<Component id="textPane" alignment="1" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Container class="javax.swing.JPanel" name="textPane">
|
||||
<Properties>
|
||||
<Property name="name" type="java.lang.String" value="textPane" noResource="true"/>
|
||||
</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="notesScrollPane" alignment="0" pref="238" max="32767" attributes="0"/>
|
||||
<Component id="timestampDateChooser" alignment="0" pref="238" max="32767" attributes="0"/>
|
||||
<Component id="markTextField" alignment="0" pref="238" 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">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="timestampDateChooser" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="markTextField" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="notesScrollPane" pref="36" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JTextField" name="markTextField">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" resourceKey="markTextField.text"/>
|
||||
<Property name="name" type="java.lang.String" value="markTextField" noResource="true"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Container class="javax.swing.JScrollPane" name="notesScrollPane">
|
||||
<Properties>
|
||||
<Property name="name" type="java.lang.String" value="notesScrollPane" noResource="true"/>
|
||||
</Properties>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JTextArea" name="notesTextArea">
|
||||
<Properties>
|
||||
<Property name="columns" type="int" value="20"/>
|
||||
<Property name="lineWrap" type="boolean" value="true"/>
|
||||
<Property name="rows" type="int" value="5"/>
|
||||
<Property name="wrapStyleWord" type="boolean" value="true"/>
|
||||
<Property name="name" type="java.lang.String" value="notesTextArea" noResource="true"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Component class="com.toedter.calendar.JDateChooser" name="timestampDateChooser">
|
||||
<Properties>
|
||||
<Property name="dateFormatString" type="java.lang.String" resourceKey="timestampDateChooser.dateFormatString"/>
|
||||
<Property name="name" type="java.lang.String" value="timestampDateChooser" noResource="true"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Container class="javax.swing.JPanel" name="buttonPanel">
|
||||
<Properties>
|
||||
<Property name="name" type="java.lang.String" value="buttonPanel" noResource="true"/>
|
||||
</Properties>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
|
||||
<SubComponents>
|
||||
<Container class="javax.swing.JPanel" name="datePanel">
|
||||
<Properties>
|
||||
<Property name="name" type="java.lang.String" value="datePanel" noResource="true"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="0" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JLabel" name="dateLabel">
|
||||
<Properties>
|
||||
<Property name="background" type="java.awt.Color" resourceKey="dateLabel.background"/>
|
||||
<Property name="horizontalAlignment" type="int" value="0"/>
|
||||
<Property name="text" type="java.lang.String" resourceKey="dateLabel.text"/>
|
||||
<Property name="name" type="java.lang.String" value="dateLabel" noResource="true"/>
|
||||
<Property name="opaque" type="boolean" value="true"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="0" gridWidth="5" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="prevWeekButton">
|
||||
<Properties>
|
||||
<Property name="action" type="javax.swing.Action" editor="org.netbeans.modules.swingapp.ActionEditor">
|
||||
<action class="jdbernard.timestamper.gui.PunchcardDisplayDialog" id="previousWeek" methodName="previousWeek"/>
|
||||
</Property>
|
||||
<Property name="hideActionText" type="boolean" value="true"/>
|
||||
<Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
|
||||
<Insets value="[0, 2, 0, 2]"/>
|
||||
</Property>
|
||||
<Property name="name" type="java.lang.String" value="prevWeekButton" noResource="true"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="1" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="prevDayButton">
|
||||
<Properties>
|
||||
<Property name="action" type="javax.swing.Action" editor="org.netbeans.modules.swingapp.ActionEditor">
|
||||
<action class="jdbernard.timestamper.gui.PunchcardDisplayDialog" id="previousDay" methodName="previousDay"/>
|
||||
</Property>
|
||||
<Property name="hideActionText" type="boolean" value="true"/>
|
||||
<Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
|
||||
<Insets value="[0, 2, 0, 2]"/>
|
||||
</Property>
|
||||
<Property name="name" type="java.lang.String" value="prevDayButton" noResource="true"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="1" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="currentDayButton">
|
||||
<Properties>
|
||||
<Property name="action" type="javax.swing.Action" editor="org.netbeans.modules.swingapp.ActionEditor">
|
||||
<action class="jdbernard.timestamper.gui.PunchcardDisplayDialog" id="currentDay" methodName="currentDay"/>
|
||||
</Property>
|
||||
<Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
|
||||
<Insets value="[0, 2, 0, 2]"/>
|
||||
</Property>
|
||||
<Property name="name" type="java.lang.String" value="currentDayButton" noResource="true"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="2" gridY="1" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="nextDayButton">
|
||||
<Properties>
|
||||
<Property name="action" type="javax.swing.Action" editor="org.netbeans.modules.swingapp.ActionEditor">
|
||||
<action class="jdbernard.timestamper.gui.PunchcardDisplayDialog" id="nextDay" methodName="nextDay"/>
|
||||
</Property>
|
||||
<Property name="hideActionText" type="boolean" value="true"/>
|
||||
<Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
|
||||
<Insets value="[0, 2, 0, 2]"/>
|
||||
</Property>
|
||||
<Property name="name" type="java.lang.String" value="nextDayButton" noResource="true"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="3" gridY="1" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="nextWeekButton">
|
||||
<Properties>
|
||||
<Property name="action" type="javax.swing.Action" editor="org.netbeans.modules.swingapp.ActionEditor">
|
||||
<action class="jdbernard.timestamper.gui.PunchcardDisplayDialog" id="nextWeek" methodName="nextWeek"/>
|
||||
</Property>
|
||||
<Property name="hideActionText" type="boolean" value="true"/>
|
||||
<Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
|
||||
<Insets value="[0, 2, 0, 2]"/>
|
||||
</Property>
|
||||
<Property name="name" type="java.lang.String" value="nextWeekButton" noResource="true"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="4" gridY="1" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Component class="javax.swing.JButton" name="newMarkerButton">
|
||||
<Properties>
|
||||
<Property name="action" type="javax.swing.Action" editor="org.netbeans.modules.swingapp.ActionEditor">
|
||||
<action class="jdbernard.timestamper.gui.PunchcardDisplayDialog" id="newMarker" methodName="newMarker"/>
|
||||
</Property>
|
||||
<Property name="name" type="java.lang.String" value="newMarkerButton" noResource="true"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="1" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="deleteMarkerButton">
|
||||
<Properties>
|
||||
<Property name="action" type="javax.swing.Action" editor="org.netbeans.modules.swingapp.ActionEditor">
|
||||
<action class="jdbernard.timestamper.gui.PunchcardDisplayDialog" id="deleteMarker" methodName="deleteMarker"/>
|
||||
</Property>
|
||||
<Property name="name" type="java.lang.String" value="deleteMarkerButton" noResource="true"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="2" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="saveMarkerChanges">
|
||||
<Properties>
|
||||
<Property name="action" type="javax.swing.Action" editor="org.netbeans.modules.swingapp.ActionEditor">
|
||||
<action class="jdbernard.timestamper.gui.PunchcardDisplayDialog" id="saveMarkerChanges" methodName="saveMarkerChanges"/>
|
||||
</Property>
|
||||
<Property name="name" type="java.lang.String" value="saveMarkerChanges" noResource="true"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="3" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
</Form>
|
@ -1,455 +0,0 @@
|
||||
/*
|
||||
* PunchcardDisplayDialog.java
|
||||
*
|
||||
* Created on October 16, 2008, 4:37 PM
|
||||
*/
|
||||
|
||||
package jdbernard.timestamper.gui;
|
||||
|
||||
import jdbernard.timestamper.core.TimelineMarker;
|
||||
import java.awt.Point;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.Toolkit;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.event.MouseMotionListener;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import javax.swing.JDialog;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.event.ChangeEvent;
|
||||
import javax.swing.event.ChangeListener;
|
||||
import org.jdesktop.application.Action;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jbernard
|
||||
*/
|
||||
public class PunchcardDisplayDialog extends JDialog
|
||||
implements MouseMotionListener, ChangeListener {
|
||||
|
||||
/* Layout of class code:
|
||||
* Constructors
|
||||
* Generated GUI init code
|
||||
* Generated class variables
|
||||
* Additional class variables
|
||||
* Action methods
|
||||
* Listener methods
|
||||
* Additional methods
|
||||
*/
|
||||
|
||||
/** Creates new form PunchcardDisplayDialog */
|
||||
public PunchcardDisplayDialog(JFrame parent, boolean modal,
|
||||
Calendar day) {
|
||||
super(parent, modal);
|
||||
this.day = day;
|
||||
initComponents();
|
||||
|
||||
dayDisplay.setDay(day.getTime());
|
||||
dateLabel.setText(dateFormatter.format(day.getTime()));
|
||||
|
||||
dayDisplay.addChangeListener(this);
|
||||
addChangeListener(dayDisplay);
|
||||
|
||||
markTextField.setFont(dayDisplay.getMarkFont());
|
||||
notesTextArea.setFont(dayDisplay.getNotesFont());
|
||||
}
|
||||
|
||||
/** 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() {
|
||||
java.awt.GridBagConstraints gridBagConstraints;
|
||||
|
||||
dayDisplay = new jdbernard.timestamper.gui.TimelineDayDisplay();
|
||||
mainPanel = new javax.swing.JPanel();
|
||||
detailPanel = new javax.swing.JPanel();
|
||||
textPane = new javax.swing.JPanel();
|
||||
markTextField = new javax.swing.JTextField();
|
||||
notesScrollPane = new javax.swing.JScrollPane();
|
||||
notesTextArea = new javax.swing.JTextArea();
|
||||
timestampDateChooser = new com.toedter.calendar.JDateChooser();
|
||||
buttonPanel = new javax.swing.JPanel();
|
||||
datePanel = new javax.swing.JPanel();
|
||||
dateLabel = new javax.swing.JLabel();
|
||||
prevWeekButton = new javax.swing.JButton();
|
||||
prevDayButton = new javax.swing.JButton();
|
||||
currentDayButton = new javax.swing.JButton();
|
||||
nextDayButton = new javax.swing.JButton();
|
||||
nextWeekButton = new javax.swing.JButton();
|
||||
newMarkerButton = new javax.swing.JButton();
|
||||
deleteMarkerButton = new javax.swing.JButton();
|
||||
saveMarkerChanges = new javax.swing.JButton();
|
||||
|
||||
dayDisplay.setName("dayDisplay"); // NOI18N
|
||||
|
||||
javax.swing.GroupLayout dayDisplayLayout = new javax.swing.GroupLayout(dayDisplay);
|
||||
dayDisplay.setLayout(dayDisplayLayout);
|
||||
dayDisplayLayout.setHorizontalGroup(
|
||||
dayDisplayLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 100, Short.MAX_VALUE)
|
||||
);
|
||||
dayDisplayLayout.setVerticalGroup(
|
||||
dayDisplayLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 100, Short.MAX_VALUE)
|
||||
);
|
||||
|
||||
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
||||
setName("Form"); // NOI18N
|
||||
setUndecorated(true);
|
||||
|
||||
mainPanel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 2));
|
||||
mainPanel.setName("mainPanel"); // NOI18N
|
||||
mainPanel.addMouseListener(new java.awt.event.MouseAdapter() {
|
||||
public void mousePressed(java.awt.event.MouseEvent evt) {
|
||||
mainPanelMousePressed(evt);
|
||||
}
|
||||
});
|
||||
mainPanel.addMouseMotionListener(this);
|
||||
|
||||
detailPanel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
|
||||
detailPanel.setName("detailPanel"); // NOI18N
|
||||
|
||||
textPane.setName("textPane"); // NOI18N
|
||||
|
||||
org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(jdbernard.timestamper.gui.TimeStamperApp.class).getContext().getResourceMap(PunchcardDisplayDialog.class);
|
||||
markTextField.setText(resourceMap.getString("markTextField.text")); // NOI18N
|
||||
markTextField.setName("markTextField"); // NOI18N
|
||||
|
||||
notesScrollPane.setName("notesScrollPane"); // NOI18N
|
||||
|
||||
notesTextArea.setColumns(20);
|
||||
notesTextArea.setLineWrap(true);
|
||||
notesTextArea.setRows(5);
|
||||
notesTextArea.setWrapStyleWord(true);
|
||||
notesTextArea.setName("notesTextArea"); // NOI18N
|
||||
notesScrollPane.setViewportView(notesTextArea);
|
||||
|
||||
timestampDateChooser.setDateFormatString(resourceMap.getString("timestampDateChooser.dateFormatString")); // NOI18N
|
||||
timestampDateChooser.setName("timestampDateChooser"); // NOI18N
|
||||
|
||||
javax.swing.GroupLayout textPaneLayout = new javax.swing.GroupLayout(textPane);
|
||||
textPane.setLayout(textPaneLayout);
|
||||
textPaneLayout.setHorizontalGroup(
|
||||
textPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, textPaneLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(textPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(notesScrollPane, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 238, Short.MAX_VALUE)
|
||||
.addComponent(timestampDateChooser, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 238, Short.MAX_VALUE)
|
||||
.addComponent(markTextField, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 238, Short.MAX_VALUE))
|
||||
.addContainerGap())
|
||||
);
|
||||
textPaneLayout.setVerticalGroup(
|
||||
textPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(textPaneLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(timestampDateChooser, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(markTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(notesScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 36, Short.MAX_VALUE)
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
buttonPanel.setName("buttonPanel"); // NOI18N
|
||||
buttonPanel.setLayout(new java.awt.GridBagLayout());
|
||||
|
||||
datePanel.setName("datePanel"); // NOI18N
|
||||
datePanel.setLayout(new java.awt.GridBagLayout());
|
||||
|
||||
dateLabel.setBackground(resourceMap.getColor("dateLabel.background")); // NOI18N
|
||||
dateLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
||||
dateLabel.setText(resourceMap.getString("dateLabel.text")); // NOI18N
|
||||
dateLabel.setName("dateLabel"); // NOI18N
|
||||
dateLabel.setOpaque(true);
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 0;
|
||||
gridBagConstraints.gridwidth = 5;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
|
||||
gridBagConstraints.weightx = 1.0;
|
||||
datePanel.add(dateLabel, gridBagConstraints);
|
||||
|
||||
javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(jdbernard.timestamper.gui.TimeStamperApp.class).getContext().getActionMap(PunchcardDisplayDialog.class, this);
|
||||
prevWeekButton.setAction(actionMap.get("previousWeek")); // NOI18N
|
||||
prevWeekButton.setHideActionText(true);
|
||||
prevWeekButton.setMargin(new java.awt.Insets(0, 2, 0, 2));
|
||||
prevWeekButton.setName("prevWeekButton"); // NOI18N
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 1;
|
||||
datePanel.add(prevWeekButton, gridBagConstraints);
|
||||
|
||||
prevDayButton.setAction(actionMap.get("previousDay")); // NOI18N
|
||||
prevDayButton.setHideActionText(true);
|
||||
prevDayButton.setMargin(new java.awt.Insets(0, 2, 0, 2));
|
||||
prevDayButton.setName("prevDayButton"); // NOI18N
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 1;
|
||||
datePanel.add(prevDayButton, gridBagConstraints);
|
||||
|
||||
currentDayButton.setAction(actionMap.get("currentDay")); // NOI18N
|
||||
currentDayButton.setMargin(new java.awt.Insets(0, 2, 0, 2));
|
||||
currentDayButton.setName("currentDayButton"); // NOI18N
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 2;
|
||||
gridBagConstraints.gridy = 1;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.weightx = 1.0;
|
||||
datePanel.add(currentDayButton, gridBagConstraints);
|
||||
|
||||
nextDayButton.setAction(actionMap.get("nextDay")); // NOI18N
|
||||
nextDayButton.setHideActionText(true);
|
||||
nextDayButton.setMargin(new java.awt.Insets(0, 2, 0, 2));
|
||||
nextDayButton.setName("nextDayButton"); // NOI18N
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 3;
|
||||
gridBagConstraints.gridy = 1;
|
||||
datePanel.add(nextDayButton, gridBagConstraints);
|
||||
|
||||
nextWeekButton.setAction(actionMap.get("nextWeek")); // NOI18N
|
||||
nextWeekButton.setHideActionText(true);
|
||||
nextWeekButton.setMargin(new java.awt.Insets(0, 2, 0, 2));
|
||||
nextWeekButton.setName("nextWeekButton"); // NOI18N
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 4;
|
||||
gridBagConstraints.gridy = 1;
|
||||
datePanel.add(nextWeekButton, gridBagConstraints);
|
||||
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 0;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.weightx = 1.0;
|
||||
buttonPanel.add(datePanel, gridBagConstraints);
|
||||
|
||||
newMarkerButton.setAction(actionMap.get("newMarker")); // NOI18N
|
||||
newMarkerButton.setName("newMarkerButton"); // NOI18N
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 1;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.weightx = 1.0;
|
||||
buttonPanel.add(newMarkerButton, gridBagConstraints);
|
||||
|
||||
deleteMarkerButton.setAction(actionMap.get("deleteMarker")); // NOI18N
|
||||
deleteMarkerButton.setName("deleteMarkerButton"); // NOI18N
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 2;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.weightx = 1.0;
|
||||
buttonPanel.add(deleteMarkerButton, gridBagConstraints);
|
||||
|
||||
saveMarkerChanges.setAction(actionMap.get("saveMarkerChanges")); // NOI18N
|
||||
saveMarkerChanges.setName("saveMarkerChanges"); // NOI18N
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 3;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
buttonPanel.add(saveMarkerChanges, gridBagConstraints);
|
||||
|
||||
javax.swing.GroupLayout detailPanelLayout = new javax.swing.GroupLayout(detailPanel);
|
||||
detailPanel.setLayout(detailPanelLayout);
|
||||
detailPanelLayout.setHorizontalGroup(
|
||||
detailPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, detailPanelLayout.createSequentialGroup()
|
||||
.addComponent(textPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(buttonPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
);
|
||||
detailPanelLayout.setVerticalGroup(
|
||||
detailPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(buttonPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(textPane, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
);
|
||||
|
||||
mainPanel.add(detailPanel);
|
||||
|
||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
||||
getContentPane().setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(mainPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(mainPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
);
|
||||
|
||||
pack();
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
private void mainPanelMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_mainPanelMousePressed
|
||||
mousePressRelativeToWindow = evt.getPoint();
|
||||
}//GEN-LAST:event_mainPanelMousePressed
|
||||
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JPanel buttonPanel;
|
||||
private javax.swing.JButton currentDayButton;
|
||||
private javax.swing.JLabel dateLabel;
|
||||
private javax.swing.JPanel datePanel;
|
||||
private jdbernard.timestamper.gui.TimelineDayDisplay dayDisplay;
|
||||
private javax.swing.JButton deleteMarkerButton;
|
||||
private javax.swing.JPanel detailPanel;
|
||||
private javax.swing.JPanel mainPanel;
|
||||
private javax.swing.JTextField markTextField;
|
||||
private javax.swing.JButton newMarkerButton;
|
||||
private javax.swing.JButton nextDayButton;
|
||||
private javax.swing.JButton nextWeekButton;
|
||||
private javax.swing.JScrollPane notesScrollPane;
|
||||
private javax.swing.JTextArea notesTextArea;
|
||||
private javax.swing.JButton prevDayButton;
|
||||
private javax.swing.JButton prevWeekButton;
|
||||
private javax.swing.JButton saveMarkerChanges;
|
||||
private javax.swing.JPanel textPane;
|
||||
private com.toedter.calendar.JDateChooser timestampDateChooser;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
|
||||
private Calendar day;
|
||||
private SimpleDateFormat dateFormatter = new SimpleDateFormat("EEE MMM dd");
|
||||
private Point mousePressRelativeToWindow;
|
||||
private ArrayList<ChangeListener> changeListeners =
|
||||
new ArrayList<ChangeListener>();
|
||||
|
||||
@Action
|
||||
public void previousWeek() {
|
||||
day.add(Calendar.WEEK_OF_YEAR, -1);
|
||||
dayDisplay.setDay(day.getTime());
|
||||
dateLabel.setText(dateFormatter.format(day.getTime()));
|
||||
repaint();
|
||||
}
|
||||
|
||||
@Action
|
||||
public void previousDay() {
|
||||
day.add(Calendar.DAY_OF_YEAR, -1);
|
||||
dayDisplay.setDay(day.getTime());
|
||||
dateLabel.setText(dateFormatter.format(day.getTime()));
|
||||
repaint();
|
||||
}
|
||||
|
||||
@Action
|
||||
public void currentDay() {
|
||||
day = Calendar.getInstance();
|
||||
dayDisplay.setDay(day.getTime());
|
||||
dateLabel.setText(dateFormatter.format(day.getTime()));
|
||||
repaint();
|
||||
}
|
||||
|
||||
@Action
|
||||
public void nextDay() {
|
||||
day.add(Calendar.DAY_OF_YEAR, 1);
|
||||
dayDisplay.setDay(day.getTime());
|
||||
dateLabel.setText(dateFormatter.format(day.getTime()));
|
||||
repaint();
|
||||
}
|
||||
|
||||
@Action
|
||||
public void nextWeek() {
|
||||
day.add(Calendar.WEEK_OF_YEAR, 1);
|
||||
dayDisplay.setDay(day.getTime());
|
||||
dateLabel.setText(dateFormatter.format(day.getTime()));
|
||||
repaint();
|
||||
}
|
||||
|
||||
@Action
|
||||
public void newMarker() {
|
||||
dayDisplay.addMarker(timestampDateChooser.getDate(),
|
||||
markTextField.getText(), notesTextArea.getText());
|
||||
fireChangeEvent();
|
||||
repaint();
|
||||
}
|
||||
|
||||
@Action
|
||||
public void deleteMarker() {
|
||||
dayDisplay.deleteSelectedMarker();
|
||||
fireChangeEvent();
|
||||
repaint();
|
||||
}
|
||||
|
||||
@Action
|
||||
public void saveMarkerChanges() {
|
||||
deleteMarker();
|
||||
newMarker();
|
||||
}
|
||||
|
||||
public void mouseDragged(MouseEvent e) {
|
||||
setLocation(TimeStamperView.calculateWindowMovement(
|
||||
e.getLocationOnScreen(), mousePressRelativeToWindow,
|
||||
getBounds(),
|
||||
new Rectangle(Toolkit.getDefaultToolkit().getScreenSize())));
|
||||
}
|
||||
|
||||
public void mouseMoved(MouseEvent e) {
|
||||
}
|
||||
|
||||
private void fireChangeEvent() {
|
||||
ChangeEvent ce = new ChangeEvent(this);
|
||||
|
||||
for (ChangeListener cl : changeListeners)
|
||||
cl.stateChanged(ce);
|
||||
}
|
||||
|
||||
public void stateChanged(ChangeEvent e) {
|
||||
if (e.getSource() == dayDisplay) {
|
||||
TimelineMarker marker = dayDisplay.getSelectedTimelineMarker();
|
||||
|
||||
if (marker == null) {
|
||||
timestampDateChooser.setDate(null);
|
||||
markTextField.setText("");
|
||||
notesTextArea.setText("");
|
||||
} else {
|
||||
timestampDateChooser.setDate(marker.getTimestamp());
|
||||
markTextField.setText(marker.getMark());
|
||||
notesTextArea.setText(marker.getNotes());
|
||||
}
|
||||
} else {
|
||||
for (ChangeListener cl : changeListeners)
|
||||
if (cl != e.getSource()) cl.stateChanged(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void addChangeListener(ChangeListener cl) {
|
||||
changeListeners.add(cl);
|
||||
}
|
||||
|
||||
public boolean removeChangeListener(ChangeListener cl) {
|
||||
return changeListeners.remove(cl);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param args the command line arguments
|
||||
*
|
||||
public static void main(String args[]) throws Exception {
|
||||
java.awt.EventQueue.invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
Timeline timeline = null;
|
||||
Calendar day = Calendar.getInstance();
|
||||
try { timeline = Timeline.readFromFile("test-timeline.txt"); }
|
||||
catch (Exception e) {
|
||||
System.err.println("Could not open timeline text:");
|
||||
e.printStackTrace(System.err);
|
||||
timeline = new Timeline();
|
||||
try { new File("PLACE_HERE").createNewFile(); }
|
||||
catch (Exception e1) {}
|
||||
}
|
||||
PunchcardDisplayDialog dialog = new PunchcardDisplayDialog(new javax.swing.JFrame(), true, timeline, day);
|
||||
dialog.addWindowListener(new java.awt.event.WindowAdapter() {
|
||||
public void windowClosing(java.awt.event.WindowEvent e) {
|
||||
System.exit(0);
|
||||
}
|
||||
});
|
||||
dialog.setVisible(true);
|
||||
}
|
||||
});
|
||||
}*/
|
||||
|
||||
}
|
@ -1,192 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<Form version="1.5" maxVersion="1.6" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
|
||||
<Properties>
|
||||
<Property name="defaultCloseOperation" type="int" value="2"/>
|
||||
<Property name="title" type="java.lang.String" resourceKey="title"/>
|
||||
<Property name="modal" type="boolean" value="true"/>
|
||||
<Property name="name" type="java.lang.String" value="aboutBox" noResource="true"/>
|
||||
<Property name="resizable" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
<SyntheticProperties>
|
||||
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||
</SyntheticProperties>
|
||||
<AuxValues>
|
||||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="2"/>
|
||||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="true"/>
|
||||
<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="0" attributes="0">
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="versionLabel" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="vendorLabel" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="homepageLabel" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="appVersionLabel" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="appVendorLabel" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="appHomepageLabel" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<Component id="appTitleLabel" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="appDescLabel" alignment="0" pref="270" max="32767" attributes="0"/>
|
||||
<Component id="closeButton" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="appTitleLabel" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Component id="appDescLabel" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="versionLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="appVersionLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="vendorLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="appVendorLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="homepageLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="appHomepageLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" max="32767" attributes="0"/>
|
||||
<Component id="closeButton" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JButton" name="closeButton">
|
||||
<Properties>
|
||||
<Property name="action" type="javax.swing.Action" editor="org.netbeans.modules.swingapp.ActionEditor">
|
||||
<action class="jdbernard.timestamper.TimeStamperAboutBox" id="closeAboutBox" methodName="closeAboutBox"/>
|
||||
</Property>
|
||||
<Property name="name" type="java.lang.String" value="closeButton" noResource="true"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="appTitleLabel">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" noResource="true" editor="org.netbeans.modules.form.editors2.FontEditor">
|
||||
<FontInfo relative="true">
|
||||
<Font bold="true" component="appTitleLabel" property="font" relativeSize="true" size="4"/>
|
||||
</FontInfo>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" resourceKey="Application.title"/>
|
||||
<Property name="name" type="java.lang.String" value="appTitleLabel" noResource="true"/>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
|
||||
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
|
||||
</AuxValues>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="versionLabel">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" noResource="true" editor="org.netbeans.modules.form.editors2.FontEditor">
|
||||
<FontInfo relative="true">
|
||||
<Font bold="true" component="versionLabel" property="font" relativeSize="true" size="0"/>
|
||||
</FontInfo>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" resourceKey="versionLabel.text"/>
|
||||
<Property name="name" type="java.lang.String" value="versionLabel" noResource="true"/>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
|
||||
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
|
||||
</AuxValues>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="appVersionLabel">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" resourceKey="Application.version"/>
|
||||
<Property name="name" type="java.lang.String" value="appVersionLabel" noResource="true"/>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
|
||||
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
|
||||
</AuxValues>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="vendorLabel">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" noResource="true" editor="org.netbeans.modules.form.editors2.FontEditor">
|
||||
<FontInfo relative="true">
|
||||
<Font bold="true" component="vendorLabel" property="font" relativeSize="true" size="0"/>
|
||||
</FontInfo>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" resourceKey="vendorLabel.text"/>
|
||||
<Property name="name" type="java.lang.String" value="vendorLabel" noResource="true"/>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
|
||||
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
|
||||
</AuxValues>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="appVendorLabel">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" resourceKey="Application.vendor"/>
|
||||
<Property name="name" type="java.lang.String" value="appVendorLabel" noResource="true"/>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
|
||||
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
|
||||
</AuxValues>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="homepageLabel">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" noResource="true" editor="org.netbeans.modules.form.editors2.FontEditor">
|
||||
<FontInfo relative="true">
|
||||
<Font bold="true" component="homepageLabel" property="font" relativeSize="true" size="0"/>
|
||||
</FontInfo>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" resourceKey="homepageLabel.text"/>
|
||||
<Property name="name" type="java.lang.String" value="homepageLabel" noResource="true"/>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
|
||||
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
|
||||
</AuxValues>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="appHomepageLabel">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" resourceKey="Application.homepage"/>
|
||||
<Property name="name" type="java.lang.String" value="appHomepageLabel" noResource="true"/>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
|
||||
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
|
||||
</AuxValues>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="appDescLabel">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" resourceKey="appDescLabel.text"/>
|
||||
<Property name="name" type="java.lang.String" value="appDescLabel" noResource="true"/>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
|
||||
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
|
||||
</AuxValues>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Form>
|
@ -1,131 +0,0 @@
|
||||
/*
|
||||
* TimeStamperAboutBox.java
|
||||
*/
|
||||
|
||||
package jdbernard.timestamper.gui;
|
||||
|
||||
import org.jdesktop.application.Action;
|
||||
|
||||
public class TimeStamperAboutBox extends javax.swing.JDialog {
|
||||
|
||||
public TimeStamperAboutBox(java.awt.Frame parent) {
|
||||
super(parent);
|
||||
initComponents();
|
||||
getRootPane().setDefaultButton(closeButton);
|
||||
}
|
||||
|
||||
@Action public void closeAboutBox() {
|
||||
setVisible(false);
|
||||
}
|
||||
|
||||
/** 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.
|
||||
*/
|
||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||
private void initComponents() {
|
||||
|
||||
closeButton = new javax.swing.JButton();
|
||||
javax.swing.JLabel appTitleLabel = new javax.swing.JLabel();
|
||||
javax.swing.JLabel versionLabel = new javax.swing.JLabel();
|
||||
javax.swing.JLabel appVersionLabel = new javax.swing.JLabel();
|
||||
javax.swing.JLabel vendorLabel = new javax.swing.JLabel();
|
||||
javax.swing.JLabel appVendorLabel = new javax.swing.JLabel();
|
||||
javax.swing.JLabel homepageLabel = new javax.swing.JLabel();
|
||||
javax.swing.JLabel appHomepageLabel = new javax.swing.JLabel();
|
||||
javax.swing.JLabel appDescLabel = new javax.swing.JLabel();
|
||||
|
||||
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
||||
org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(jdbernard.timestamper.gui.TimeStamperApp.class).getContext().getResourceMap(TimeStamperAboutBox.class);
|
||||
setTitle(resourceMap.getString("title")); // NOI18N
|
||||
setModal(true);
|
||||
setName("aboutBox"); // NOI18N
|
||||
setResizable(false);
|
||||
|
||||
javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(jdbernard.timestamper.gui.TimeStamperApp.class).getContext().getActionMap(TimeStamperAboutBox.class, this);
|
||||
closeButton.setAction(actionMap.get("closeAboutBox")); // NOI18N
|
||||
closeButton.setName("closeButton"); // NOI18N
|
||||
|
||||
appTitleLabel.setFont(appTitleLabel.getFont().deriveFont(appTitleLabel.getFont().getStyle() | java.awt.Font.BOLD, appTitleLabel.getFont().getSize()+4));
|
||||
appTitleLabel.setText(resourceMap.getString("Application.title")); // NOI18N
|
||||
appTitleLabel.setName("appTitleLabel"); // NOI18N
|
||||
|
||||
versionLabel.setFont(versionLabel.getFont().deriveFont(versionLabel.getFont().getStyle() | java.awt.Font.BOLD));
|
||||
versionLabel.setText(resourceMap.getString("versionLabel.text")); // NOI18N
|
||||
versionLabel.setName("versionLabel"); // NOI18N
|
||||
|
||||
appVersionLabel.setText(resourceMap.getString("Application.version")); // NOI18N
|
||||
appVersionLabel.setName("appVersionLabel"); // NOI18N
|
||||
|
||||
vendorLabel.setFont(vendorLabel.getFont().deriveFont(vendorLabel.getFont().getStyle() | java.awt.Font.BOLD));
|
||||
vendorLabel.setText(resourceMap.getString("vendorLabel.text")); // NOI18N
|
||||
vendorLabel.setName("vendorLabel"); // NOI18N
|
||||
|
||||
appVendorLabel.setText(resourceMap.getString("Application.vendor")); // NOI18N
|
||||
appVendorLabel.setName("appVendorLabel"); // NOI18N
|
||||
|
||||
homepageLabel.setFont(homepageLabel.getFont().deriveFont(homepageLabel.getFont().getStyle() | java.awt.Font.BOLD));
|
||||
homepageLabel.setText(resourceMap.getString("homepageLabel.text")); // NOI18N
|
||||
homepageLabel.setName("homepageLabel"); // NOI18N
|
||||
|
||||
appHomepageLabel.setText(resourceMap.getString("Application.homepage")); // NOI18N
|
||||
appHomepageLabel.setName("appHomepageLabel"); // NOI18N
|
||||
|
||||
appDescLabel.setText(resourceMap.getString("appDescLabel.text")); // NOI18N
|
||||
appDescLabel.setName("appDescLabel"); // NOI18N
|
||||
|
||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
||||
getContentPane().setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(versionLabel)
|
||||
.addComponent(vendorLabel)
|
||||
.addComponent(homepageLabel))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(appVersionLabel)
|
||||
.addComponent(appVendorLabel)
|
||||
.addComponent(appHomepageLabel)))
|
||||
.addComponent(appTitleLabel, javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(appDescLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 270, Short.MAX_VALUE)
|
||||
.addComponent(closeButton))
|
||||
.addContainerGap())
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(appTitleLabel)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(appDescLabel)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(versionLabel)
|
||||
.addComponent(appVersionLabel))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(vendorLabel)
|
||||
.addComponent(appVendorLabel))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(homepageLabel)
|
||||
.addComponent(appHomepageLabel))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(closeButton)
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
pack();
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JButton closeButton;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
|
||||
}
|
@ -1,168 +0,0 @@
|
||||
/*
|
||||
* TimeStamperApp.java
|
||||
*/
|
||||
|
||||
package jdbernard.timestamper.gui;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.EventObject;
|
||||
import java.util.Properties;
|
||||
import java.util.logging.ConsoleHandler;
|
||||
import java.util.logging.FileHandler;
|
||||
import java.util.logging.Handler;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.logging.SimpleFormatter;
|
||||
import jdbernard.timestamper.core.TimelineProperties;
|
||||
import org.jdesktop.application.Application;
|
||||
import org.jdesktop.application.SingleFrameApplication;
|
||||
|
||||
/**
|
||||
* The main class of the application.
|
||||
*/
|
||||
public class TimeStamperApp extends SingleFrameApplication
|
||||
implements Application.ExitListener {
|
||||
|
||||
private TimelineProperties timelineProperties;
|
||||
private Logger log;
|
||||
private Properties config;
|
||||
|
||||
public TimeStamperApp() {
|
||||
super();
|
||||
|
||||
timelineProperties = new TimelineProperties();
|
||||
|
||||
// set up logger
|
||||
log = Logger.getLogger("jdbernard.timestamper");
|
||||
log.setLevel(Level.ALL);
|
||||
|
||||
// add console handler
|
||||
ConsoleHandler ch = new ConsoleHandler();
|
||||
ch.setLevel(Level.INFO);
|
||||
|
||||
log.addHandler(ch);
|
||||
|
||||
// try to add file handler
|
||||
try {
|
||||
FileHandler fh = new FileHandler("TimeStamper.log", true);
|
||||
fh.setFormatter(new SimpleFormatter());
|
||||
fh.setLevel(Level.ALL);
|
||||
log.addHandler(fh);
|
||||
} catch (IOException ioe) {
|
||||
log.warning("Could not open log file for writing. Switching console"
|
||||
+ " logging to verbose.");
|
||||
ch.setLevel(Level.ALL);
|
||||
}
|
||||
|
||||
// load configuration
|
||||
try {
|
||||
config = new Properties();
|
||||
File cfgFile = new File("timestamper.config");
|
||||
if (!cfgFile.exists()) cfgFile.createNewFile();
|
||||
FileInputStream cfgIn = new FileInputStream(cfgFile);
|
||||
config.load(cfgIn);
|
||||
cfgIn.close();
|
||||
} catch (IOException ioe) {
|
||||
log.warning("Could not load configuration options.");
|
||||
}
|
||||
|
||||
// load the last used timeline
|
||||
// TODO: fix
|
||||
loadTimelineProperties(config.getProperty("lastUsedTimelineProperties", "timeline.default.properties"));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Override protected void initialize(String[] args) {
|
||||
}
|
||||
|
||||
/**
|
||||
* At startup create and show the main frame of the application.
|
||||
*/
|
||||
@Override protected void startup() {
|
||||
show(new TimeStamperView(this));
|
||||
getMainFrame().setSize(325, 60);
|
||||
getApplication().addExitListener(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is to initialize the specified window by injecting resources.
|
||||
* Windows shown in our application come fully initialized from the GUI
|
||||
* builder, so this additional configuration is not needed.
|
||||
*/
|
||||
@Override protected void configureWindow(java.awt.Window root) {
|
||||
}
|
||||
|
||||
/**
|
||||
* A convenient static getter for the application instance.
|
||||
* @return the instance of TimeStamperApp
|
||||
*/
|
||||
public static TimeStamperApp getApplication() {
|
||||
return Application.getInstance(TimeStamperApp.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Main method launching the application.
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
launch(TimeStamperApp.class, args);
|
||||
}
|
||||
|
||||
public TimelineProperties getTimelineProperties() {
|
||||
return timelineProperties;
|
||||
}
|
||||
|
||||
public void saveTimelineProperties() {
|
||||
try {
|
||||
timelineProperties.save();
|
||||
} catch (IOException ioe) {
|
||||
log.warning("Could not save the timeline to <"
|
||||
+ timelineProperties.getTimelineSource().getURI().toString()
|
||||
+ ">:" + ioe.getLocalizedMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void saveTimelinePropertiesAs(File propertyFile) {
|
||||
try { timelineProperties.save(propertyFile); }
|
||||
catch (IOException ioe) {
|
||||
// TODO
|
||||
}
|
||||
}
|
||||
|
||||
public void loadTimelineProperties(String filename) {
|
||||
loadTimelineProperties(new File(filename));
|
||||
}
|
||||
|
||||
public void loadTimelineProperties(File propertyFile) {
|
||||
try { timelineProperties = new TimelineProperties(propertyFile); }
|
||||
catch (IOException ioe) {
|
||||
// TODO
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void willExit(EventObject e) {
|
||||
saveTimelineProperties();
|
||||
|
||||
config.setProperty("lastUsedTimelineProperties",
|
||||
timelineProperties.getTimelineSource().getURI().toString());
|
||||
try {
|
||||
FileOutputStream out = new FileOutputStream("timestamper.config");
|
||||
config.store(out, "");
|
||||
out.close();
|
||||
} catch (IOException ioe) {
|
||||
log.warning("Could not save config file.");
|
||||
}
|
||||
|
||||
for (Handler h : log.getHandlers())
|
||||
h.close();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExit(EventObject e) { return true; }
|
||||
}
|
@ -1,279 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<Form version="1.5" maxVersion="1.6">
|
||||
<NonVisualComponents>
|
||||
<Container class="javax.swing.JPanel" name="mainPanel">
|
||||
<Properties>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="org.netbeans.modules.form.compat2.border.MatteColorBorderInfo">
|
||||
<MatteColorBorder bottom="2" left="2" right="2" top="2"/>
|
||||
</Border>
|
||||
</Property>
|
||||
<Property name="name" type="java.lang.String" value="mainPanel" noResource="true"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="mousePressed" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="mainPanelMousePressed"/>
|
||||
</Events>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_ListenersCodePost" type="java.lang.String" value="mainPanel.addMouseMotionListener(this);"/>
|
||||
</AuxValues>
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="totalTimeNow" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="58" max="32767" attributes="0"/>
|
||||
<Component id="currentTimeLabel" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="currentTaskLabel" min="-2" max="-2" attributes="1"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="startTimeLabel" pref="116" max="32767" attributes="1"/>
|
||||
</Group>
|
||||
<Component id="taskTextField" alignment="0" pref="275" max="32767" attributes="1"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Component id="optionsButton" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="notesButton" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
|
||||
<Component id="exitButton" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="exitButton" alignment="0" min="-2" pref="16" max="-2" attributes="0"/>
|
||||
<Component id="optionsButton" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="103" alignment="0" groupAlignment="3" attributes="0">
|
||||
<Component id="currentTaskLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="startTimeLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Component id="taskTextField" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="totalTimeNow" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="currentTimeLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<Component id="notesButton" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="312" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JLabel" name="currentTaskLabel">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" noResource="true" editor="org.netbeans.modules.form.editors2.FontEditor">
|
||||
<FontInfo relative="true">
|
||||
<Font bold="true" component="currentTaskLabel" property="font" relativeSize="true" size="2"/>
|
||||
</FontInfo>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" resourceKey="currentTaskLabel.text"/>
|
||||
<Property name="name" type="java.lang.String" value="currentTaskLabel" noResource="true"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="exitButton">
|
||||
<Properties>
|
||||
<Property name="action" type="javax.swing.Action" editor="org.netbeans.modules.swingapp.ActionEditor">
|
||||
<action class="org.jdesktop.application.Application" id="quit" methodName="quit"/>
|
||||
</Property>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="null"/>
|
||||
</Property>
|
||||
<Property name="contentAreaFilled" type="boolean" value="false"/>
|
||||
<Property name="focusPainted" type="boolean" value="false"/>
|
||||
<Property name="hideActionText" type="boolean" value="true"/>
|
||||
<Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
|
||||
<Insets value="[0, 0, 0, 0]"/>
|
||||
</Property>
|
||||
<Property name="name" type="java.lang.String" value="exitButton" noResource="true"/>
|
||||
<Property name="rolloverIcon" type="javax.swing.Icon" resourceKey="exitButton.rolloverIcon"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="taskTextField">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" noResource="true" editor="org.netbeans.modules.form.editors2.FontEditor">
|
||||
<FontInfo relative="true">
|
||||
<Font bold="true" component="taskTextField" property="font" relativeSize="true" size="0"/>
|
||||
</FontInfo>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" resourceKey="taskTextField.text"/>
|
||||
<Property name="name" type="java.lang.String" value="taskTextField" noResource="true"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="keyReleased" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="taskTextFieldKeyReleased"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="startTimeLabel">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" noResource="true" editor="org.netbeans.modules.form.editors2.FontEditor">
|
||||
<FontInfo relative="true">
|
||||
<Font bold="true" component="startTimeLabel" property="font" relativeSize="true" size="4"/>
|
||||
</FontInfo>
|
||||
</Property>
|
||||
<Property name="foreground" type="java.awt.Color" resourceKey="startTimeLabel.foreground"/>
|
||||
<Property name="text" type="java.lang.String" resourceKey="startTimeLabel.text"/>
|
||||
<Property name="name" type="java.lang.String" value="startTimeLabel" noResource="true"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="totalTimeNow">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" noResource="true" editor="org.netbeans.modules.form.editors2.FontEditor">
|
||||
<FontInfo relative="true">
|
||||
<Font bold="true" component="totalTimeNow" property="font" relativeSize="true" size="3"/>
|
||||
</FontInfo>
|
||||
</Property>
|
||||
<Property name="foreground" type="java.awt.Color" resourceKey="totalTimeNow.foreground"/>
|
||||
<Property name="text" type="java.lang.String" resourceKey="totalTimeNow.text"/>
|
||||
<Property name="name" type="java.lang.String" value="totalTimeNow" noResource="true"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="currentTimeLabel">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" noResource="true" editor="org.netbeans.modules.form.editors2.FontEditor">
|
||||
<FontInfo relative="true">
|
||||
<Font bold="true" component="currentTimeLabel" property="font" relativeSize="true" size="3"/>
|
||||
</FontInfo>
|
||||
</Property>
|
||||
<Property name="foreground" type="java.awt.Color" resourceKey="currentTimeLabel.foreground"/>
|
||||
<Property name="text" type="java.lang.String" resourceKey="currentTimeLabel.text"/>
|
||||
<Property name="name" type="java.lang.String" value="currentTimeLabel" noResource="true"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="optionsButton">
|
||||
<Properties>
|
||||
<Property name="icon" type="javax.swing.Icon" resourceKey="optionsButton.icon"/>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="null"/>
|
||||
</Property>
|
||||
<Property name="borderPainted" type="boolean" value="false"/>
|
||||
<Property name="contentAreaFilled" type="boolean" value="false"/>
|
||||
<Property name="focusPainted" type="boolean" value="false"/>
|
||||
<Property name="hideActionText" type="boolean" value="true"/>
|
||||
<Property name="iconTextGap" type="int" value="0"/>
|
||||
<Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
|
||||
<Insets value="[0, 0, 0, 0]"/>
|
||||
</Property>
|
||||
<Property name="name" type="java.lang.String" value="optionsButton" noResource="true"/>
|
||||
<Property name="rolloverIcon" type="javax.swing.Icon" resourceKey="optionsButton.rolloverIcon"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="optionsButtonMouseClicked"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JToggleButton" name="notesButton">
|
||||
<Properties>
|
||||
<Property name="action" type="javax.swing.Action" editor="org.netbeans.modules.swingapp.ActionEditor">
|
||||
<action class="jdbernard.timestamper.TimeStamperView" id="editNotes" methodName="editNotes"/>
|
||||
</Property>
|
||||
<Property name="hideActionText" type="boolean" value="true"/>
|
||||
<Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
|
||||
<Insets value="[0, 0, 0, 0]"/>
|
||||
</Property>
|
||||
<Property name="name" type="java.lang.String" value="notesButton" noResource="true"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Container class="javax.swing.JPopupMenu" name="optionsMenu">
|
||||
<Properties>
|
||||
<Property name="name" type="java.lang.String" value="optionsMenu" noResource="true"/>
|
||||
</Properties>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout">
|
||||
<Property name="useNullLayout" type="boolean" value="true"/>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<MenuItem class="javax.swing.JMenuItem" name="saveTimelineMenuItem">
|
||||
<Properties>
|
||||
<Property name="action" type="javax.swing.Action" editor="org.netbeans.modules.swingapp.ActionEditor">
|
||||
<action class="jdbernard.timestamper.TimeStamperView" id="saveTimeline" methodName="saveTimeline"/>
|
||||
</Property>
|
||||
<Property name="name" type="java.lang.String" value="saveTimelineMenuItem" noResource="true"/>
|
||||
</Properties>
|
||||
</MenuItem>
|
||||
<MenuItem class="javax.swing.JMenuItem" name="saveTimelineAsMenuItem">
|
||||
<Properties>
|
||||
<Property name="action" type="javax.swing.Action" editor="org.netbeans.modules.swingapp.ActionEditor">
|
||||
<action class="jdbernard.timestamper.TimeStamperView" id="saveTimelineAs" methodName="saveTimelineAs"/>
|
||||
</Property>
|
||||
<Property name="name" type="java.lang.String" value="saveTimelineAsMenuItem" noResource="true"/>
|
||||
</Properties>
|
||||
</MenuItem>
|
||||
<MenuItem class="javax.swing.JMenuItem" name="loadTimelineMenuItem">
|
||||
<Properties>
|
||||
<Property name="action" type="javax.swing.Action" editor="org.netbeans.modules.swingapp.ActionEditor">
|
||||
<action class="jdbernard.timestamper.TimeStamperView" id="loadTimeline" methodName="loadTimeline"/>
|
||||
</Property>
|
||||
<Property name="name" type="java.lang.String" value="loadTimelineMenuItem" noResource="true"/>
|
||||
</Properties>
|
||||
</MenuItem>
|
||||
<Component class="javax.swing.JSeparator" name="seperator1">
|
||||
<Properties>
|
||||
<Property name="name" type="java.lang.String" value="seperator1" noResource="true"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<MenuItem class="javax.swing.JCheckBoxMenuItem" name="showNotesDialogCheckBoxMenuItem">
|
||||
<Properties>
|
||||
<Property name="action" type="javax.swing.Action" editor="org.netbeans.modules.swingapp.ActionEditor">
|
||||
<action class="jdbernard.timestamper.TimeStamperView" id="editNotes" methodName="editNotes"/>
|
||||
</Property>
|
||||
<Property name="name" type="java.lang.String" value="showNotesDialogCheckBoxMenuItem" noResource="true"/>
|
||||
</Properties>
|
||||
</MenuItem>
|
||||
<MenuItem class="javax.swing.JCheckBoxMenuItem" name="showPunchcardCheckBoxMenuItem">
|
||||
<Properties>
|
||||
<Property name="action" type="javax.swing.Action" editor="org.netbeans.modules.swingapp.ActionEditor">
|
||||
<action class="jdbernard.timestamper.TimeStamperView" id="showPunchcard" methodName="showPunchcard"/>
|
||||
</Property>
|
||||
<Property name="name" type="java.lang.String" value="showPunchcardCheckBoxMenuItem" noResource="true"/>
|
||||
</Properties>
|
||||
</MenuItem>
|
||||
<Component class="javax.swing.JSeparator" name="seperator2">
|
||||
<Properties>
|
||||
<Property name="name" type="java.lang.String" value="seperator2" noResource="true"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<MenuItem class="javax.swing.JCheckBoxMenuItem" name="showAboutCheckBoxMenuItem">
|
||||
<Properties>
|
||||
<Property name="action" type="javax.swing.Action" editor="org.netbeans.modules.swingapp.ActionEditor">
|
||||
<action class="jdbernard.timestamper.TimeStamperView" id="showAboutDialog" methodName="showAboutDialog"/>
|
||||
</Property>
|
||||
<Property name="name" type="java.lang.String" value="showAboutCheckBoxMenuItem" noResource="true"/>
|
||||
</Properties>
|
||||
</MenuItem>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</NonVisualComponents>
|
||||
<Properties>
|
||||
<Property name="component" type="javax.swing.JComponent" editor="org.netbeans.modules.form.ComponentChooserEditor">
|
||||
<ComponentRef name="mainPanel"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="2"/>
|
||||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="true"/>
|
||||
<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"/>
|
||||
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,118,0,0,1,76"/>
|
||||
</AuxValues>
|
||||
</Form>
|
@ -1,513 +0,0 @@
|
||||
/*
|
||||
* TimeStamperView.java
|
||||
*/
|
||||
|
||||
package jdbernard.timestamper.gui;
|
||||
|
||||
import jdbernard.timestamper.core.TimelineMarker;
|
||||
import jdbernard.timestamper.core.Timeline;
|
||||
import java.awt.Font;
|
||||
import java.awt.Point;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.Toolkit;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.event.MouseMotionListener;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
import javax.swing.JFileChooser;
|
||||
import javax.swing.event.ChangeEvent;
|
||||
import javax.swing.event.ChangeListener;
|
||||
import org.jdesktop.application.Action;
|
||||
import org.jdesktop.application.ResourceMap;
|
||||
import org.jdesktop.application.SingleFrameApplication;
|
||||
import org.jdesktop.application.FrameView;
|
||||
|
||||
/**
|
||||
* The application's main frame.
|
||||
*/
|
||||
public class TimeStamperView extends FrameView implements MouseMotionListener,
|
||||
ChangeListener {
|
||||
|
||||
public TimeStamperView(SingleFrameApplication app) {
|
||||
super(app);
|
||||
|
||||
initComponents();
|
||||
|
||||
ResourceMap resourceMap = getResourceMap();
|
||||
|
||||
getFrame().setUndecorated(true);
|
||||
|
||||
getFrame().setIconImage(resourceMap.getImageIcon("Application.icon")
|
||||
.getImage());
|
||||
|
||||
fileChooser = new JFileChooser();
|
||||
notesDialog = new NotesDialog(this, false);
|
||||
aboutDialog = new AboutDialog(this.getFrame(), false);
|
||||
|
||||
updateTimer = new Timer();
|
||||
updateTimer.scheduleAtFixedRate(new TimerTask() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
Date currentTime = new Date();
|
||||
currentTimeLabel.setText(Timeline.shortFormat.format(currentTime));
|
||||
if (mostRecentTask != null) {
|
||||
long seconds = currentTime.getTime() - mostRecentTask.getTime();
|
||||
seconds /= 1000;
|
||||
long minutes = seconds / 60;
|
||||
seconds = seconds % 60;
|
||||
long hours = minutes / 60;
|
||||
minutes %= 60;
|
||||
long days = hours / 24;
|
||||
hours %= 24;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
if (days > 0) sb.append(Long.toString(days) + "day ");
|
||||
if (hours > 0) sb.append(Long.toString(hours) + "hr ");
|
||||
if (minutes > 0) sb.append(Long.toString(minutes) + "min ");
|
||||
sb.append(Long.toString(seconds) + "sec");
|
||||
|
||||
totalTimeNow.setText(sb.toString());
|
||||
} else totalTimeNow.setText("");
|
||||
}
|
||||
}, 0, 1000);
|
||||
|
||||
saveTimelineTimer = new Timer();
|
||||
saveTimelineTimer.scheduleAtFixedRate(new TimerTask() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
saveTimeline();
|
||||
}
|
||||
}, 0, 1000*60*30);
|
||||
thinTaskFont = taskTextField.getFont().deriveFont(Font.PLAIN);
|
||||
boldTaskFont = thinTaskFont.deriveFont(Font.BOLD);
|
||||
|
||||
// refresh new timeline
|
||||
refreshDialog();
|
||||
}
|
||||
|
||||
/** 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() {
|
||||
|
||||
mainPanel = new javax.swing.JPanel();
|
||||
currentTaskLabel = new javax.swing.JLabel();
|
||||
exitButton = new javax.swing.JButton();
|
||||
taskTextField = new javax.swing.JTextField();
|
||||
startTimeLabel = new javax.swing.JLabel();
|
||||
totalTimeNow = new javax.swing.JLabel();
|
||||
currentTimeLabel = new javax.swing.JLabel();
|
||||
optionsButton = new javax.swing.JButton();
|
||||
notesButton = new javax.swing.JToggleButton();
|
||||
optionsMenu = new javax.swing.JPopupMenu();
|
||||
saveTimelineMenuItem = new javax.swing.JMenuItem();
|
||||
saveTimelineAsMenuItem = new javax.swing.JMenuItem();
|
||||
loadTimelineMenuItem = new javax.swing.JMenuItem();
|
||||
seperator1 = new javax.swing.JSeparator();
|
||||
showNotesDialogCheckBoxMenuItem = new javax.swing.JCheckBoxMenuItem();
|
||||
showPunchcardCheckBoxMenuItem = new javax.swing.JCheckBoxMenuItem();
|
||||
seperator2 = new javax.swing.JSeparator();
|
||||
showAboutCheckBoxMenuItem = new javax.swing.JCheckBoxMenuItem();
|
||||
|
||||
mainPanel.setBorder(javax.swing.BorderFactory.createMatteBorder(2, 2, 2, 2, new java.awt.Color(0, 0, 0)));
|
||||
mainPanel.setName("mainPanel"); // NOI18N
|
||||
mainPanel.addMouseListener(new java.awt.event.MouseAdapter() {
|
||||
public void mousePressed(java.awt.event.MouseEvent evt) {
|
||||
mainPanelMousePressed(evt);
|
||||
}
|
||||
});
|
||||
mainPanel.addMouseMotionListener(this);
|
||||
|
||||
currentTaskLabel.setFont(currentTaskLabel.getFont().deriveFont(currentTaskLabel.getFont().getStyle() | java.awt.Font.BOLD, currentTaskLabel.getFont().getSize()+2));
|
||||
org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(jdbernard.timestamper.gui.TimeStamperApp.class).getContext().getResourceMap(TimeStamperView.class);
|
||||
currentTaskLabel.setText(resourceMap.getString("currentTaskLabel.text")); // NOI18N
|
||||
currentTaskLabel.setName("currentTaskLabel"); // NOI18N
|
||||
|
||||
javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(jdbernard.timestamper.gui.TimeStamperApp.class).getContext().getActionMap(TimeStamperView.class, this);
|
||||
exitButton.setAction(actionMap.get("quit")); // NOI18N
|
||||
exitButton.setBorder(null);
|
||||
exitButton.setContentAreaFilled(false);
|
||||
exitButton.setFocusPainted(false);
|
||||
exitButton.setHideActionText(true);
|
||||
exitButton.setMargin(new java.awt.Insets(0, 0, 0, 0));
|
||||
exitButton.setName("exitButton"); // NOI18N
|
||||
exitButton.setRolloverIcon(resourceMap.getIcon("exitButton.rolloverIcon")); // NOI18N
|
||||
|
||||
taskTextField.setFont(taskTextField.getFont().deriveFont(taskTextField.getFont().getStyle() | java.awt.Font.BOLD));
|
||||
taskTextField.setText(resourceMap.getString("taskTextField.text")); // NOI18N
|
||||
taskTextField.setName("taskTextField"); // NOI18N
|
||||
taskTextField.addKeyListener(new java.awt.event.KeyAdapter() {
|
||||
public void keyReleased(java.awt.event.KeyEvent evt) {
|
||||
taskTextFieldKeyReleased(evt);
|
||||
}
|
||||
});
|
||||
|
||||
startTimeLabel.setFont(startTimeLabel.getFont().deriveFont(startTimeLabel.getFont().getStyle() | java.awt.Font.BOLD, startTimeLabel.getFont().getSize()+4));
|
||||
startTimeLabel.setForeground(resourceMap.getColor("startTimeLabel.foreground")); // NOI18N
|
||||
startTimeLabel.setText(resourceMap.getString("startTimeLabel.text")); // NOI18N
|
||||
startTimeLabel.setName("startTimeLabel"); // NOI18N
|
||||
|
||||
totalTimeNow.setFont(totalTimeNow.getFont().deriveFont(totalTimeNow.getFont().getStyle() | java.awt.Font.BOLD, totalTimeNow.getFont().getSize()+3));
|
||||
totalTimeNow.setForeground(resourceMap.getColor("totalTimeNow.foreground")); // NOI18N
|
||||
totalTimeNow.setText(resourceMap.getString("totalTimeNow.text")); // NOI18N
|
||||
totalTimeNow.setName("totalTimeNow"); // NOI18N
|
||||
|
||||
currentTimeLabel.setFont(currentTimeLabel.getFont().deriveFont(currentTimeLabel.getFont().getStyle() | java.awt.Font.BOLD, currentTimeLabel.getFont().getSize()+3));
|
||||
currentTimeLabel.setForeground(resourceMap.getColor("currentTimeLabel.foreground")); // NOI18N
|
||||
currentTimeLabel.setText(resourceMap.getString("currentTimeLabel.text")); // NOI18N
|
||||
currentTimeLabel.setName("currentTimeLabel"); // NOI18N
|
||||
|
||||
optionsButton.setIcon(resourceMap.getIcon("optionsButton.icon")); // NOI18N
|
||||
optionsButton.setBorder(null);
|
||||
optionsButton.setBorderPainted(false);
|
||||
optionsButton.setContentAreaFilled(false);
|
||||
optionsButton.setFocusPainted(false);
|
||||
optionsButton.setHideActionText(true);
|
||||
optionsButton.setIconTextGap(0);
|
||||
optionsButton.setMargin(new java.awt.Insets(0, 0, 0, 0));
|
||||
optionsButton.setName("optionsButton"); // NOI18N
|
||||
optionsButton.setRolloverIcon(resourceMap.getIcon("optionsButton.rolloverIcon")); // NOI18N
|
||||
optionsButton.addMouseListener(new java.awt.event.MouseAdapter() {
|
||||
public void mouseClicked(java.awt.event.MouseEvent evt) {
|
||||
optionsButtonMouseClicked(evt);
|
||||
}
|
||||
});
|
||||
|
||||
notesButton.setAction(actionMap.get("editNotes")); // NOI18N
|
||||
notesButton.setHideActionText(true);
|
||||
notesButton.setMargin(new java.awt.Insets(0, 0, 0, 0));
|
||||
notesButton.setName("notesButton"); // NOI18N
|
||||
|
||||
javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);
|
||||
mainPanel.setLayout(mainPanelLayout);
|
||||
mainPanelLayout.setHorizontalGroup(
|
||||
mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(mainPanelLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(mainPanelLayout.createSequentialGroup()
|
||||
.addComponent(totalTimeNow)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 58, Short.MAX_VALUE)
|
||||
.addComponent(currentTimeLabel))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup()
|
||||
.addComponent(currentTaskLabel)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(startTimeLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 116, Short.MAX_VALUE))
|
||||
.addComponent(taskTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 275, Short.MAX_VALUE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(optionsButton)
|
||||
.addComponent(notesButton))
|
||||
.addGap(0, 0, 0)
|
||||
.addComponent(exitButton))
|
||||
);
|
||||
mainPanelLayout.setVerticalGroup(
|
||||
mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(mainPanelLayout.createSequentialGroup()
|
||||
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(exitButton, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(optionsButton)
|
||||
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(currentTaskLabel)
|
||||
.addComponent(startTimeLabel)))
|
||||
.addGap(0, 0, 0)
|
||||
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(mainPanelLayout.createSequentialGroup()
|
||||
.addComponent(taskTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(0, 0, 0)
|
||||
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(totalTimeNow)
|
||||
.addComponent(currentTimeLabel)))
|
||||
.addComponent(notesButton))
|
||||
.addGap(312, 312, 312))
|
||||
);
|
||||
|
||||
optionsMenu.setName("optionsMenu"); // NOI18N
|
||||
|
||||
saveTimelineMenuItem.setAction(actionMap.get("saveTimeline")); // NOI18N
|
||||
saveTimelineMenuItem.setName("saveTimelineMenuItem"); // NOI18N
|
||||
optionsMenu.add(saveTimelineMenuItem);
|
||||
|
||||
saveTimelineAsMenuItem.setAction(actionMap.get("saveTimelineAs")); // NOI18N
|
||||
saveTimelineAsMenuItem.setName("saveTimelineAsMenuItem"); // NOI18N
|
||||
optionsMenu.add(saveTimelineAsMenuItem);
|
||||
|
||||
loadTimelineMenuItem.setAction(actionMap.get("loadTimeline")); // NOI18N
|
||||
loadTimelineMenuItem.setName("loadTimelineMenuItem"); // NOI18N
|
||||
optionsMenu.add(loadTimelineMenuItem);
|
||||
|
||||
seperator1.setName("seperator1"); // NOI18N
|
||||
optionsMenu.add(seperator1);
|
||||
|
||||
showNotesDialogCheckBoxMenuItem.setAction(actionMap.get("editNotes")); // NOI18N
|
||||
showNotesDialogCheckBoxMenuItem.setName("showNotesDialogCheckBoxMenuItem"); // NOI18N
|
||||
optionsMenu.add(showNotesDialogCheckBoxMenuItem);
|
||||
|
||||
showPunchcardCheckBoxMenuItem.setAction(actionMap.get("showPunchcard")); // NOI18N
|
||||
showPunchcardCheckBoxMenuItem.setName("showPunchcardCheckBoxMenuItem"); // NOI18N
|
||||
optionsMenu.add(showPunchcardCheckBoxMenuItem);
|
||||
|
||||
seperator2.setName("seperator2"); // NOI18N
|
||||
optionsMenu.add(seperator2);
|
||||
|
||||
showAboutCheckBoxMenuItem.setAction(actionMap.get("showAboutDialog")); // NOI18N
|
||||
showAboutCheckBoxMenuItem.setName("showAboutCheckBoxMenuItem"); // NOI18N
|
||||
optionsMenu.add(showAboutCheckBoxMenuItem);
|
||||
|
||||
setComponent(mainPanel);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
private void taskTextFieldKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_taskTextFieldKeyReleased
|
||||
if (evt.getKeyCode() == KeyEvent.VK_ENTER) {
|
||||
Timeline t = ((TimeStamperApp) getApplication())
|
||||
.getTimelineProperties().getTimeline();
|
||||
Date d = new Date();
|
||||
t.addMarker(d, taskTextField.getText(), "No comments.");
|
||||
startTimeLabel.setText(Timeline.shortFormat.format(d));
|
||||
taskTextField.setFont(boldTaskFont);
|
||||
mostRecentTask = d;
|
||||
fireChangeEvent();
|
||||
} else {
|
||||
taskTextField.setFont(thinTaskFont);
|
||||
}
|
||||
}//GEN-LAST:event_taskTextFieldKeyReleased
|
||||
|
||||
private void mainPanelMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_mainPanelMousePressed
|
||||
mousePressRelativeToFrame = evt.getPoint();
|
||||
}//GEN-LAST:event_mainPanelMousePressed
|
||||
|
||||
private void optionsButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_optionsButtonMouseClicked
|
||||
optionsMenu.show(evt.getComponent(), evt.getX(), evt.getY());
|
||||
}//GEN-LAST:event_optionsButtonMouseClicked
|
||||
|
||||
@Action
|
||||
public void editNotes() {
|
||||
notesVisible = !notesVisible;
|
||||
notesDialog.setVisible(notesVisible);
|
||||
notesButton.setSelected(notesVisible);
|
||||
showNotesDialogCheckBoxMenuItem.setSelected(notesVisible);
|
||||
}
|
||||
|
||||
@Action
|
||||
public void showPunchcard() {
|
||||
punchcardVisible = !punchcardVisible;
|
||||
showPunchcardCheckBoxMenuItem.setSelected(punchcardVisible);
|
||||
getPunchcardDisplayDialog().setVisible(punchcardVisible);
|
||||
}
|
||||
|
||||
@Action
|
||||
public void showAboutDialog() {
|
||||
aboutDialogVisible = !aboutDialogVisible;
|
||||
showAboutCheckBoxMenuItem.setSelected(aboutDialogVisible);
|
||||
aboutDialog.setVisible(aboutDialogVisible);
|
||||
}
|
||||
|
||||
public void setNotesForActiveTask(String notes) {
|
||||
Timeline t = ((TimeStamperApp) getApplication())
|
||||
.getTimelineProperties().getTimeline();
|
||||
TimelineMarker tm = t.getLastMarker(new Date());
|
||||
if (tm == null) return;
|
||||
tm.setNotes(notes);
|
||||
}
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JLabel currentTaskLabel;
|
||||
private javax.swing.JLabel currentTimeLabel;
|
||||
private javax.swing.JButton exitButton;
|
||||
private javax.swing.JMenuItem loadTimelineMenuItem;
|
||||
private javax.swing.JPanel mainPanel;
|
||||
private javax.swing.JToggleButton notesButton;
|
||||
private javax.swing.JButton optionsButton;
|
||||
private javax.swing.JPopupMenu optionsMenu;
|
||||
private javax.swing.JMenuItem saveTimelineAsMenuItem;
|
||||
private javax.swing.JMenuItem saveTimelineMenuItem;
|
||||
private javax.swing.JSeparator seperator1;
|
||||
private javax.swing.JSeparator seperator2;
|
||||
private javax.swing.JCheckBoxMenuItem showAboutCheckBoxMenuItem;
|
||||
private javax.swing.JCheckBoxMenuItem showNotesDialogCheckBoxMenuItem;
|
||||
private javax.swing.JCheckBoxMenuItem showPunchcardCheckBoxMenuItem;
|
||||
private javax.swing.JLabel startTimeLabel;
|
||||
private javax.swing.JTextField taskTextField;
|
||||
private javax.swing.JLabel totalTimeNow;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
|
||||
private Point mousePressRelativeToFrame;
|
||||
private JFileChooser fileChooser;
|
||||
private Timer updateTimer;
|
||||
private Timer saveTimelineTimer;
|
||||
private Font boldTaskFont;
|
||||
private Font thinTaskFont;
|
||||
private Date mostRecentTask;
|
||||
private NotesDialog notesDialog;
|
||||
private PunchcardDisplayDialog punchcardDisplayDialog;
|
||||
private AboutDialog aboutDialog;
|
||||
private boolean notesVisible = false;
|
||||
private boolean punchcardVisible = false;
|
||||
private boolean aboutDialogVisible = false;
|
||||
private ArrayList<ChangeListener> changeListeners =
|
||||
new ArrayList<ChangeListener>();
|
||||
|
||||
private PunchcardDisplayDialog getPunchcardDisplayDialog() {
|
||||
if (punchcardDisplayDialog == null) {
|
||||
punchcardDisplayDialog = new PunchcardDisplayDialog(this.getFrame(),
|
||||
false, Calendar.getInstance());
|
||||
punchcardDisplayDialog.addChangeListener(this);
|
||||
addChangeListener(punchcardDisplayDialog);
|
||||
}
|
||||
return punchcardDisplayDialog;
|
||||
}
|
||||
|
||||
public void mouseDragged(MouseEvent e) {
|
||||
getFrame().setLocation(calculateWindowMovement(e.getLocationOnScreen(),
|
||||
mousePressRelativeToFrame, getFrame().getBounds(),
|
||||
new Rectangle(Toolkit.getDefaultToolkit().getScreenSize())));
|
||||
}
|
||||
|
||||
public static Point calculateWindowMovement(Point currentMousePoint,
|
||||
Point mousePressRelativeToWindow, Rectangle windowBounds,
|
||||
Rectangle... snapBoxes) {
|
||||
|
||||
// this is the point we will compute as the new upper left
|
||||
// coordinate of the frame. It needs to be translated some to account
|
||||
// for the fact that the user can press the mouse anywhere on the
|
||||
// main panel.
|
||||
Point currentWindowPoint = (Point) currentMousePoint.clone();
|
||||
// find out where the new point should be, ignoreing screen bounds
|
||||
currentWindowPoint.translate(-mousePressRelativeToWindow.x,
|
||||
-mousePressRelativeToWindow.y);
|
||||
|
||||
Point finalWindowPoint = (Point) currentWindowPoint.clone();
|
||||
|
||||
// snap tests. In the event of a conflict in snaps positions, the
|
||||
// last snap wins
|
||||
int wUp = windowBounds.y;
|
||||
int wDown = windowBounds.y + windowBounds.height;
|
||||
int wLeft = windowBounds.x;
|
||||
int wRight = windowBounds.x + windowBounds.width;
|
||||
|
||||
// currentTaskLabel.setText("U:" + wUp + " D:" + wDown + " L:" + wLeft
|
||||
// + " R:" + wRight);
|
||||
|
||||
for (Rectangle r : snapBoxes) {
|
||||
int rUp = r.y;
|
||||
int rDown = r.y + r.height;
|
||||
int rLeft = r.x;
|
||||
int rRight = r.x + r.width;
|
||||
|
||||
// check to see if the window is near any of the snap boundaries
|
||||
// if it is, 'snap' the final point to that boundary.
|
||||
if (Math.abs(rUp - wUp) < 20) // top of window to top of rect
|
||||
finalWindowPoint.y = rUp;
|
||||
else if (Math.abs(rUp - wDown) < 20) // bot of w to top of r
|
||||
finalWindowPoint.y = rUp - windowBounds.height;
|
||||
else if (Math.abs(rDown - wUp) < 20) // top of w to bot of r
|
||||
finalWindowPoint.y = rDown;
|
||||
else if (Math.abs(rDown - wDown) < 20) // bot of w to bot of r
|
||||
finalWindowPoint.y = rDown - windowBounds.height;
|
||||
|
||||
if (Math.abs(rLeft - wLeft) < 20) // left of w to left of r
|
||||
finalWindowPoint.x = rLeft;
|
||||
else if (Math.abs(rLeft - wRight) < 20) // right of w to left of r
|
||||
finalWindowPoint.x = rLeft - windowBounds.width;
|
||||
else if (Math.abs(rRight - wLeft) < 20) // left of w to right of r
|
||||
finalWindowPoint.x = rRight;
|
||||
else if (Math.abs(rRight - wRight) < 20) // right of w to right of r
|
||||
finalWindowPoint.x = rRight - windowBounds.width;
|
||||
}
|
||||
|
||||
// this point represents a backwards version of the initial calculation
|
||||
// to find the finalPoint. It says, based on the current final point,
|
||||
// assume I moved the frame to that point. Where, relative to that point
|
||||
// should the mouse be, based on how far it was relative to the point
|
||||
// when the user pressed it.
|
||||
Point whereMouseShouldBe = (Point) finalWindowPoint.clone();
|
||||
whereMouseShouldBe.translate(mousePressRelativeToWindow.x,
|
||||
mousePressRelativeToWindow.y);
|
||||
|
||||
// if the actual mouse location is different from the expected location,
|
||||
// then we know that the snapping behaviour has altered the frames new
|
||||
// placement. If this alteration is too large (30 px apart in this case)
|
||||
// then we know the user is trying to pull the frame out of its snapped
|
||||
// position. In this case, we want to ignore the snap calculations and
|
||||
// base the new frame location entirely on the current mouse location
|
||||
if (whereMouseShouldBe.distance(currentMousePoint) > 30) {
|
||||
finalWindowPoint = (Point) currentMousePoint.clone();
|
||||
finalWindowPoint.translate(-mousePressRelativeToWindow.x,
|
||||
-mousePressRelativeToWindow.y);
|
||||
}
|
||||
|
||||
return finalWindowPoint;
|
||||
}
|
||||
|
||||
public void mouseMoved(MouseEvent e) {
|
||||
}
|
||||
|
||||
public void stateChanged(ChangeEvent ce) {
|
||||
refreshDialog();
|
||||
}
|
||||
|
||||
public void addChangeListener(ChangeListener cl) {
|
||||
changeListeners.add(cl);
|
||||
}
|
||||
|
||||
public boolean removeChangeListener(ChangeListener cl) {
|
||||
return changeListeners.remove(cl);
|
||||
}
|
||||
|
||||
private void fireChangeEvent() {
|
||||
ChangeEvent ce = new ChangeEvent(this);
|
||||
for (ChangeListener cl : changeListeners)
|
||||
cl.stateChanged(ce);
|
||||
|
||||
refreshDialog();
|
||||
}
|
||||
|
||||
@Action
|
||||
public void saveTimeline() {
|
||||
((TimeStamperApp) getApplication()).saveTimelineProperties();
|
||||
}
|
||||
|
||||
@Action
|
||||
public void saveTimelineAs() {
|
||||
if (fileChooser.showSaveDialog(getFrame())!=JFileChooser.APPROVE_OPTION)
|
||||
return;
|
||||
|
||||
((TimeStamperApp) getApplication()).saveTimelinePropertiesAs(
|
||||
fileChooser.getSelectedFile());
|
||||
}
|
||||
|
||||
@Action
|
||||
public void loadTimeline() {
|
||||
if (fileChooser.showOpenDialog(getFrame())!=JFileChooser.APPROVE_OPTION)
|
||||
return;
|
||||
|
||||
((TimeStamperApp) getApplication()).loadTimelineProperties(
|
||||
fileChooser.getSelectedFile().getAbsolutePath());
|
||||
|
||||
fireChangeEvent();
|
||||
}
|
||||
|
||||
public void refreshDialog() {
|
||||
Timeline t = ((TimeStamperApp) getApplication())
|
||||
.getTimelineProperties().getTimeline();
|
||||
TimelineMarker lastMarker = t.getLastMarker(new Date());
|
||||
|
||||
if (lastMarker != null) {
|
||||
mostRecentTask = lastMarker.getTimestamp();
|
||||
startTimeLabel.setText(Timeline.shortFormat.format(lastMarker.getTimestamp()));
|
||||
|
||||
taskTextField.setText(lastMarker.getMark());
|
||||
notesDialog.setNotes(lastMarker.getNotes());
|
||||
}
|
||||
}
|
||||
}
|
@ -1,660 +0,0 @@
|
||||
/* TimelineDayDisplay.java
|
||||
* Author: Jonathan Bernard - jonathan.bernard@gemalto.com
|
||||
*/
|
||||
|
||||
package jdbernard.timestamper.gui;
|
||||
|
||||
import jdbernard.timestamper.core.TimelineMarker;
|
||||
import jdbernard.timestamper.core.Timeline;
|
||||
import java.awt.BasicStroke;
|
||||
import java.awt.Color;
|
||||
import java.awt.Font;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.Insets;
|
||||
import java.awt.Point;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.event.MouseListener;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.Iterator;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.event.ChangeEvent;
|
||||
import javax.swing.event.ChangeListener;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jbernard
|
||||
*/
|
||||
public class TimelineDayDisplay extends JComponent implements MouseListener,
|
||||
ChangeListener {
|
||||
|
||||
private class MarkerDisplayEntry {
|
||||
public TimelineMarker marker;
|
||||
public float relY;
|
||||
public float relHeight;
|
||||
public Rectangle2D markBounds;
|
||||
public Rectangle2D notesBounds;
|
||||
public Rectangle bounds;
|
||||
}
|
||||
|
||||
private class TimeLegendEntry {
|
||||
public double relY;
|
||||
public String label;
|
||||
}
|
||||
|
||||
private enum TimeDelta {
|
||||
Hourly (Calendar.HOUR_OF_DAY, 1) {
|
||||
public String formatCalendar(Calendar c) {
|
||||
return String.format("%1$02d:00",
|
||||
c.get(Calendar.HOUR_OF_DAY));
|
||||
}
|
||||
|
||||
public boolean fitsInHeight(double height, double millisec) {
|
||||
return ((height * 1000l * 60l * 30l) / millisec < 25);
|
||||
}
|
||||
},
|
||||
ThirtyMin (Calendar.MINUTE, 30) {
|
||||
public String formatCalendar(Calendar c) {
|
||||
return String.format("%1$02d:%2$02d",
|
||||
c.get(Calendar.HOUR_OF_DAY), c.get(Calendar.MINUTE));
|
||||
}
|
||||
|
||||
public boolean fitsInHeight(double height, double millisec) {
|
||||
return ((height * 1000l * 60l * 15l) / millisec < 25);
|
||||
}
|
||||
},
|
||||
FifteenMin (Calendar.MINUTE, 15) {
|
||||
public String formatCalendar(Calendar c) {
|
||||
return String.format("%1$02d:%2$02d",
|
||||
c.get(Calendar.HOUR_OF_DAY), c.get(Calendar.MINUTE));
|
||||
}
|
||||
|
||||
public boolean fitsInHeight(double height, double millisec) {
|
||||
return ((height * 1000l * 60l * 10l) / millisec < 25);
|
||||
}
|
||||
},
|
||||
TenMin (Calendar.MINUTE, 10) {
|
||||
public String formatCalendar(Calendar c) {
|
||||
return String.format("%1$02d:%2$02d",
|
||||
c.get(Calendar.HOUR_OF_DAY), c.get(Calendar.MINUTE));
|
||||
}
|
||||
|
||||
public boolean fitsInHeight(double height, double millisec) {
|
||||
return ((height * 1000l * 60l * 5l) / millisec < 25);
|
||||
}
|
||||
},
|
||||
FiveMin (Calendar.MINUTE, 5) {
|
||||
public String formatCalendar(Calendar c) {
|
||||
return String.format("%1$02d:%2$02d",
|
||||
c.get(Calendar.HOUR_OF_DAY), c.get(Calendar.MINUTE));
|
||||
}
|
||||
|
||||
public boolean fitsInHeight(double height, double millisec) {
|
||||
return ((height * 1000l * 60l) / millisec < 25);
|
||||
}
|
||||
},
|
||||
Minute (Calendar.MINUTE, 1) {
|
||||
public String formatCalendar(Calendar c) {
|
||||
return String.format("%1$02d:%2$02d",
|
||||
c.get(Calendar.HOUR_OF_DAY), c.get(Calendar.MINUTE));
|
||||
}
|
||||
|
||||
public boolean fitsInHeight(double height, double millisec) {
|
||||
return ((height * 1000l * 30l) / millisec < 25);
|
||||
}
|
||||
},
|
||||
ThirtySec (Calendar.SECOND, 30) {
|
||||
public String formatCalendar(Calendar c) {
|
||||
return String.format("%1$02d:%2$02d",
|
||||
c.get(Calendar.MINUTE), c.get(Calendar.SECOND));
|
||||
}
|
||||
|
||||
public boolean fitsInHeight(double height, double millisec) {
|
||||
return ((height * 1000l * 15l) / millisec < 25);
|
||||
}
|
||||
},
|
||||
FifteenSec (Calendar.SECOND, 15) {
|
||||
public String formatCalendar(Calendar c) {
|
||||
return String.format("%1$02d:%2$02d",
|
||||
c.get(Calendar.MINUTE), c.get(Calendar.SECOND));
|
||||
}
|
||||
|
||||
public boolean fitsInHeight(double height, double millisec) {
|
||||
return ((height * 1000l * 10l) / millisec < 25);
|
||||
}
|
||||
},
|
||||
TenSec (Calendar.SECOND, 10) {
|
||||
public String formatCalendar(Calendar c) {
|
||||
return String.format("%1$02d:%2$02d",
|
||||
c.get(Calendar.MINUTE), c.get(Calendar.SECOND));
|
||||
}
|
||||
|
||||
public boolean fitsInHeight(double height, double millisec) {
|
||||
return ((height * 1000l * 5l) / millisec < 25);
|
||||
}
|
||||
},
|
||||
FiveSec (Calendar.SECOND, 5) {
|
||||
public String formatCalendar(Calendar c) {
|
||||
return String.format("%1$02d:%2$02d",
|
||||
c.get(Calendar.MINUTE), c.get(Calendar.SECOND));
|
||||
}
|
||||
|
||||
public boolean fitsInHeight(double height, double millisec) {
|
||||
return ((height * 1000l) / millisec < 25);
|
||||
}
|
||||
},
|
||||
Second (Calendar.SECOND, 1) {
|
||||
public String formatCalendar(Calendar c) {
|
||||
return String.format("%1$02d:%2$02d",
|
||||
c.get(Calendar.MINUTE), c.get(Calendar.SECOND));
|
||||
}
|
||||
|
||||
public boolean fitsInHeight(double height, double millisec) {
|
||||
return ((height * 1500l) / millisec < 25);
|
||||
}
|
||||
},
|
||||
SubSecond (Calendar.MILLISECOND, 100) {
|
||||
public String formatCalendar(Calendar c) {
|
||||
return String.format("%1$02d:%2$03d",
|
||||
c.get(Calendar.SECOND), c.get(Calendar.MILLISECOND));
|
||||
}
|
||||
|
||||
public boolean fitsInHeight(double height, double millisec) {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
private int INTERVAL;
|
||||
private int AMOUNT;
|
||||
|
||||
private TimeDelta(int interval, int amount) {
|
||||
INTERVAL = interval;
|
||||
AMOUNT = amount;
|
||||
}
|
||||
|
||||
public Calendar addToCalendar(Calendar c) {
|
||||
c.add(INTERVAL, AMOUNT);
|
||||
return c;
|
||||
}
|
||||
|
||||
public abstract boolean fitsInHeight(double height, double millisec);
|
||||
|
||||
public abstract String formatCalendar(Calendar c); { }
|
||||
}
|
||||
|
||||
private ArrayList<MarkerDisplayEntry> markerEntries;
|
||||
private ArrayList<TimeLegendEntry> timeLegendLocations;
|
||||
private TimelineMarker currentMarker;
|
||||
private ArrayList<ChangeListener> changeListeners = new ArrayList<ChangeListener>();
|
||||
|
||||
private Point lastMousePress;
|
||||
|
||||
private Font markFont;// = getFont().deriveFont(Font.BOLD);
|
||||
private Font notesFont;// = getFont();
|
||||
|
||||
private Color evenTrans = new Color(0.75f, 0.75f, 0.75f, 0.4f);
|
||||
private Color evenOpaque = new Color(0.75f, 0.75f, 0.75f, 1f);
|
||||
private Color oddTrans = new Color(0.5f, 0.5f, 0.5f, 0.4f);
|
||||
private Color oddOpaque = new Color(0.5f, 0.5f, 0.5f, 1f);
|
||||
private Color selectedTrans = new Color(0.5f, 0.75f, 0.5f, 0.4f);
|
||||
private Color selectedOpaque = new Color(0.5f, 0.75f, 0.5f, 1f);
|
||||
private Color fontColor = new Color(0.1f, 0.1f, 0.1f, 1f);
|
||||
|
||||
private Date rangeStartDate = new Date();
|
||||
private Date rangeEndDate = new Date();
|
||||
|
||||
public TimelineDayDisplay() {
|
||||
super();
|
||||
setDay(new Date(), false);
|
||||
addMouseListener(this);
|
||||
}
|
||||
|
||||
public TimelineDayDisplay(Calendar day) {
|
||||
setDay(day.getTime(), false);
|
||||
addMouseListener(this);
|
||||
updateMarkers(getGraphics());
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the range for the visible timeline segment.
|
||||
* @param start The beginning of the desired timeline segment.
|
||||
* @param end The end of the desired timeline segment.
|
||||
*/
|
||||
public void setDisplayInterval(Date start, Date end) {
|
||||
rangeStartDate = start;
|
||||
rangeEndDate = end;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the component to show the timeline segment for a specific day. The
|
||||
* visible area will show the full 24-hour day.
|
||||
* @param d The date of the day to display. The exact time of the variable
|
||||
* can be any time in the desired day.
|
||||
*/
|
||||
public void setDay(Date d) {
|
||||
setDay(d, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* There is the special case of instance initialization, where it is
|
||||
* desirable to call setDay to handle the range start and end calculations
|
||||
* but where we do not want to immediately update the gui, because it may
|
||||
* not be fully initialized yet.
|
||||
* @param d Day to set as the current day (component will show the range
|
||||
* representing the day from start to finish.
|
||||
* @param update If <b><pre>true</pre></b>,
|
||||
* <code>updateMarkers(getGraphics)</code> is called after the range
|
||||
* calculations are made.
|
||||
*/
|
||||
private void setDay(Date d, boolean update) {
|
||||
Calendar day = Calendar.getInstance();
|
||||
day.setTime(d);
|
||||
day.set(Calendar.HOUR_OF_DAY, 0);
|
||||
day.set(Calendar.MINUTE, 0);
|
||||
day.set(Calendar.SECOND, 0);
|
||||
rangeStartDate = day.getTime();
|
||||
|
||||
day.add(Calendar.DAY_OF_YEAR, 1);
|
||||
rangeEndDate = day.getTime();
|
||||
|
||||
if (update) updateMarkers(getGraphics());
|
||||
}
|
||||
|
||||
public void setMarkFont(Font f) {
|
||||
markFont = f;
|
||||
}
|
||||
|
||||
public Font getMarkFont() {
|
||||
return markFont;
|
||||
}
|
||||
|
||||
public void setNotesFont(Font f) {
|
||||
notesFont = f;
|
||||
}
|
||||
|
||||
public Font getNotesFont() {
|
||||
return notesFont;
|
||||
}
|
||||
|
||||
public void setFontColor(Color f) {
|
||||
fontColor = new Color(f.getRGB());
|
||||
}
|
||||
|
||||
public Color getFontColor() {
|
||||
return fontColor;
|
||||
}
|
||||
public void setEvenColor(Color c) {
|
||||
evenOpaque = new Color(c.getRGB());
|
||||
evenTrans = new Color((float) c.getRed() / 255f,
|
||||
(float) c.getGreen() / 255f,
|
||||
(float) c.getBlue() / 255f, 0.4f);
|
||||
}
|
||||
|
||||
public Color getEvenColor() {
|
||||
return evenOpaque;
|
||||
}
|
||||
|
||||
public void setOddColor(Color c) {
|
||||
oddOpaque = new Color(c.getRGB());
|
||||
oddTrans = new Color((float) c.getRed() / 255f,
|
||||
(float) c.getGreen() / 255f,
|
||||
(float) c.getBlue() / 255f, 0.4f);
|
||||
}
|
||||
|
||||
public Color getOddColor() {
|
||||
return oddOpaque;
|
||||
}
|
||||
|
||||
public void setSelectedColor(Color c) {
|
||||
selectedOpaque = new Color(c.getRGB());
|
||||
selectedTrans = new Color((float) c.getRed() / 255f,
|
||||
(float) c.getGreen() / 255f,
|
||||
(float) c.getBlue() / 255f, 0.4f);
|
||||
}
|
||||
|
||||
public Color getSelectedColor() {
|
||||
return selectedOpaque;
|
||||
}
|
||||
|
||||
public TimelineMarker getSelectedTimelineMarker() {
|
||||
return currentMarker;
|
||||
}
|
||||
|
||||
public void addMarker(Date timestamp, String mark, String notes) {
|
||||
Timeline timeline = TimeStamperApp.getApplication()
|
||||
.getTimelineProperties().getTimeline();
|
||||
timeline.addMarker(timestamp, mark, notes);
|
||||
updateMarkers(getGraphics());
|
||||
}
|
||||
|
||||
public void deleteSelectedMarker() {
|
||||
Timeline timeline = TimeStamperApp.getApplication()
|
||||
.getTimelineProperties().getTimeline();
|
||||
timeline.removeMarker(currentMarker);
|
||||
updateMarkers(getGraphics());
|
||||
}
|
||||
|
||||
public void updateSelectedMarker(String notes) {
|
||||
currentMarker.setNotes(notes);
|
||||
updateMarkers(getGraphics());
|
||||
}
|
||||
|
||||
/**
|
||||
* updateMarkers sets the internal list of TimelineMarkers, based on the
|
||||
* currently visible timeline. The drawing of the display is split between
|
||||
* this method, which constructs the data representation of what needs to
|
||||
* be drawn, and the paintComponents method, which does the drawing. This is
|
||||
* done to save computation, only recalculating markers when needed.
|
||||
*/
|
||||
private void updateMarkers(Graphics g) {
|
||||
|
||||
Timeline timeline = TimeStamperApp.getApplication()
|
||||
.getTimelineProperties().getTimeline();
|
||||
Insets insets = this.getInsets();
|
||||
Rectangle bounds = this.getBounds();
|
||||
Rectangle canvasBounds = new Rectangle(insets.left, insets.top,
|
||||
bounds.width - insets.left - insets.right - 1,
|
||||
bounds.height - insets.top - insets.bottom - 1);
|
||||
|
||||
Rectangle2D stringBounds = getFontMetrics(getFont()).getStringBounds("00:00 ", g);
|
||||
|
||||
long rangeDiff = rangeEndDate.getTime() - rangeStartDate.getTime();
|
||||
|
||||
markerEntries = new ArrayList<MarkerDisplayEntry>();
|
||||
timeLegendLocations = new ArrayList<TimeLegendEntry>();
|
||||
|
||||
if (markFont == null) markFont = getFont().deriveFont(Font.BOLD);
|
||||
if (notesFont == null) notesFont = getFont();
|
||||
|
||||
// calculate positions of all visible hour lines
|
||||
// choose the increment of time to view
|
||||
TimeDelta timeDelta = TimeDelta.Hourly;
|
||||
if (rangeDiff == 0) rangeDiff = 1;
|
||||
|
||||
for (TimeDelta d : TimeDelta.values()) {
|
||||
if (d.fitsInHeight(canvasBounds.getHeight(), rangeDiff)) {
|
||||
timeDelta = d;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Calendar timeCounter = Calendar.getInstance();
|
||||
timeCounter.setTime(rangeStartDate);
|
||||
timeCounter.set(Calendar.MINUTE, 0);
|
||||
timeCounter.set(Calendar.SECOND, 0);
|
||||
|
||||
while (rangeStartDate.after(timeCounter.getTime()))
|
||||
timeDelta.addToCalendar(timeCounter);
|
||||
|
||||
while (rangeEndDate.after(timeCounter.getTime())) {
|
||||
TimeLegendEntry entry = new TimeLegendEntry();
|
||||
entry.relY = ((double) (timeCounter.getTimeInMillis()
|
||||
- rangeStartDate.getTime()) / (double) rangeDiff);
|
||||
entry.label = timeDelta.formatCalendar(timeCounter);
|
||||
timeLegendLocations.add(entry);
|
||||
timeDelta.addToCalendar(timeCounter);
|
||||
}
|
||||
|
||||
// get all relevant markers starting from the marker just before the
|
||||
// visible start of the display
|
||||
TimelineMarker tm = timeline.getLastMarker(rangeStartDate);
|
||||
|
||||
// If there is no previous marker
|
||||
if (tm == null)
|
||||
// try to get the first marker
|
||||
try { tm = timeline.iterator().next(); }
|
||||
// and if there aren't any markers at all, just return, the array is
|
||||
// empty so the display will be empty
|
||||
catch (Exception e) { return; }
|
||||
|
||||
// Now we want to step through the timeline, capturing all markers
|
||||
// between the visible ranges.
|
||||
Iterator<TimelineMarker> itr = timeline.iterator();
|
||||
|
||||
while (!itr.next().equals(tm));
|
||||
|
||||
ArrayList<TimelineMarker> markers = new ArrayList<TimelineMarker>();
|
||||
while (rangeEndDate.after(tm.getTimestamp())) {
|
||||
markers.add(tm);
|
||||
if (itr.hasNext()) tm = itr.next();
|
||||
else break;
|
||||
}
|
||||
|
||||
markers.add(tm);
|
||||
|
||||
for (int i = 0; i < markers.size() - 1; i++) {
|
||||
MarkerDisplayEntry markerEntry = new MarkerDisplayEntry();
|
||||
|
||||
markerEntry.marker = markers.get(i);
|
||||
|
||||
// set string bounds
|
||||
markerEntry.markBounds = getFontMetrics(markFont)
|
||||
.getStringBounds(markers.get(i).getMark(), g);
|
||||
markerEntry.notesBounds = getFontMetrics(notesFont)
|
||||
.getStringBounds(markers.get(i).getNotes(), g);
|
||||
|
||||
// calculate upper bound
|
||||
if ((i == 0) && rangeStartDate.after(markerEntry.marker.getTimestamp())) {
|
||||
//if this is the first marker (before the start time) set the
|
||||
// Y coor to 0, top of display
|
||||
markerEntry.relY = 0;
|
||||
} else {
|
||||
// otherwise, calculate how far down (%-wise) the mark is
|
||||
markerEntry.relY = (float) (((double) (markerEntry.marker.getTimestamp().getTime()
|
||||
- rangeStartDate.getTime())) / (double) rangeDiff);
|
||||
}
|
||||
|
||||
// calculate lower bound
|
||||
if ((i == 0) && rangeStartDate.after(markerEntry.marker.getTimestamp()))
|
||||
// if this is the first marker (before the start time), set the
|
||||
// height to equal the top of the next marker
|
||||
markerEntry.relHeight =
|
||||
markers.get(i + 1).getTimestamp().getTime()
|
||||
- rangeStartDate.getTime();
|
||||
else if (i == markers.size() - 2)
|
||||
// if this is the last visible marker, set the height to extend
|
||||
// to the bottom of the display
|
||||
markerEntry.relHeight = rangeEndDate.getTime()
|
||||
- markerEntry.marker.getTimestamp().getTime();
|
||||
else
|
||||
// set the height to the difference between this marker and the
|
||||
// next.
|
||||
markerEntry.relHeight =
|
||||
markers.get(i + 1).getTimestamp().getTime()
|
||||
- markerEntry.marker.getTimestamp().getTime();
|
||||
markerEntry.relHeight /= rangeDiff;
|
||||
|
||||
markerEntries.add(markerEntry);
|
||||
}
|
||||
repaint();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintComponent(Graphics g) {
|
||||
removeAll();
|
||||
|
||||
if (markerEntries == null) updateMarkers(g);
|
||||
|
||||
Insets insets = this.getInsets();
|
||||
Rectangle bounds = this.getBounds();
|
||||
Rectangle canvasBounds = new Rectangle(insets.left, insets.top,
|
||||
bounds.width - insets.left - insets.right - 1,
|
||||
bounds.height - insets.top - insets.bottom - 1);
|
||||
double hourHeight = canvasBounds.getHeight() / 24.0;
|
||||
|
||||
Graphics2D g2d = (Graphics2D) g;
|
||||
Rectangle2D stringBounds = getFontMetrics(getFont()).getStringBounds("00:00 ", g);
|
||||
|
||||
// draw hour lines
|
||||
for (TimeLegendEntry legendEntry : timeLegendLocations) {
|
||||
g.drawLine(canvasBounds.x + (int) stringBounds.getWidth(),
|
||||
(int) (canvasBounds.y + (canvasBounds.height * legendEntry.relY)),
|
||||
canvasBounds.x + canvasBounds.width,
|
||||
(int) (canvasBounds.y + (canvasBounds.height * legendEntry.relY)));
|
||||
|
||||
g.drawString(legendEntry.label, canvasBounds.x + 2,
|
||||
(int) (canvasBounds.y + (canvasBounds.height * legendEntry.relY)
|
||||
+ (stringBounds.getHeight() / 2)));
|
||||
}
|
||||
|
||||
for (int i = 0; i < markerEntries.size(); i++) {
|
||||
|
||||
MarkerDisplayEntry curEntry = markerEntries.get(i);
|
||||
|
||||
Rectangle2D markBounds;
|
||||
Rectangle2D notesBounds;
|
||||
|
||||
boolean selected = curEntry.marker.equals(currentMarker);
|
||||
|
||||
// if i == 0, this is the default
|
||||
curEntry.bounds = new Rectangle();
|
||||
curEntry.bounds.y = 3;
|
||||
curEntry.bounds.x = canvasBounds.x + (int) stringBounds.getWidth() + 5;
|
||||
curEntry.bounds.height = 1;
|
||||
curEntry.bounds.width = canvasBounds.width - (int) stringBounds.getWidth() - 8;
|
||||
|
||||
double relTime;
|
||||
|
||||
// calculate upper bound
|
||||
curEntry.bounds.y = (int) Math.round(curEntry.relY
|
||||
* canvasBounds.getHeight());
|
||||
|
||||
if (i == 0) curEntry.bounds.y += 3;
|
||||
|
||||
// calculate lower bound
|
||||
curEntry.bounds.height = (int) Math.round(curEntry.relHeight
|
||||
* canvasBounds.getHeight());
|
||||
|
||||
if (i ==0) curEntry.bounds.height -= 6;
|
||||
else curEntry.bounds.height -= 3;
|
||||
|
||||
// draw box
|
||||
if (selected) g.setColor(selectedTrans);
|
||||
else g.setColor((i % 2 == 0 ? evenTrans : oddTrans));
|
||||
g.fillRect(curEntry.bounds.x, curEntry.bounds.y, curEntry.bounds.width, curEntry.bounds.height);
|
||||
|
||||
if (selected) g.setColor(selectedOpaque);
|
||||
else g2d.setColor((i % 2 == 0 ? evenOpaque : oddOpaque));
|
||||
g2d.setStroke(new BasicStroke(3f));
|
||||
g2d.drawRect(curEntry.bounds.x, curEntry.bounds.y, curEntry.bounds.width, curEntry.bounds.height);
|
||||
|
||||
// draw timestamp name
|
||||
markBounds = (Rectangle2D) curEntry.markBounds.clone();
|
||||
markBounds.setRect(curEntry.bounds.x + 3,
|
||||
curEntry.bounds.y + stringBounds.getHeight(),
|
||||
markBounds.getWidth(), markBounds.getHeight());
|
||||
|
||||
g.setColor(fontColor);
|
||||
g.setFont(markFont);
|
||||
g.drawString(curEntry.marker.getMark(),
|
||||
(int) markBounds.getX(), (int) markBounds.getY());
|
||||
|
||||
// draw notes
|
||||
notesBounds = (Rectangle2D) curEntry.notesBounds.clone();
|
||||
notesBounds.setRect(curEntry.bounds.x + 6,
|
||||
curEntry.bounds.y + stringBounds.getHeight() + markBounds.getHeight(),
|
||||
notesBounds.getWidth(), notesBounds.getHeight());
|
||||
|
||||
if (curEntry.bounds.contains(notesBounds)) {
|
||||
g.setFont(notesFont);
|
||||
g.drawString(curEntry.marker.getNotes(),
|
||||
(int) notesBounds.getX(), (int) notesBounds.getY());
|
||||
}
|
||||
}
|
||||
|
||||
g.setColor(Color.BLACK);
|
||||
g.drawRect(canvasBounds.x, canvasBounds.y, canvasBounds.width, canvasBounds.height);
|
||||
}
|
||||
|
||||
public void addChangeListener(ChangeListener cl) {
|
||||
changeListeners.add(cl);
|
||||
}
|
||||
|
||||
public boolean removeChangeListener(ChangeListener cl) {
|
||||
return changeListeners.remove(cl);
|
||||
}
|
||||
|
||||
private void fireChangeEvent() {
|
||||
for (ChangeListener cl : changeListeners)
|
||||
cl.stateChanged(new ChangeEvent(this));
|
||||
}
|
||||
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
if (e.getButton() == MouseEvent.BUTTON1) {
|
||||
Point topLeft = getLocationOnScreen();
|
||||
currentMarker = null;
|
||||
for (MarkerDisplayEntry markerEntry : markerEntries) {
|
||||
Rectangle absBounds = new Rectangle(markerEntry.bounds);
|
||||
absBounds.translate(topLeft.x, topLeft.y);
|
||||
|
||||
// should only match one entry
|
||||
if (absBounds.contains(e.getLocationOnScreen())) {
|
||||
currentMarker = markerEntry.marker;
|
||||
break;
|
||||
}
|
||||
}
|
||||
repaint();
|
||||
fireChangeEvent();
|
||||
} else if (e.getButton() == MouseEvent.BUTTON3) {
|
||||
setDay(rangeStartDate);
|
||||
}
|
||||
}
|
||||
|
||||
public void mousePressed(MouseEvent e) {
|
||||
lastMousePress = e.getPoint();
|
||||
}
|
||||
|
||||
public void mouseReleased(MouseEvent e) {
|
||||
Insets insets = this.getInsets();
|
||||
Rectangle bounds = this.getBounds();
|
||||
Rectangle canvasBounds = new Rectangle(insets.left, insets.top,
|
||||
bounds.width - insets.left - insets.right - 1,
|
||||
bounds.height - insets.top - insets.bottom - 1);
|
||||
|
||||
double rangeDiff = rangeEndDate.getTime() - rangeStartDate.getTime();
|
||||
double y1 = lastMousePress.getY();
|
||||
double y2 = e.getY();
|
||||
|
||||
if (Math.abs(y2 - y1) < 5) return;
|
||||
|
||||
// get time for y1
|
||||
long time1 = (long) Math.round((((y1 - canvasBounds.y)
|
||||
/ canvasBounds.height) * rangeDiff) + rangeStartDate.getTime());
|
||||
long time2 = (long) Math.round((((y2 - canvasBounds.y)
|
||||
/ canvasBounds.height) * rangeDiff) + rangeStartDate.getTime());
|
||||
|
||||
// left click, scroll
|
||||
if (e.getButton() == MouseEvent.BUTTON1) {
|
||||
long difference = time1 - time2;
|
||||
rangeStartDate.setTime(rangeStartDate.getTime() + difference);
|
||||
rangeEndDate.setTime(rangeEndDate.getTime() + difference);
|
||||
}
|
||||
// right click, zoom
|
||||
else if (e.getButton() == MouseEvent.BUTTON3) {
|
||||
if (time1 < time2) {
|
||||
rangeStartDate.setTime(time1);
|
||||
rangeEndDate.setTime(time2);
|
||||
} else {
|
||||
rangeStartDate.setTime(time2);
|
||||
rangeEndDate.setTime(time1);
|
||||
}
|
||||
}
|
||||
updateMarkers(getGraphics());
|
||||
}
|
||||
|
||||
public void mouseEntered(MouseEvent e) {
|
||||
}
|
||||
|
||||
public void mouseExited(MouseEvent e) {
|
||||
}
|
||||
|
||||
public void stateChanged(ChangeEvent ce) {
|
||||
updateMarkers(getGraphics());
|
||||
repaint();
|
||||
}
|
||||
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
iconLabel.text=
|
||||
#NOI18N
|
||||
iconLabel.icon=icons/appointment-new-32x32.png
|
||||
versionLabel.text=Version
|
||||
websiteLabel.text=www.jdbernard.com
|
@ -1,4 +0,0 @@
|
||||
# To change this template, choose Tools | Templates
|
||||
# and open the template in the editor.
|
||||
|
||||
mainPanel.toolTipText=Write notes for this event.
|
@ -1,42 +0,0 @@
|
||||
markTextField.text=
|
||||
previousWeek.Action.text=<<
|
||||
previousWeek.Action.shortDescription=Go back one week.
|
||||
dateLabel.text=date
|
||||
#NOI18N
|
||||
dateLabel.background=255, 255, 153
|
||||
prevWeekButton.text=jButton1
|
||||
previousWeek.Action.icon=icons/media-seek-backward.png
|
||||
previousWeek.Action.smallIcon=icons/media-seek-backward.png
|
||||
prevDayButton.text=jButton1
|
||||
previousDay.Action.smallIcon=icons/media-playback-reverse.png
|
||||
previousDay.Action.icon=icons/media-playback-reverse.png
|
||||
previousDay.Action.shortDescription=Go back one day.
|
||||
previousDay.Action.text=Previous Day
|
||||
currentDay.Action.text=Today
|
||||
currentDay.Action.shortDescription=Go to today's date.
|
||||
jButton2.text=jButton2
|
||||
nextDay.Action.smallIcon=icons/media-playback-start.png
|
||||
nextDay.Action.icon=icons/media-playback-start.png
|
||||
nextDay.Action.shortDescription=Go one day forward.
|
||||
nextDay.Action.text=Next Day
|
||||
nextWeekButton.text=jButton3
|
||||
nextWeek.Action.text=Next Week
|
||||
nextWeek.Action.smallIcon=icons/media-seek-forward.png
|
||||
nextWeek.Action.icon=icons/media-seek-forward.png
|
||||
nextWeek.Action.shortDescription=Go one week forward.
|
||||
newMarkerButton.text=jButton1
|
||||
newMarker.Action.smallIcon=icons/16-square-green-add.png
|
||||
newMarker.Action.icon=icons/16-square-green-add.png
|
||||
newMarker.Action.shortDescription=Create a new timestamp mark.
|
||||
newMarker.Action.text=New Marker
|
||||
deleteMarkerButton.text=jButton1
|
||||
deleteMarker.Action.text=Delete Marker
|
||||
deleteMarker.Action.shortDescription=Delete a timestamp mark.
|
||||
deleteMarker.Action.smallIcon=icons/16-square-red-delete.png
|
||||
deleteMarker.Action.icon=icons/16-square-red-delete.png
|
||||
saveMarkerChanges.text=jButton1
|
||||
saveMarkerChanges.Action.smallIcon=icons/document-save-16x16.png
|
||||
saveMarkerChanges.Action.icon=icons/document-save-16x16.png
|
||||
saveMarkerChanges.Action.shortDescription=Save timeline marker changes.
|
||||
saveMarkerChanges.Action.text=Save Changes
|
||||
timestampDateChooser.dateFormatString=MMM d, yyyy HH:mm
|
@ -1,11 +0,0 @@
|
||||
title = About: ${Application.title} ${Application.version}
|
||||
|
||||
closeAboutBox.Action.text = &Close
|
||||
|
||||
appDescLabel.text=<html>Application for tracking an individual's time usage.
|
||||
|
||||
versionLabel.text=Product Version\:
|
||||
|
||||
vendorLabel.text=Vendor\:
|
||||
|
||||
homepageLabel.text=Homepage\:
|
@ -1,17 +0,0 @@
|
||||
# Application global resources
|
||||
|
||||
Application.name = TimeStamper
|
||||
Application.title = TimeStamper
|
||||
Application.version = 1.7
|
||||
Application.vendor = Jonathan Bernard
|
||||
Application.homepage =
|
||||
Application.description = Simple application used to track activities throughout time.
|
||||
Application.vendorId = Jonathan Bernard
|
||||
Application.id = TimeStamper
|
||||
Application.lookAndFeel = system
|
||||
Application.icon=icons/appointment-new-32x32.png
|
||||
quit.Action.text=Exit
|
||||
quit.Action.accelerator=ctrl pressed Q
|
||||
quit.Action.smallIcon=icons/16-em-cross.png
|
||||
quit.Action.icon=icons/16-em-cross.png
|
||||
quit.Action.shortDescription=Exit the application
|
@ -1,62 +0,0 @@
|
||||
|
||||
currentTaskLabel.text=Current task started at
|
||||
exitButton.text=
|
||||
#NOI18N
|
||||
exitButton.icon=icons/16-em-cross.png
|
||||
exitButton.hover.icon=icons/16-em-cross-hover.png
|
||||
optionsButton.icon=icons/16-tool-a.png
|
||||
optionsButton.hover.icon=icons/16-tool-a-hover.png
|
||||
taskTextField.text=
|
||||
#NOI18N
|
||||
startTimeLabel.foreground=0, 102, 102
|
||||
startTimeLabel.text=12:00:00
|
||||
totalTimeNow.text=3day 2hr 50min 25sec
|
||||
#NOI18N
|
||||
totalTimeNow.foreground=0, 153, 0
|
||||
notesButton.text=jButton1
|
||||
editNotes.Action.smallIcon=icons/16-em-pencil.png
|
||||
editNotes.Action.icon=icons/16-em-pencil.png
|
||||
editNotes.Action.shortDescription=Edit notes for this task
|
||||
editNotes.Action.text=Show Notes...
|
||||
jButton1.text=
|
||||
showOptionsMenu.Action.text=Options menu
|
||||
showOptionsMenu.Action.shortDescription=Show the application's options menu.
|
||||
showOptionsMenu.Action.smallIcon=icons/16-tool-a.png
|
||||
showOptionsMenu.Action.icon=icons/16-tool-a.png
|
||||
saveTimelineMenuItem.text=Item
|
||||
saveTimeline.Action.text=Save Timeline...
|
||||
saveTimeline.Action.smallIcon=icons/document-save-16x16.png
|
||||
saveTimeline.Action.icon=icons/document-save-16x16.png
|
||||
saveTimeline.Action.shortDescription=Save all actions to a timeline file.
|
||||
saveTimelineAs.Action.smallIcon=icons/document-save-as-16x16.png
|
||||
saveTimelineAs.Action.icon=icons/document-save-as-16x16.png
|
||||
saveTimelineAs.Action.shortDescription=Save actions to a new timeline file.
|
||||
saveTimelineAs.Action.text=Save Timeline As...
|
||||
loadTimelineMenuItem.text=Item
|
||||
loadTimeline.Action.text=Load Timeline...
|
||||
loadTimeline.Action.shortDescription=Load a set of actions from a timeline file
|
||||
loadTimeline.Action.smallIcon=icons/document-open-16x16.png
|
||||
loadTimeline.Action.icon=icons/document-open-16x16.png
|
||||
currentTimeLabel.text=12:00:00
|
||||
#NOI18N
|
||||
currentTimeLabel.foreground=204, 0, 0
|
||||
exit.Action.text=Exit
|
||||
exit.Action.smallIcon=icons/16-em-cross.png
|
||||
exit.Action.shortDescription=Close the application.
|
||||
exit.Action.icon=icons/16-em-cross.png
|
||||
notesButton2.text=jToggleButton1
|
||||
#NOI18N
|
||||
optionsButton.rolloverIcon=icons/16-tool-a-hover.png
|
||||
#NOI18N
|
||||
exitButton.rolloverIcon=icons/16-em-cross-hover.png
|
||||
showNotesDialogCheckBoxMenuItem.text=CheckBox
|
||||
showPunchcardCheckBoxMenuItem.text=CheckBox
|
||||
showPunchcard.Action.shortDescription=View the timeline
|
||||
showPunchcard.Action.text=Show Timeline...
|
||||
showPunchcard.Action.smallIcon=icons/16-file-archive.png
|
||||
showPunchcard.Action.icon=icons/16-file-archive.png
|
||||
editNotes.Action.accelerator=ctrl pressed N
|
||||
showPunchcard.Action.accelerator=ctrl pressed T
|
||||
showAboutCheckBoxMenuItem.text=CheckBox
|
||||
showAboutDialog.Action.shortDescription=
|
||||
showAboutDialog.Action.text=About...
|
Before Width: | Height: | Size: 8.0 KiB |
Before Width: | Height: | Size: 357 B |
Before Width: | Height: | Size: 506 B |
Before Width: | Height: | Size: 469 B |
Before Width: | Height: | Size: 257 B |
Before Width: | Height: | Size: 293 B |
Before Width: | Height: | Size: 345 B |
Before Width: | Height: | Size: 321 B |
Before Width: | Height: | Size: 393 B |
Before Width: | Height: | Size: 275 B |
Before Width: | Height: | Size: 626 B |
Before Width: | Height: | Size: 746 B |
Before Width: | Height: | Size: 918 B |
Before Width: | Height: | Size: 537 B |
Before Width: | Height: | Size: 911 B |
Before Width: | Height: | Size: 866 B |
Before Width: | Height: | Size: 636 B |
Before Width: | Height: | Size: 660 B |
Before Width: | Height: | Size: 764 B |
Before Width: | Height: | Size: 782 B |
Before Width: | Height: | Size: 770 B |
Before Width: | Height: | Size: 771 B |