Skip to content

Commit d415d64

Browse files
author
Jens Deters
committedMar 3, 2017
initial check-in
0 parents  commit d415d64

21 files changed

+1768
-0
lines changed
 

‎.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/target/
2+
/build/
3+
/nbproject/
4+
.DS_STORE
5+
.gradle
6+
.nb-gradle

‎README.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#TimeboxFX
2+
3+
**A JavaFX based timer for timeboxed meetings.**
4+
5+
When I started with JavaFX in 2012 TimeboxFX was one of my first JavaFX apps.
6+
Recently in a meeting I wanted to use it as a gimmick and I found out that TimeboxFX needed some love... So here is the new version.
7+
8+
## Usage
9+
10+
Just use your mouse to increase/decrase the wanted timer value.
11+
Use the button to ```start/stop/pause``` the timer.
12+
13+
**Alternatively you can use your keyboard:**
14+
15+
|Key | does |
16+
|---|---|
17+
|```CURSOR_LEFT``` or ```CURSOR_UP```|increase the start time|
18+
|```CURSOR_RIGHT``` or ```CURSOR_DOWN```|decrease the start time|
19+
|```SPACE```|start the timer|
20+
|```ÈNTER``` or ```ÈSC```|reset the timer|
21+

‎build.gradle

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
apply plugin: 'java'
2+
apply plugin: 'application'
3+
4+
sourceCompatibility = '1.8'
5+
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
6+
7+
repositories {
8+
mavenCentral()
9+
jcenter()
10+
}
11+
12+
13+
version '2.0.0'
14+
15+
mainClassName = 'de.jensd.fx.timebox.Main'
16+
17+
if (!hasProperty('mainClass')) {
18+
ext.mainClass = 'de.jensd.fx.timebox.Main'
19+
}
20+
21+
task fatJar(type: Jar) {
22+
baseName = project.name
23+
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
24+
with jar
25+
manifest {
26+
attributes 'Implementation-Title': 'Gradle Quickstart', 'Implementation-Version': '1.0'
27+
attributes 'Main-Class': 'de.jensd.fx.timebox.Main'
28+
}
29+
}
30+
31+
task execute(type:JavaExec) {
32+
main = mainClass
33+
classpath = sourceSets.main.runtimeClasspath
34+
}
35+
36+
dependencies {
37+
compile 'de.jensd:fontawesomefx-materialdesignfont:1.7.22-4'
38+
testCompile group: 'junit', name: 'junit', version: '4.10'
39+
}
40+
41+
42+
task wrapper(type: Wrapper) {
43+
gradleVersion = '3.4'
44+
}

‎gradle/wrapper/gradle-wrapper.jar

53 KB
Binary file not shown.
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Thu Mar 02 17:42:52 CET 2017
2+
distributionBase=GRADLE_USER_HOME
3+
distributionPath=wrapper/dists
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-3.4-bin.zip

‎gradlew

+172
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
#!/usr/bin/env sh
2+
3+
##############################################################################
4+
##
5+
## Gradle start up script for UN*X
6+
##
7+
##############################################################################
8+
9+
# Attempt to set APP_HOME
10+
# Resolve links: $0 may be a link
11+
PRG="$0"
12+
# Need this for relative symlinks.
13+
while [ -h "$PRG" ] ; do
14+
ls=`ls -ld "$PRG"`
15+
link=`expr "$ls" : '.*-> \(.*\)$'`
16+
if expr "$link" : '/.*' > /dev/null; then
17+
PRG="$link"
18+
else
19+
PRG=`dirname "$PRG"`"/$link"
20+
fi
21+
done
22+
SAVED="`pwd`"
23+
cd "`dirname \"$PRG\"`/" >/dev/null
24+
APP_HOME="`pwd -P`"
25+
cd "$SAVED" >/dev/null
26+
27+
APP_NAME="Gradle"
28+
APP_BASE_NAME=`basename "$0"`
29+
30+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31+
DEFAULT_JVM_OPTS=""
32+
33+
# Use the maximum available, or set MAX_FD != -1 to use that value.
34+
MAX_FD="maximum"
35+
36+
warn ( ) {
37+
echo "$*"
38+
}
39+
40+
die ( ) {
41+
echo
42+
echo "$*"
43+
echo
44+
exit 1
45+
}
46+
47+
# OS specific support (must be 'true' or 'false').
48+
cygwin=false
49+
msys=false
50+
darwin=false
51+
nonstop=false
52+
case "`uname`" in
53+
CYGWIN* )
54+
cygwin=true
55+
;;
56+
Darwin* )
57+
darwin=true
58+
;;
59+
MINGW* )
60+
msys=true
61+
;;
62+
NONSTOP* )
63+
nonstop=true
64+
;;
65+
esac
66+
67+
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68+
69+
# Determine the Java command to use to start the JVM.
70+
if [ -n "$JAVA_HOME" ] ; then
71+
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72+
# IBM's JDK on AIX uses strange locations for the executables
73+
JAVACMD="$JAVA_HOME/jre/sh/java"
74+
else
75+
JAVACMD="$JAVA_HOME/bin/java"
76+
fi
77+
if [ ! -x "$JAVACMD" ] ; then
78+
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79+
80+
Please set the JAVA_HOME variable in your environment to match the
81+
location of your Java installation."
82+
fi
83+
else
84+
JAVACMD="java"
85+
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86+
87+
Please set the JAVA_HOME variable in your environment to match the
88+
location of your Java installation."
89+
fi
90+
91+
# Increase the maximum file descriptors if we can.
92+
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93+
MAX_FD_LIMIT=`ulimit -H -n`
94+
if [ $? -eq 0 ] ; then
95+
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96+
MAX_FD="$MAX_FD_LIMIT"
97+
fi
98+
ulimit -n $MAX_FD
99+
if [ $? -ne 0 ] ; then
100+
warn "Could not set maximum file descriptor limit: $MAX_FD"
101+
fi
102+
else
103+
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104+
fi
105+
fi
106+
107+
# For Darwin, add options to specify how the application appears in the dock
108+
if $darwin; then
109+
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110+
fi
111+
112+
# For Cygwin, switch paths to Windows format before running java
113+
if $cygwin ; then
114+
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115+
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116+
JAVACMD=`cygpath --unix "$JAVACMD"`
117+
118+
# We build the pattern for arguments to be converted via cygpath
119+
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120+
SEP=""
121+
for dir in $ROOTDIRSRAW ; do
122+
ROOTDIRS="$ROOTDIRS$SEP$dir"
123+
SEP="|"
124+
done
125+
OURCYGPATTERN="(^($ROOTDIRS))"
126+
# Add a user-defined pattern to the cygpath arguments
127+
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128+
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129+
fi
130+
# Now convert the arguments - kludge to limit ourselves to /bin/sh
131+
i=0
132+
for arg in "$@" ; do
133+
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134+
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135+
136+
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137+
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138+
else
139+
eval `echo args$i`="\"$arg\""
140+
fi
141+
i=$((i+1))
142+
done
143+
case $i in
144+
(0) set -- ;;
145+
(1) set -- "$args0" ;;
146+
(2) set -- "$args0" "$args1" ;;
147+
(3) set -- "$args0" "$args1" "$args2" ;;
148+
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149+
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150+
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151+
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152+
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153+
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154+
esac
155+
fi
156+
157+
# Escape application args
158+
save ( ) {
159+
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160+
echo " "
161+
}
162+
APP_ARGS=$(save "$@")
163+
164+
# Collect all arguments for the java command, following the shell quoting and substitution rules
165+
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166+
167+
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168+
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169+
cd "$(dirname "$0")"
170+
fi
171+
172+
exec "$JAVACMD" "$@"

‎gradlew.bat

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
@if "%DEBUG%" == "" @echo off
2+
@rem ##########################################################################
3+
@rem
4+
@rem Gradle startup script for Windows
5+
@rem
6+
@rem ##########################################################################
7+
8+
@rem Set local scope for the variables with windows NT shell
9+
if "%OS%"=="Windows_NT" setlocal
10+
11+
set DIRNAME=%~dp0
12+
if "%DIRNAME%" == "" set DIRNAME=.
13+
set APP_BASE_NAME=%~n0
14+
set APP_HOME=%DIRNAME%
15+
16+
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17+
set DEFAULT_JVM_OPTS=
18+
19+
@rem Find java.exe
20+
if defined JAVA_HOME goto findJavaFromJavaHome
21+
22+
set JAVA_EXE=java.exe
23+
%JAVA_EXE% -version >NUL 2>&1
24+
if "%ERRORLEVEL%" == "0" goto init
25+
26+
echo.
27+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28+
echo.
29+
echo Please set the JAVA_HOME variable in your environment to match the
30+
echo location of your Java installation.
31+
32+
goto fail
33+
34+
:findJavaFromJavaHome
35+
set JAVA_HOME=%JAVA_HOME:"=%
36+
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37+
38+
if exist "%JAVA_EXE%" goto init
39+
40+
echo.
41+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42+
echo.
43+
echo Please set the JAVA_HOME variable in your environment to match the
44+
echo location of your Java installation.
45+
46+
goto fail
47+
48+
:init
49+
@rem Get command-line arguments, handling Windows variants
50+
51+
if not "%OS%" == "Windows_NT" goto win9xME_args
52+
53+
:win9xME_args
54+
@rem Slurp the command line arguments.
55+
set CMD_LINE_ARGS=
56+
set _SKIP=2
57+
58+
:win9xME_args_slurp
59+
if "x%~1" == "x" goto execute
60+
61+
set CMD_LINE_ARGS=%*
62+
63+
:execute
64+
@rem Setup the command line
65+
66+
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67+
68+
@rem Execute Gradle
69+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70+
71+
:end
72+
@rem End local scope for the variables with windows NT shell
73+
if "%ERRORLEVEL%"=="0" goto mainEnd
74+
75+
:fail
76+
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77+
rem the _cmd.exe /c_ return code!
78+
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79+
exit /b 1
80+
81+
:mainEnd
82+
if "%OS%"=="Windows_NT" endlocal
83+
84+
:omega

‎images/TimeboxFX-2.0.0.png

229 KB
Loading

‎images/TimeboxFX.graffle

2.16 KB
Binary file not shown.

‎images/TimeboxFX.png

97.3 KB
Loading

‎installer.install4j

+411
Large diffs are not rendered by default.

‎settings.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rootProject.name = 'TimeboxFX'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package de.jensd.fx.timebox;
2+
3+
import javafx.application.Application;
4+
import javafx.scene.Scene;
5+
import javafx.scene.image.Image;
6+
import javafx.scene.paint.Color;
7+
import javafx.stage.Stage;
8+
import javafx.stage.WindowEvent;
9+
10+
/**
11+
*
12+
* @author Jens Deters
13+
*/
14+
public class Main extends Application {
15+
16+
private TimerView mainPane;
17+
18+
@Override
19+
public void start(final Stage primaryStage) throws Exception {
20+
mainPane = new TimerView();
21+
22+
String title = mainPane.getAppProperties().getProperty("app.name") + " - " + mainPane.getAppProperties().getProperty("app.version");
23+
Scene scene = new Scene(mainPane, 500, 500);
24+
scene.getStylesheets().add(mainPane.getAppProperties().getProperty("app.css"));
25+
scene.setFill(Color.TRANSPARENT);
26+
primaryStage.setScene(scene);
27+
primaryStage.getIcons().add(new Image(getClass().getResourceAsStream(mainPane.getAppProperties().getProperty("app.icon"))));
28+
primaryStage.setTitle(title);
29+
primaryStage.setFullScreen(false);
30+
primaryStage.setOnCloseRequest((WindowEvent event) -> {
31+
event.consume();
32+
mainPane.onExitApp();
33+
});
34+
primaryStage.show();
35+
}
36+
37+
public static void main(String[] args) {
38+
launch(args);
39+
}
40+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
package de.jensd.fx.timebox;
2+
3+
import javafx.animation.Interpolator;
4+
import javafx.animation.KeyFrame;
5+
import javafx.animation.KeyValue;
6+
import javafx.animation.Timeline;
7+
import javafx.event.ActionEvent;
8+
import javafx.event.Event;
9+
import javafx.scene.Node;
10+
import javafx.scene.layout.StackPane;
11+
import javafx.util.Duration;
12+
13+
/**
14+
*
15+
* @author Jens Deters
16+
*/
17+
public class ModalDimmer extends StackPane {
18+
19+
private final Duration DURATION_HIDE = Duration.millis(700);
20+
private final Duration DURATION_SHOW = Duration.millis(350);
21+
22+
public ModalDimmer() {
23+
init();
24+
}
25+
26+
private void init() {
27+
setId("modal-dimmer");
28+
setOnMouseClicked(Event::consume);
29+
setVisible(false);
30+
}
31+
32+
public void hideModalMessage() {
33+
setCache(true);
34+
Timeline timeline = new Timeline(
35+
new KeyFrame(DURATION_HIDE, (ActionEvent t) -> {
36+
setCache(false);
37+
setVisible(false);
38+
getChildren().
39+
clear();
40+
},
41+
new KeyValue(opacityProperty(), 0, Interpolator.EASE_BOTH)));
42+
timeline.play();
43+
}
44+
45+
public void showModalMessage(Node message) {
46+
getChildren().clear();
47+
getChildren().add(message);
48+
setOpacity(0);
49+
setCache(true);
50+
setVisible(true);
51+
Timeline timeline = new Timeline(new KeyFrame(DURATION_SHOW, (ActionEvent t) -> {
52+
setCache(false);
53+
}, new KeyValue(opacityProperty(), 1, Interpolator.EASE_BOTH)));
54+
timeline.play();
55+
}
56+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,220 @@
1+
package de.jensd.fx.timebox;
2+
3+
import java.util.Calendar;
4+
import java.util.GregorianCalendar;
5+
import javafx.animation.KeyFrame;
6+
import javafx.animation.Timeline;
7+
import javafx.beans.property.BooleanProperty;
8+
import javafx.beans.property.IntegerProperty;
9+
import javafx.beans.property.LongProperty;
10+
import javafx.beans.property.ObjectProperty;
11+
import javafx.beans.property.SimpleBooleanProperty;
12+
import javafx.beans.property.SimpleIntegerProperty;
13+
import javafx.beans.property.SimpleLongProperty;
14+
import javafx.beans.property.SimpleObjectProperty;
15+
import javafx.beans.value.ObservableValue;
16+
import javafx.event.ActionEvent;
17+
import javafx.event.Event;
18+
import javafx.event.EventHandler;
19+
import javafx.util.Duration;
20+
21+
/**
22+
*
23+
* @author Jens Deters
24+
*/
25+
public class TimerClockWork {
26+
27+
private IntegerProperty minutes;
28+
private IntegerProperty seconds;
29+
private IntegerProperty milliSeconds;
30+
private LongProperty milliSecondsLeft;
31+
private BooleanProperty finished;
32+
private BooleanProperty running;
33+
private IntegerProperty startTime;
34+
private Calendar calendar;
35+
private Timeline timeline;
36+
private BooleanProperty overdueRunning;
37+
private BooleanProperty overdue;
38+
private Timeline overdueTimeline;
39+
private ObjectProperty<Mode> mode;
40+
41+
public enum Mode {
42+
43+
NORMAL, OVERDUE;
44+
}
45+
46+
public TimerClockWork() {
47+
init();
48+
}
49+
50+
private void init() {
51+
minutes = new SimpleIntegerProperty(0);
52+
seconds = new SimpleIntegerProperty(0);
53+
milliSeconds = new SimpleIntegerProperty(0);
54+
milliSecondsLeft = new SimpleLongProperty(0);
55+
finished = new SimpleBooleanProperty(Boolean.FALSE);
56+
running = new SimpleBooleanProperty(Boolean.FALSE);
57+
overdue = new SimpleBooleanProperty(Boolean.TRUE);
58+
overdueRunning = new SimpleBooleanProperty(Boolean.FALSE);
59+
running = new SimpleBooleanProperty(Boolean.FALSE);
60+
startTime = new SimpleIntegerProperty(0);
61+
calendar = new GregorianCalendar();
62+
mode = new SimpleObjectProperty<>();
63+
mode.set(Mode.NORMAL);
64+
//attachDebugOutput();
65+
}
66+
67+
public BooleanProperty overdueOnProperty() {
68+
return overdue;
69+
}
70+
71+
public BooleanProperty overdueRunningProperty() {
72+
return overdueRunning;
73+
}
74+
75+
public ObjectProperty<Mode> modeProperty() {
76+
return mode;
77+
}
78+
79+
public BooleanProperty runningProperty() {
80+
return running;
81+
}
82+
public boolean isRunning(){
83+
return runningProperty().get();
84+
}
85+
86+
public BooleanProperty finishedProperty() {
87+
return finished;
88+
}
89+
90+
public IntegerProperty minutesProperty() {
91+
return minutes;
92+
}
93+
94+
public IntegerProperty secondsProperty() {
95+
return seconds;
96+
}
97+
98+
public IntegerProperty milliSecondsProperty() {
99+
return milliSeconds;
100+
}
101+
102+
public LongProperty milliSecondsLeftProperty() {
103+
return milliSecondsLeft;
104+
}
105+
106+
public IntegerProperty startTimeProperty() {
107+
return startTime;
108+
}
109+
110+
public void setStartTimeSeconds(int seconds) {
111+
startTime.set(seconds * 1000);
112+
}
113+
114+
public void setStartTimeMillis(int milliseconds) {
115+
startTime.set(milliseconds);
116+
}
117+
118+
public void setStartTimeMinutes(int minutes) {
119+
startTime.set(minutes * 60000);
120+
}
121+
122+
public void start() {
123+
mode.set(Mode.NORMAL);
124+
overdueRunning.set(Boolean.FALSE);
125+
calendar.setTimeInMillis(startTime.get());
126+
milliSecondsLeft.set(calendar.getTimeInMillis());
127+
milliSeconds.set(calendar.get(Calendar.MILLISECOND));
128+
seconds.set(calendar.get(Calendar.SECOND));
129+
minutes.set(calendar.get(Calendar.MINUTE));
130+
finished.set(Boolean.FALSE);
131+
running.set(Boolean.TRUE);
132+
timeline = new Timeline(new KeyFrame(Duration.millis(1), tick()));
133+
timeline.setCycleCount(startTime.get());
134+
timeline.setOnFinished(finished());
135+
continuePlay();
136+
}
137+
138+
public void continuePlay() {
139+
if (timeline != null) {
140+
timeline.play();
141+
}
142+
143+
}
144+
145+
public void pause() {
146+
if (timeline != null) {
147+
timeline.pause();
148+
}
149+
}
150+
151+
public void stop() {
152+
if (timeline != null) {
153+
reset();
154+
}
155+
}
156+
157+
public void reset() {
158+
if (timeline != null) {
159+
timeline.stop();
160+
}
161+
if (overdueTimeline != null) {
162+
overdueTimeline.stop();
163+
}
164+
milliSeconds.set(0);
165+
minutes.set(0);
166+
seconds.set(0);
167+
finished.set(Boolean.FALSE);
168+
running.set(Boolean.FALSE);
169+
overdueRunning.set(Boolean.FALSE);
170+
mode.set(Mode.NORMAL);
171+
}
172+
173+
private EventHandler finished() {
174+
return (EventHandler<ActionEvent>) (ActionEvent t) -> {
175+
finished.set(Boolean.TRUE);
176+
running.set(Boolean.FALSE);
177+
if (overdue.get()) {
178+
startOverdue();
179+
}
180+
};
181+
}
182+
183+
private void startOverdue() {
184+
mode.set(Mode.OVERDUE);
185+
calendar.setTimeInMillis(0);
186+
seconds.set(calendar.get(Calendar.SECOND));
187+
minutes.set(calendar.get(Calendar.MINUTE));
188+
finished.set(Boolean.FALSE);
189+
running.set(Boolean.TRUE);
190+
overdueRunning.set(Boolean.TRUE);
191+
overdueTimeline = new Timeline(new KeyFrame(Duration.millis(1), tick()));
192+
overdueTimeline.setCycleCount(600000);
193+
overdueTimeline.play();
194+
}
195+
196+
private EventHandler tick() {
197+
return (EventHandler) (Event event) -> {
198+
calendar.setTimeInMillis(calendar.getTimeInMillis() - 1);
199+
milliSecondsLeft.set(calendar.getTimeInMillis());
200+
milliSeconds.set(calendar.get(Calendar.MILLISECOND));
201+
seconds.set(calendar.get(Calendar.SECOND));
202+
minutes.set(calendar.get(Calendar.MINUTE));
203+
};
204+
}
205+
206+
private void attachDebugOutput() {
207+
startTime.addListener((ObservableValue<? extends Number> ov, Number t, Number t1) -> {
208+
});
209+
milliSeconds.addListener((ObservableValue<? extends Number> ov, Number t, Number t1) -> {
210+
String state = "normal";
211+
if (overdueRunning.get()) {
212+
state = "overdue";
213+
}
214+
});
215+
overdue.addListener((ObservableValue<? extends Boolean> ov, Boolean t, Boolean t1) -> {
216+
System.out.
217+
println("Overdue ON: " + t1);
218+
});
219+
}
220+
}

‎src/main/java/de/jensd/fx/timebox/TimerView.java

+573
Large diffs are not rendered by default.
Binary file not shown.

‎src/main/resources/audio/tick_low.wav

36.2 KB
Binary file not shown.

‎src/main/resources/images/icon.png

97.3 KB
Loading

‎src/main/resources/styles/timebox.css

+126
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
/*
2+
Document : timerdisplay
3+
Created on : 16.10.2012, 09:44:50
4+
Author : Jens Deters
5+
Description:
6+
Purpose of the stylesheet follows.
7+
*/
8+
9+
.root {
10+
11+
-fx-base: rgb(46,52,64);
12+
-fx-color: rgb(46,52,64);
13+
-fx-bgcolor: rgb(52,60,73);
14+
-fx-background: rgb(52,60,73);
15+
-fx-text-base-color: rgb(216,222,233);
16+
-fx-text-fill: -fx-text-base-color;
17+
-fx-text-color-alt: rgb(113,119,130);
18+
-fx-light-text-color: -fx-text-base-color;
19+
-icons-color: -fx-text-base-color;
20+
}
21+
22+
.glyph-icon{
23+
-fx-text-fill: -icons-color;
24+
-fx-fill: -icons-color;
25+
-glyph-size: 36px;
26+
}
27+
28+
.center-slice-arc{
29+
-fx-fill: rgba(46,52,64,0.95);
30+
}
31+
32+
.time-slice-arc-green{
33+
-fx-fill: radial-gradient(center 50% 50%, radius 100%, #b8ee36, #80c800);
34+
-fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.4) , 5, 0.0 , 0 , 1 );
35+
}
36+
37+
.time-slice-arc-overdue{
38+
-fx-fill: radial-gradient(center 50% 50%, radius 100%,#ff5400, #be1d00);
39+
-fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.6) , 5, 0.0 , 0 , 1 );
40+
}
41+
42+
.background-slice-arc{
43+
-fx-fill: radial-gradient(center 50% 50%, radius 100%,derive(-fx-color, -10%),derive(-fx-color, -30.0%));
44+
}
45+
46+
.timer-background-slice-arc
47+
{
48+
-fx-fill: linear-gradient( to bottom, derive(-fx-color, 100%) 0%, derive(-fx-color, 60.0%) 100%);
49+
-fx-effect: innershadow( three-pass-box , rgba(0,0,0,0.7) , 12, 0.0 , 0 , 0 );
50+
}
51+
52+
.tick{
53+
-fx-stroke: -fx-text-base-color;
54+
-fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.6) , 4, 0.0 , 0 , 1 );
55+
}
56+
57+
.counter-text-normal{
58+
-fx-font: bold 40px "Monospace" ;
59+
-fx-padding: 10;
60+
-fx-fill: radial-gradient(center 50% 50%, radius 100%, #b8ee36, #80c800);
61+
-fx-background-color: #CCFF99;
62+
-fx-effect: innershadow( three-pass-box , rgba(0,0,0,0.7) , 3, 0.0 , 1 , 1 );
63+
}
64+
65+
.counter-text-overdue{
66+
-fx-font: bold 40px "Monospace" ;
67+
-fx-padding: 10;
68+
-fx-fill: radial-gradient(center 50% 50%, radius 100%,#ff5400,#be1d00);
69+
-fx-background-color: #CCFF99;
70+
-fx-effect: innershadow( three-pass-box , rgba(0,0,0,0.7) , 3, 0.0 , 1 , 1 );
71+
}
72+
73+
.title-text{
74+
-fx-font-size: 14px;
75+
-fx-fill: -fx-text-color-alt;
76+
-fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.8) , 2, 0.0 , 0 , 1 );
77+
}
78+
79+
.copyright-text{
80+
-fx-font-size: 10px;
81+
-fx-fill: -fx-text-color-alt;
82+
-fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.8) , 2, 0.0 , 0 , 1 );
83+
}
84+
.version-text{
85+
-fx-font-size: 10px;
86+
-fx-fill: -fx-text-color-alt;
87+
-fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.8) , 2, 0.0 , 0 , 1 );
88+
}
89+
90+
.about-appname-text{
91+
-fx-text-fill: -fx-text-base-color;
92+
-fx-font: bold 40px "Monospace" ;
93+
-fx-padding: 10;
94+
-fx-effect: innershadow( three-pass-box , rgba(0,0,0,0.7) , 3, 0.0 , 1 , 1 );
95+
}
96+
97+
.navigation-button{
98+
-fx-padding: 0;
99+
-fx-background-color: null;
100+
-fx-background-insets: 0;
101+
}
102+
103+
.navigation-button:disabled{
104+
-icons-color: -fx-text-color-alt;
105+
}
106+
107+
.dark-label{
108+
-fx-text-fill: -fx-text-color-alt;
109+
}
110+
111+
.close-button {
112+
-fx-font-weight: bold;
113+
-fx-text-fill: white;
114+
}
115+
116+
#modal-dimmer{
117+
-fx-background-color: rgba(46,52,64,0.7);
118+
}
119+
120+
.modal-dimmer-dialog{
121+
-fx-background-color: black, white, -fx-background;
122+
-fx-background-insets: 0, 1, 2;
123+
-fx-background-radius: 15, 14, 13;
124+
-fx-padding: 15;
125+
-fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.8) , 20, 0.0 , 0 , 0 );
126+
}

‎src/main/resources/timebox.properties

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
app.name=TimeboxFX
2+
app.icon=/images/icon.png
3+
app.copyright=\u00A9 2012-2017 Jens Deters
4+
app.version=2.0.0
5+
app.css=/styles/timebox.css
6+
app.audio.on=true
7+
clip.source.click=/audio/tick_low.wav
8+
clip.source.alarm=/audio/Store_Door_Chime-Mike_Koenig-570742973.mp3

0 commit comments

Comments
 (0)
Please sign in to comment.