mirror of
https://github.com/robertvokac/time-calc.git
synced 2025-03-25 07:27:49 +01:00
Added new improvements
This commit is contained in:
parent
05accee591
commit
43324c8f03
@ -38,6 +38,8 @@ import java.util.Date;
|
|||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import static org.nanoboot.utils.timecalc.utils.FileConstants.FOCUS_TXT;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author pc00289
|
* @author pc00289
|
||||||
* @since 08.02.2024
|
* @since 08.02.2024
|
||||||
@ -73,8 +75,9 @@ public class TimeCalcWindow {
|
|||||||
this.overTime = (overTimeIn == null || overTimeIn.isEmpty()) ?
|
this.overTime = (overTimeIn == null || overTimeIn.isEmpty()) ?
|
||||||
Constants.DEFAULT_OVERTIME : overTimeIn;
|
Constants.DEFAULT_OVERTIME : overTimeIn;
|
||||||
|
|
||||||
this.startHour = Integer.valueOf(startTime.split(":")[0]);
|
String[] startTimeAsArray = startTime.split(":");
|
||||||
this.startMinute = Integer.valueOf(startTime.split(":")[1]);
|
this.startHour = Integer.valueOf(startTimeAsArray[0]);
|
||||||
|
this.startMinute = Integer.valueOf(startTimeAsArray[1]);
|
||||||
|
|
||||||
boolean overtimeIsNegative = overTime.startsWith("-");
|
boolean overtimeIsNegative = overTime.startsWith("-");
|
||||||
if(overtimeIsNegative) {overTime = overTime.replace("-","");}
|
if(overtimeIsNegative) {overTime = overTime.replace("-","");}
|
||||||
@ -339,7 +342,6 @@ public class TimeCalcWindow {
|
|||||||
|
|
||||||
StringBuilder sb = null;
|
StringBuilder sb = null;
|
||||||
|
|
||||||
File focusTxt = new File("focus.txt");
|
|
||||||
while (true) {
|
while (true) {
|
||||||
if (stopBeforeEnd) {
|
if (stopBeforeEnd) {
|
||||||
window.setVisible(false);
|
window.setVisible(false);
|
||||||
@ -348,9 +350,9 @@ public class TimeCalcWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(Math.random() > 0.9) {
|
if(Math.random() > 0.9) {
|
||||||
if(focusTxt.exists()) {
|
if(FOCUS_TXT.exists()) {
|
||||||
window.requestFocus();
|
window.requestFocus();
|
||||||
focusTxt.delete();
|
FOCUS_TXT.delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(Utils.highlighted.get()) {
|
if(Utils.highlighted.get()) {
|
||||||
|
@ -13,4 +13,5 @@ public class FileConstants {
|
|||||||
public static final File STARTTIME_TXT = new File("starttime.txt");
|
public static final File STARTTIME_TXT = new File("starttime.txt");
|
||||||
public static final File OVERTIME_TXT = new File("overtime.txt");
|
public static final File OVERTIME_TXT = new File("overtime.txt");
|
||||||
public static final File TEST_TXT = new File("test.txt");
|
public static final File TEST_TXT = new File("test.txt");
|
||||||
|
public static final File FOCUS_TXT = new File("focus.txt");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user