mirror of
https://github.com/robertvokac/time-calc.git
synced 2025-03-25 23:47:49 +01:00
Added several improvements
This commit is contained in:
parent
e7c765f47e
commit
e553ecb6a6
@ -44,8 +44,6 @@ If file overtime.txt does not exist, then the default overtime is 0:00.
|
|||||||
### .tc/test.txt
|
### .tc/test.txt
|
||||||
If file test.txt exists, then user is not asked for start time and overtime. Instead, the values in files starttime.txt and overtime.txt are used.
|
If file test.txt exists, then user is not asked for start time and overtime. Instead, the values in files starttime.txt and overtime.txt are used.
|
||||||
|
|
||||||
This file can be also used to define custom current time - for testing purposes.
|
|
||||||
|
|
||||||
### ./tc/timecalc.conf
|
### ./tc/timecalc.conf
|
||||||
|
|
||||||
Configuration is stored here.
|
Configuration is stored here.
|
||||||
|
@ -195,7 +195,9 @@ public class MainWindow extends TWindow {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
hideShowCheckBox.addItemListener(e ->
|
hideShowCheckBox.addItemListener(e ->
|
||||||
|
|
||||||
{
|
{
|
||||||
|
this.requestFocus();
|
||||||
});
|
});
|
||||||
exitButton.addActionListener(e
|
exitButton.addActionListener(e
|
||||||
-> {
|
-> {
|
||||||
@ -253,7 +255,7 @@ public class MainWindow extends TWindow {
|
|||||||
analogClock.secondProperty.bindTo( time.secondProperty);
|
analogClock.secondProperty.bindTo( time.secondProperty);
|
||||||
analogClock.millisecondProperty.bindTo(time.millisecondProperty);
|
analogClock.millisecondProperty.bindTo(time.millisecondProperty);
|
||||||
|
|
||||||
analogClock.dayOfWeekProperty.bindTo(time.dayOfWeek);
|
analogClock.dayOfWeekProperty.bindTo(time.dayOfWeekProperty);
|
||||||
|
|
||||||
analogClock.millisecondEnabledProperty
|
analogClock.millisecondEnabledProperty
|
||||||
.bindTo(timeCalcConfiguration.clockHandsMillisecondVisibleProperty);
|
.bindTo(timeCalcConfiguration.clockHandsMillisecondVisibleProperty);
|
||||||
|
@ -127,6 +127,17 @@ public class AnalogClock extends Widget {
|
|||||||
= new AnalogClock(new TimeHM("6:30"), new TimeHM("19:00"));
|
= new AnalogClock(new TimeHM("6:30"), new TimeHM("19:00"));
|
||||||
window.add(clock);
|
window.add(clock);
|
||||||
window.pack();
|
window.pack();
|
||||||
|
Time time = new Time();
|
||||||
|
time.allowCustomValuesProperty.setValue(true);
|
||||||
|
clock.dayProperty.bindTo(time.dayProperty);
|
||||||
|
clock.monthProperty.bindTo(time.monthProperty);
|
||||||
|
clock.yearProperty.bindTo(time.yearProperty);
|
||||||
|
clock.hourProperty.bindTo(time.hourProperty);
|
||||||
|
clock.minuteProperty.bindTo(time.minuteProperty);
|
||||||
|
clock.secondProperty.bindTo( time.secondProperty);
|
||||||
|
clock.millisecondProperty.bindTo(time.millisecondProperty);
|
||||||
|
clock.dayOfWeekProperty.bindTo(time.dayOfWeekProperty);
|
||||||
|
clock.visibilityProperty.setValue(Visibility.GRAY.name());
|
||||||
window.setVisible(true);
|
window.setVisible(true);
|
||||||
// window.addKeyListener(new KeyAdapter() {
|
// window.addKeyListener(new KeyAdapter() {
|
||||||
// // Key Pressed method
|
// // Key Pressed method
|
||||||
|
@ -38,7 +38,7 @@ public class Time extends Thread {
|
|||||||
= secondReadWriteProperty.asReadOnlyProperty();
|
= secondReadWriteProperty.asReadOnlyProperty();
|
||||||
public ReadOnlyProperty<Integer> millisecondProperty
|
public ReadOnlyProperty<Integer> millisecondProperty
|
||||||
= millisecondReadWriteProperty.asReadOnlyProperty();
|
= millisecondReadWriteProperty.asReadOnlyProperty();
|
||||||
public ReadOnlyProperty<Integer> dayOfWeek
|
public ReadOnlyProperty<Integer> dayOfWeekProperty
|
||||||
= dayOfWeekReadWriteProperty.asReadOnlyProperty();
|
= dayOfWeekReadWriteProperty.asReadOnlyProperty();
|
||||||
public final IntegerProperty yearCustomProperty
|
public final IntegerProperty yearCustomProperty
|
||||||
= new IntegerProperty("yearCustomProperty", Integer.MAX_VALUE);
|
= new IntegerProperty("yearCustomProperty", Integer.MAX_VALUE);
|
||||||
@ -111,7 +111,7 @@ public class Time extends Thread {
|
|||||||
+ minuteProperty.getValue() + " "
|
+ minuteProperty.getValue() + " "
|
||||||
+ secondProperty.getValue() + " "
|
+ secondProperty.getValue() + " "
|
||||||
+ millisecondProperty.getValue() + " "
|
+ millisecondProperty.getValue() + " "
|
||||||
+ dayOfWeek.getValue() + " "
|
+ dayOfWeekProperty.getValue() + " "
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
private int returnCustomValueIfNeeded(Calendar cal, int timeUnit,
|
private int returnCustomValueIfNeeded(Calendar cal, int timeUnit,
|
||||||
|
@ -44,8 +44,6 @@ If file overtime.txt does not exist, then the default overtime is 0:00.
|
|||||||
### .tc/test.txt
|
### .tc/test.txt
|
||||||
If file test.txt exists, then user is not asked for start time and overtime. Instead, the values in files starttime.txt and overtime.txt are used.
|
If file test.txt exists, then user is not asked for start time and overtime. Instead, the values in files starttime.txt and overtime.txt are used.
|
||||||
|
|
||||||
This file can be also used to define custom current time - for testing purposes.
|
|
||||||
|
|
||||||
### ./tc/timecalc.conf
|
### ./tc/timecalc.conf
|
||||||
|
|
||||||
Configuration is stored here.
|
Configuration is stored here.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user