Compare commits
2 Commits
7763284ae3
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 9f7ae95436 | |||
| b9072fc8e8 |
@@ -23,9 +23,9 @@ public class PointEngine {
|
||||
DATE,
|
||||
}
|
||||
|
||||
static final Pattern DOW_PATTERN = Pattern.compile("dow=(sun|mon|tue|wed|thu|fri|sat) (\\d+\\.\\d+)", Pattern.CASE_INSENSITIVE);
|
||||
static final Pattern MONTH_PATTERN = Pattern.compile("m=(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec) (\\d+\\.\\d+)", Pattern.CASE_INSENSITIVE);
|
||||
static final Pattern DATE_PATTERN = Pattern.compile("(\\d{4}-\\d{2}-\\d{2}) (\\d+\\.\\d+)", Pattern.CASE_INSENSITIVE);
|
||||
static final Pattern DOW_PATTERN = Pattern.compile("dow=(sun|mon|tue|wed|thu|fri|sat)\\s+(\\d+\\.\\d+)", Pattern.CASE_INSENSITIVE);
|
||||
static final Pattern MONTH_PATTERN = Pattern.compile("m=(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\\s+(\\d+\\.\\d+)", Pattern.CASE_INSENSITIVE);
|
||||
static final Pattern DATE_PATTERN = Pattern.compile("(\\d{4}-\\d{2}-\\d{2})\\s+(\\d+\\.\\d+)", Pattern.CASE_INSENSITIVE);
|
||||
|
||||
private RuleType type;
|
||||
private DayOfWeek dow;
|
||||
@@ -77,7 +77,7 @@ public class PointEngine {
|
||||
}
|
||||
|
||||
public void importPointsFile(File pointsFile) {
|
||||
Pattern defaultPattern = Pattern.compile("default (\\d+\\.\\d+)");
|
||||
Pattern defaultPattern = Pattern.compile("default\\s+(\\d+\\.\\d+)", Pattern.CASE_INSENSITIVE);
|
||||
|
||||
try (BufferedReader br = new BufferedReader(new FileReader(pointsFile))) {
|
||||
String line;
|
||||
|
||||
@@ -3,9 +3,9 @@ package net.themusicinnoise.vaccalc;
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.*;
|
||||
import java.time.YearMonth;
|
||||
import java.util.Properties;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class VacCalc extends JFrame {
|
||||
@@ -72,10 +72,17 @@ public class VacCalc extends JFrame {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent ev) {
|
||||
BufferedReader br = new BufferedReader(new InputStreamReader(getClass().getClassLoader().getResourceAsStream("about.html")));
|
||||
Properties properties = new Properties();
|
||||
try {
|
||||
properties.load(getClass().getClassLoader().getResourceAsStream("project.properties"));
|
||||
} catch (IOException e) {
|
||||
System.err.println("Failed to load project properties.");
|
||||
e.printStackTrace();
|
||||
}
|
||||
String aboutText = br.lines().collect(Collectors.joining());
|
||||
JOptionPane.showMessageDialog(VacCalc.this,
|
||||
aboutText,
|
||||
"About", JOptionPane.INFORMATION_MESSAGE);
|
||||
aboutText = aboutText.replace("VERSION", properties.getProperty("version"));
|
||||
JOptionPane.showMessageDialog(VacCalc.this, aboutText, "About",
|
||||
JOptionPane.INFORMATION_MESSAGE);
|
||||
}
|
||||
});
|
||||
helpMenu.add(aboutItem);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<html>
|
||||
<p><b>VacCalc v1.0.0</b></p>
|
||||
<p><b>VacCalc VERSION</b></p>
|
||||
<hr />
|
||||
<p>Copyright © 2026 Nicolás A. Ortega Froysa <nicolas@ortegas.org></p>
|
||||
<p>License: Zlib</p>
|
||||
|
||||
1
src/main/resources/project.properties
Normal file
1
src/main/resources/project.properties
Normal file
@@ -0,0 +1 @@
|
||||
version=${project.version}
|
||||
Reference in New Issue
Block a user