Compare commits
4 Commits
ad5d7d98c4
...
d872a39394
Author | SHA1 | Date | |
---|---|---|---|
d872a39394 | |||
9d010d452c | |||
58e94e6cbd | |||
63e736152b |
@ -6,6 +6,16 @@ logo = logo.png
|
|||||||
[lang]
|
[lang]
|
||||||
lang = langde
|
lang = langde
|
||||||
|
|
||||||
|
[settings]
|
||||||
|
openpdf = 1
|
||||||
|
openmap = 0
|
||||||
|
|
||||||
|
[einheiten]
|
||||||
|
zeit = min
|
||||||
|
strecke = km
|
||||||
|
meter = m
|
||||||
|
speed = km/h
|
||||||
|
|
||||||
[db]
|
[db]
|
||||||
dbname = tourplaner
|
dbname = tourplaner
|
||||||
url =
|
url =
|
||||||
|
46
langde.ini
46
langde.ini
@ -19,7 +19,7 @@ zielpunkttitle = Tour zielpunkt
|
|||||||
zielpunktheader = Bitte geben Sie den Zielpunkt der Tour an!
|
zielpunktheader = Bitte geben Sie den Zielpunkt der Tour an!
|
||||||
zielpunktmsg = Zielpunkt:
|
zielpunktmsg = Zielpunkt:
|
||||||
deltournoselect = ViewModel -> DelTour
|
deltournoselect = ViewModel -> DelTour
|
||||||
deltournoselectmsg = Bitte wählen Sie zuerst eine Tour aus, bevor Sie auf löschen klicken!
|
deltournoselectmsg = Bitte wählen Sie zuerst eine Tour aus!
|
||||||
exceptionstackheader = Exception stacktrace:
|
exceptionstackheader = Exception stacktrace:
|
||||||
keinelogsvorhanden = Fügen Sie erst ein Log hinzu um es anzuzeigen!
|
keinelogsvorhanden = Fügen Sie erst ein Log hinzu um es anzuzeigen!
|
||||||
datum = Datum
|
datum = Datum
|
||||||
@ -59,4 +59,46 @@ loggegangen = Davon gegangen:
|
|||||||
logavg = Berechnete Durchschnittliche Geschwindigkeit:
|
logavg = Berechnete Durchschnittliche Geschwindigkeit:
|
||||||
logstrecke = Entfernung:
|
logstrecke = Entfernung:
|
||||||
loghight = Höhenmeter:
|
loghight = Höhenmeter:
|
||||||
logbemerkung = Bemerkung:
|
logbemerkung = Bemerkung:
|
||||||
|
|
||||||
|
fkarte = Karte
|
||||||
|
fbeschreibung = Beschreibung
|
||||||
|
fedit = Bearbeiten
|
||||||
|
fname = Tourname
|
||||||
|
fstrecke = Berechnete Strecke
|
||||||
|
fdauer = Berechnete Dauer
|
||||||
|
fziel = Ziel
|
||||||
|
fstart = Start
|
||||||
|
favg = Durchschnittsgeschwindigkeit
|
||||||
|
fbemerkung = Bemerkung
|
||||||
|
fdatum = Datum
|
||||||
|
fdauer = Dauer
|
||||||
|
fgegangen = Davon gegangen
|
||||||
|
fhight = Höhenmeter
|
||||||
|
fpause = Davon Pause
|
||||||
|
fstrecke = Strecke
|
||||||
|
|
||||||
|
keinlogselected = Kein Logeintrag ausgewählt
|
||||||
|
keinlogselectedmsg = Bitte zuerst einen Logeintrag auswählen
|
||||||
|
|
||||||
|
fsuche = Suchen
|
||||||
|
fopenmapsetting = Map automatisch öffnen
|
||||||
|
fopenpdfsetting = Report automatisch öffnen
|
||||||
|
flangenglisch = Englisch
|
||||||
|
flangdeutsch = Deutsch
|
||||||
|
fdatei = Datei
|
||||||
|
fbearbeiten = Bearbeiten
|
||||||
|
foptionen = Optionen
|
||||||
|
fsprache = Sprache auswählen
|
||||||
|
fhilfe = Hilfe
|
||||||
|
freposum = Erstelle Report über alle Touren
|
||||||
|
frepotour = Erstelle Report über aktuelle Tour
|
||||||
|
fbeenden = Beenden
|
||||||
|
fpunkte = ...
|
||||||
|
|
||||||
|
rzeitallerlogs = Gesammte Zeit aller Logs:
|
||||||
|
rstreckeallerlogs = gesammte Strecke aller Logs:
|
||||||
|
rcalzeitallerlogs = Berechnete Zeit aller Logs:
|
||||||
|
calstreckeallerloggs = Berechnete Strecke aller Touren:
|
||||||
|
rdaten = Daten
|
||||||
|
rsummrepo = Zusammengefasster Report
|
105
langen.ini
Normal file
105
langen.ini
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
[langen]
|
||||||
|
achtung = ATTENTION
|
||||||
|
openbrowsererror = TourplanerController -> Browser:
|
||||||
|
browserexception = Browser Exception
|
||||||
|
browserexceptionmsg = Error at opening Browser
|
||||||
|
suchfeldleer = Search field is empty!
|
||||||
|
suchtextzuerst = Please enter search term first!
|
||||||
|
keinetourselected = No Tour selected
|
||||||
|
tournametitle = Tour name
|
||||||
|
tournameheader = Please enter a Tourname!
|
||||||
|
tournamemsg = Name:
|
||||||
|
namevergebenheader = Name is already occupied!
|
||||||
|
namevergebenmsg1 = The name '
|
||||||
|
namevergebenmsg2 = ' is already in use!
|
||||||
|
startpunkttitle = Tour start
|
||||||
|
startpunktheader = Please enter the start of the Tour
|
||||||
|
startpunktmsg = Start:
|
||||||
|
zielpunkttitle = Tour destination:
|
||||||
|
zielpunktheader = Please enter the tour destination!
|
||||||
|
zielpunktmsg = Destination:
|
||||||
|
deltournoselect = ViewModel -> DelTour
|
||||||
|
deltournoselectmsg = Please select a tour first!
|
||||||
|
exceptionstackheader = Exception stacktrace:
|
||||||
|
keinelogsvorhanden = First add a Log!
|
||||||
|
datum = Date
|
||||||
|
dauer = Duration
|
||||||
|
strecke = Distance
|
||||||
|
streckemsg = Distance of the log entry
|
||||||
|
dauermsg = Duration of the log entry
|
||||||
|
doppelpunkt = :
|
||||||
|
fktnichtimplementiert = Not implementet jet
|
||||||
|
vergessenodernochnichtsoweit = Not implementet jet
|
||||||
|
logtournotselectedmsg = Please select a tour first!
|
||||||
|
keintextimfeld = Please enter a text!
|
||||||
|
nurzahlen = Only numbers!
|
||||||
|
nurpositivezahlen = Only positiv numbers!
|
||||||
|
pause = Break
|
||||||
|
pausemsg = Duration of the break
|
||||||
|
hightmeter = Vertical meters
|
||||||
|
hightmetermsg = Vertical meters of the etape
|
||||||
|
bemerkung = Comment
|
||||||
|
bemerkungheader = Please enter a Comment, can also be empty!
|
||||||
|
tourreportvon = Tour Report from ->
|
||||||
|
tourplanervon = Tourplaner by DerGeorg
|
||||||
|
reportkeywords = Tourplaner, Tour, Report
|
||||||
|
tourplaner = Tourplaner
|
||||||
|
tour = Tour
|
||||||
|
reportvon = Report created by:
|
||||||
|
reportstart = Start of the tour:
|
||||||
|
reportziel = Destination of the tour:
|
||||||
|
reportdauercal = Calculated duration of the tour:
|
||||||
|
reportstreckecal = Calculated distance of the tour:
|
||||||
|
logs = Logs
|
||||||
|
countlog = Number of log entries:
|
||||||
|
logvom = Log from:
|
||||||
|
logdauer = Duration:
|
||||||
|
logpause = Break from that:
|
||||||
|
loggegangen = Gone away:
|
||||||
|
logavg = Calculated averrage speed:
|
||||||
|
logstrecke = Distance:
|
||||||
|
loghight = Vertical meters:
|
||||||
|
logbemerkung = Comment:
|
||||||
|
|
||||||
|
fkarte = Map
|
||||||
|
fbeschreibung = Description
|
||||||
|
fedit = Edit
|
||||||
|
fname = Tourname
|
||||||
|
fstrecke = Calculated Distance
|
||||||
|
fdauer = Calculated Duration
|
||||||
|
fziel = Destination
|
||||||
|
fstart = Start
|
||||||
|
favg = Average speed
|
||||||
|
fbemerkung = Comment
|
||||||
|
fdatum = Date
|
||||||
|
fdauer = Duration
|
||||||
|
fgegangen = Gone away
|
||||||
|
fhight = Vertical meters
|
||||||
|
fpause = Break from that
|
||||||
|
fstrecke = Distance
|
||||||
|
|
||||||
|
keinlogselected = No log selected
|
||||||
|
keinlogselectedmsg = Please select a log first!
|
||||||
|
|
||||||
|
|
||||||
|
fsuche = Search
|
||||||
|
fopenmapsetting = Open map automatic
|
||||||
|
fopenpdfsetting = Open report automatic
|
||||||
|
flangenglisch = English
|
||||||
|
flangdeutsch = German
|
||||||
|
fdatei = File
|
||||||
|
fbearbeiten = Edit
|
||||||
|
foptionen = Options
|
||||||
|
fsprache = Choose Language
|
||||||
|
fhilfe = Help
|
||||||
|
freposum = Generate summarize-report
|
||||||
|
frepotour = Generate tour-report
|
||||||
|
fbeenden = Quit
|
||||||
|
fpunkte = ...
|
||||||
|
|
||||||
|
rzeitallerlogs = Time of all logs:
|
||||||
|
rstreckeallerlogs = Distance of all logs:
|
||||||
|
rcalzeitallerlogs = Calculated time of all logs:
|
||||||
|
calstreckeallerloggs = Calculated distance of all logs:
|
||||||
|
rdaten = Data
|
||||||
|
rsummrepo = Summary Report
|
@ -43,7 +43,7 @@ public class ConfigHelper {
|
|||||||
try {
|
try {
|
||||||
ini = new Wini(new File(filename));
|
ini = new Wini(new File(filename));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LogHelper.error(e.getMessage(), e.getClass().getName());
|
LogHelper.error(e);
|
||||||
}
|
}
|
||||||
assert ini != null;
|
assert ini != null;
|
||||||
return ini.get(sectionName, optionName, String.class);
|
return ini.get(sectionName, optionName, String.class);
|
||||||
@ -56,7 +56,7 @@ public class ConfigHelper {
|
|||||||
* @return Den angeforderten String
|
* @return Den angeforderten String
|
||||||
*/
|
*/
|
||||||
public static String getLangIniString(String optionName){
|
public static String getLangIniString(String optionName){
|
||||||
return ConfigHelper.getIniString(ConfigHelper.getStandartLangde(), ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "lang", "lang"),optionName);
|
return ConfigHelper.getIniString(getIniString(getStandartConfig(), "lang", "lang") + ".ini", ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "lang", "lang"),optionName);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -92,7 +92,7 @@ public class ConfigHelper {
|
|||||||
ini.put(sectionName, optionName, value);
|
ini.put(sectionName, optionName, value);
|
||||||
ini.store();
|
ini.store();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LogHelper.error(e.getMessage(), e.getClass().getName());
|
LogHelper.error(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,7 +31,9 @@ public class DirectionMap {
|
|||||||
FileHelper.saveImage(this.map, "jpg", new File(this.file));
|
FileHelper.saveImage(this.map, "jpg", new File(this.file));
|
||||||
FileHelper.saveImage(this.mappdf, "jpg", new File(this.filepdf));
|
FileHelper.saveImage(this.mappdf, "jpg", new File(this.filepdf));
|
||||||
getDirections(start, ende);
|
getDirections(start, ende);
|
||||||
FileHelper.openDefault(file);
|
if(ConfigHelper.getIniInt(ConfigHelper.getStandartConfig(), "settings", "openmap") == 1) {
|
||||||
|
FileHelper.openDefault(file);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
50
src/tourplaner/business/EinheitenAdder.java
Normal file
50
src/tourplaner/business/EinheitenAdder.java
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
package tourplaner.business;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fügt am ende eines Strings die einheiten an
|
||||||
|
*/
|
||||||
|
public class EinheitenAdder {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fügt meter hinzu
|
||||||
|
* @param meter Meter als String
|
||||||
|
* @return Meter mit einheit
|
||||||
|
*/
|
||||||
|
public static String addMeter(String meter){
|
||||||
|
return meter + " " +ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "einheiten", "meter");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String addSpeed(String speed){
|
||||||
|
return speed + " " + ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "einheiten", "speed");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fügt km hinzu
|
||||||
|
* @param km km als String
|
||||||
|
* @return km mit einheit
|
||||||
|
*/
|
||||||
|
public static String addKm(String km){
|
||||||
|
return km + " " +ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "einheiten", "strecke");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fügt minuten hinzu
|
||||||
|
* @param min minuten als String
|
||||||
|
* @return minuten mit einheit
|
||||||
|
*/
|
||||||
|
public static String addMinuten(String min){
|
||||||
|
return min + " " +ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "einheiten", "zeit");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fügt am ende .json hinzu. Sofern es nicht schon dort ist
|
||||||
|
* @param filename Filename ohne .json am ende
|
||||||
|
* @return Der Filename mit .json am ende-
|
||||||
|
*/
|
||||||
|
public static String addJson(String filename){
|
||||||
|
if(!filename.contains(".json")){
|
||||||
|
filename += ".json";
|
||||||
|
}
|
||||||
|
return filename;
|
||||||
|
}
|
||||||
|
}
|
@ -34,8 +34,9 @@ public class Exporter {
|
|||||||
ProgressBar progressBar = new ProgressBar("Export...");
|
ProgressBar progressBar = new ProgressBar("Export...");
|
||||||
int step = progressBar.getProgressSize(4, 100);
|
int step = progressBar.getProgressSize(4, 100);
|
||||||
ArrayList<Tour> data = new DbConnect().getAllTouren();
|
ArrayList<Tour> data = new DbConnect().getAllTouren();
|
||||||
|
|
||||||
progressBar.addProgress(step);
|
progressBar.addProgress(step);
|
||||||
FileWriter fileWriter = new FileWriter(path + ".json");
|
FileWriter fileWriter = new FileWriter(EinheitenAdder.addJson(this.path));
|
||||||
progressBar.addProgress(step);
|
progressBar.addProgress(step);
|
||||||
JsonHelper.getJsonFromObj(data, fileWriter);
|
JsonHelper.getJsonFromObj(data, fileWriter);
|
||||||
progressBar.addProgress(step);
|
progressBar.addProgress(step);
|
||||||
@ -51,7 +52,7 @@ public class Exporter {
|
|||||||
public void doImport() {
|
public void doImport() {
|
||||||
ProgressBar progressBar = new ProgressBar("Import...");
|
ProgressBar progressBar = new ProgressBar("Import...");
|
||||||
try {
|
try {
|
||||||
this.touren = JsonHelper.getTourenFromJson(new FileReader(this.path));
|
this.touren = JsonHelper.getTourenFromJson(new FileReader(EinheitenAdder.addJson(this.path)));
|
||||||
DbConnect dbConnect = new DbConnect();
|
DbConnect dbConnect = new DbConnect();
|
||||||
dbConnect.delAllData();
|
dbConnect.delAllData();
|
||||||
progressBar.addProgress(5);
|
progressBar.addProgress(5);
|
||||||
|
@ -3,12 +3,9 @@ package tourplaner.business;
|
|||||||
import com.itextpdf.text.*;
|
import com.itextpdf.text.*;
|
||||||
import com.itextpdf.text.Font;
|
import com.itextpdf.text.Font;
|
||||||
import com.itextpdf.text.Image;
|
import com.itextpdf.text.Image;
|
||||||
import tourplaner.data.DbConnect;
|
|
||||||
import tourplaner.object.Log;
|
import tourplaner.object.Log;
|
||||||
import tourplaner.object.Tour;
|
import tourplaner.object.Tour;
|
||||||
|
|
||||||
import com.itextpdf.text.pdf.PdfPCell;
|
|
||||||
import com.itextpdf.text.pdf.PdfPTable;
|
|
||||||
import com.itextpdf.text.pdf.PdfWriter;
|
import com.itextpdf.text.pdf.PdfWriter;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
@ -53,7 +50,9 @@ public class Reporter {
|
|||||||
} catch (DocumentException | FileNotFoundException e) {
|
} catch (DocumentException | FileNotFoundException e) {
|
||||||
LogHelper.error(e.getMessage(), e.getClass().getName());
|
LogHelper.error(e.getMessage(), e.getClass().getName());
|
||||||
}
|
}
|
||||||
FileHelper.openDefault(file);
|
if(ConfigHelper.getIniInt(ConfigHelper.getStandartConfig(), "settings", "openpdf") == 1) {
|
||||||
|
FileHelper.openDefault(file);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -76,17 +75,17 @@ public class Reporter {
|
|||||||
strecke += log.getStrecke();
|
strecke += log.getStrecke();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Anchor anchor = new Anchor("Zusammengefasster Report", catFont);
|
Anchor anchor = new Anchor(ConfigHelper.getLangIniString("rsummrepo"), catFont);
|
||||||
anchor.setName("Zusammengefasster Report");
|
anchor.setName(ConfigHelper.getLangIniString("rsummrepo"));
|
||||||
// Second parameter is the number of the chapter
|
// Second parameter is the number of the chapter
|
||||||
Chapter catPart = new Chapter(new Paragraph(anchor), 1);
|
Chapter catPart = new Chapter(new Paragraph(anchor), 1);
|
||||||
Paragraph subPara = new Paragraph("Daten", subFont);
|
Paragraph subPara = new Paragraph(ConfigHelper.getLangIniString("rdaten"), subFont);
|
||||||
Section subCatPart = catPart.addSection(subPara);
|
Section subCatPart = catPart.addSection(subPara);
|
||||||
subCatPart.add(new Paragraph(ConfigHelper.getLangIniString("reportvon") + System.getProperty("user.name") + ", " + new Date()));
|
subCatPart.add(new Paragraph(ConfigHelper.getLangIniString("reportvon") + " " + System.getProperty("user.name") + ", " + new Date()));
|
||||||
subCatPart.add(new Paragraph("Gesammte Zeit aller Logs: " + dauer));
|
subCatPart.add(new Paragraph(EinheitenAdder.addMinuten(ConfigHelper.getLangIniString("rzeitallerlogs") + " " + dauer)));
|
||||||
subCatPart.add(new Paragraph("gesammte Strecke aller Logs: " + strecke));
|
subCatPart.add(new Paragraph(EinheitenAdder.addKm(ConfigHelper.getLangIniString("rstreckeallerlogs") + " " + strecke)));
|
||||||
subCatPart.add(new Paragraph("Berechnete Zeit aller Logs: " + calDauer));
|
subCatPart.add(new Paragraph(EinheitenAdder.addMinuten(ConfigHelper.getLangIniString("rcalzeitallerlogs") + " " + calDauer)));
|
||||||
subCatPart.add(new Paragraph("Berechnete Strecke aller Touren: " + calStecke));
|
subCatPart.add(new Paragraph(EinheitenAdder.addKm(ConfigHelper.getLangIniString("calstreckeallerloggs") + " " + calStecke)));
|
||||||
document.add(catPart);
|
document.add(catPart);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -109,14 +108,16 @@ public class Reporter {
|
|||||||
} catch (DocumentException | FileNotFoundException e) {
|
} catch (DocumentException | FileNotFoundException e) {
|
||||||
LogHelper.error(e.getMessage(), e.getClass().getName());
|
LogHelper.error(e.getMessage(), e.getClass().getName());
|
||||||
}
|
}
|
||||||
FileHelper.openDefault(file);
|
if(ConfigHelper.getIniInt(ConfigHelper.getStandartConfig(), "settings", "openpdf") == 1) {
|
||||||
|
FileHelper.openDefault(file);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// iText allows to add metadata to the PDF which can be viewed in your Adobe
|
// iText allows to add metadata to the PDF which can be viewed in your Adobe
|
||||||
// Reader
|
// Reader
|
||||||
// under File -> Properties
|
// under File -> Properties
|
||||||
private static void addMetaData(Document document, Tour tour) {
|
private static void addMetaData(Document document, Tour tour) {
|
||||||
document.addTitle(ConfigHelper.getLangIniString("tourreportvon") + tour.getName());
|
document.addTitle(ConfigHelper.getLangIniString("tourreportvon") + " " + tour.getName());
|
||||||
document.addSubject(ConfigHelper.getLangIniString("tourplanervon"));
|
document.addSubject(ConfigHelper.getLangIniString("tourplanervon"));
|
||||||
document.addKeywords(ConfigHelper.getLangIniString("reportkeywords"));
|
document.addKeywords(ConfigHelper.getLangIniString("reportkeywords"));
|
||||||
document.addAuthor(ConfigHelper.getLangIniString("tourplaner"));
|
document.addAuthor(ConfigHelper.getLangIniString("tourplaner"));
|
||||||
@ -138,11 +139,11 @@ public class Reporter {
|
|||||||
|
|
||||||
Paragraph subPara = new Paragraph(ConfigHelper.getLangIniString("tour"), subFont);
|
Paragraph subPara = new Paragraph(ConfigHelper.getLangIniString("tour"), subFont);
|
||||||
Section subCatPart = catPart.addSection(subPara);
|
Section subCatPart = catPart.addSection(subPara);
|
||||||
subCatPart.add(new Paragraph(ConfigHelper.getLangIniString("reportvon") + System.getProperty("user.name") + ", " + new Date()));
|
subCatPart.add(new Paragraph(ConfigHelper.getLangIniString("reportvon") + " " + System.getProperty("user.name") + ", " + new Date()));
|
||||||
subCatPart.add(new Paragraph(ConfigHelper.getLangIniString("reportstart") + tour.getStart()));
|
subCatPart.add(new Paragraph(ConfigHelper.getLangIniString("reportstart") + " " + tour.getStart()));
|
||||||
subCatPart.add(new Paragraph(ConfigHelper.getLangIniString("reportziel") + tour.getZiel()));
|
subCatPart.add(new Paragraph(ConfigHelper.getLangIniString("reportziel") + " " + tour.getZiel()));
|
||||||
subCatPart.add(new Paragraph(ConfigHelper.getLangIniString("reportdauercal") + tour.getDauer()));
|
subCatPart.add(new Paragraph(EinheitenAdder.addMinuten(ConfigHelper.getLangIniString("reportdauercal") + " " + tour.getDauer())));
|
||||||
subCatPart.add(new Paragraph(ConfigHelper.getLangIniString("reportstreckecal") + tour.getStrecke()));
|
subCatPart.add(new Paragraph(EinheitenAdder.addKm(ConfigHelper.getLangIniString("reportstreckecal") + " " + tour.getStrecke())));
|
||||||
Paragraph emptyLine = new Paragraph();
|
Paragraph emptyLine = new Paragraph();
|
||||||
addEmptyLine(emptyLine, 5);
|
addEmptyLine(emptyLine, 5);
|
||||||
subCatPart.add(emptyLine);
|
subCatPart.add(emptyLine);
|
||||||
@ -164,18 +165,18 @@ public class Reporter {
|
|||||||
anchor = new Anchor(ConfigHelper.getLangIniString("logs"), catFont);
|
anchor = new Anchor(ConfigHelper.getLangIniString("logs"), catFont);
|
||||||
anchor.setName(ConfigHelper.getLangIniString("logs"));
|
anchor.setName(ConfigHelper.getLangIniString("logs"));
|
||||||
catPart = new Chapter(new Paragraph(anchor), 2);
|
catPart = new Chapter(new Paragraph(anchor), 2);
|
||||||
catPart.add(new Paragraph(ConfigHelper.getLangIniString("countlog") + logs.size()));
|
catPart.add(new Paragraph(ConfigHelper.getLangIniString("countlog") + " " + logs.size()));
|
||||||
|
|
||||||
for (Log log: logs) {
|
for (Log log: logs) {
|
||||||
subPara = new Paragraph(ConfigHelper.getLangIniString("logvom") + log.getDatum() , subFont);
|
subPara = new Paragraph(ConfigHelper.getLangIniString("logvom") + " " + log.getDatum() , subFont);
|
||||||
subCatPart = catPart.addSection(subPara);
|
subCatPart = catPart.addSection(subPara);
|
||||||
subCatPart.add(new Paragraph(ConfigHelper.getLangIniString("logdauer") + log.getDauer()));
|
subCatPart.add(new Paragraph(EinheitenAdder.addMinuten(ConfigHelper.getLangIniString("logdauer") + " " + log.getDauer())));
|
||||||
subCatPart.add(new Paragraph(ConfigHelper.getLangIniString("logpause") + log.getPause()));
|
subCatPart.add(new Paragraph(EinheitenAdder.addMinuten(ConfigHelper.getLangIniString("logpause") + " " + log.getPause())));
|
||||||
subCatPart.add(new Paragraph(ConfigHelper.getLangIniString("loggegangen") + log.getGegangen()));
|
subCatPart.add(new Paragraph(EinheitenAdder.addMinuten(ConfigHelper.getLangIniString("loggegangen") + " " + log.getGegangen())));
|
||||||
subCatPart.add(new Paragraph(ConfigHelper.getLangIniString("logavg")+ log.getAvgspeed()));
|
subCatPart.add(new Paragraph(EinheitenAdder.addSpeed(ConfigHelper.getLangIniString("logavg") + " " + log.getAvgspeed())));
|
||||||
subCatPart.add(new Paragraph(ConfigHelper.getLangIniString("logstrecke") + log.getStrecke()));
|
subCatPart.add(new Paragraph(EinheitenAdder.addKm(ConfigHelper.getLangIniString("logstrecke") + " " + log.getStrecke())));
|
||||||
subCatPart.add(new Paragraph(ConfigHelper.getLangIniString("loghight") + log.getHightmeter()));
|
subCatPart.add(new Paragraph(EinheitenAdder.addMeter(ConfigHelper.getLangIniString("loghight") + " " + log.getHightmeter())));
|
||||||
subCatPart.add(new Paragraph(ConfigHelper.getLangIniString("logbemerkung") + log.getBemerkung()));
|
subCatPart.add(new Paragraph(ConfigHelper.getLangIniString("logbemerkung") + " " + log.getBemerkung()));
|
||||||
}
|
}
|
||||||
// now add all this to the document
|
// now add all this to the document
|
||||||
document.add(catPart);
|
document.add(catPart);
|
||||||
|
@ -119,7 +119,9 @@ public class TourPlaner{
|
|||||||
* @param tourname Tourname
|
* @param tourname Tourname
|
||||||
*/
|
*/
|
||||||
public static void openImage(String tourname){
|
public static void openImage(String tourname){
|
||||||
FileHelper.openDefault(getImagePath(tourname));
|
if(ConfigHelper.getIniInt(ConfigHelper.getStandartConfig(), "settings", "openmap") == 1) {
|
||||||
|
FileHelper.openDefault(getImagePath(tourname));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -181,17 +183,6 @@ public class TourPlaner{
|
|||||||
return new DbConnect().editLog(tourname, log);
|
return new DbConnect().editLog(tourname, log);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Exportiert die Daten
|
|
||||||
* @param path Path zu den Daten
|
|
||||||
* @throws IOException Fehler beim schreiben der Daten
|
|
||||||
*/
|
|
||||||
public static void exportData(String path) throws IOException {
|
|
||||||
Exporter exporter = new Exporter(path);
|
|
||||||
exporter.doExport();
|
|
||||||
FileHelper.openDefault(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sucht alle touren die den gegebenen tournamen enthalten
|
* Sucht alle touren die den gegebenen tournamen enthalten
|
||||||
* @param tourname Name der zu suchen ist
|
* @param tourname Name der zu suchen ist
|
||||||
|
@ -20,6 +20,9 @@ public class Log {
|
|||||||
this.pause = pause;
|
this.pause = pause;
|
||||||
this.gegangen = this.dauer - this.pause;
|
this.gegangen = this.dauer - this.pause;
|
||||||
this.avgspeed = this.strecke / (this.gegangen);
|
this.avgspeed = this.strecke / (this.gegangen);
|
||||||
|
if(Double.isInfinite(this.avgspeed)){
|
||||||
|
this.avgspeed = -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getBemerkung() {
|
public String getBemerkung() {
|
||||||
|
@ -45,30 +45,30 @@
|
|||||||
<menus>
|
<menus>
|
||||||
<Menu fx:id="menueFile" mnemonicParsing="false" text="Datei">
|
<Menu fx:id="menueFile" mnemonicParsing="false" text="Datei">
|
||||||
<items>
|
<items>
|
||||||
<MenuItem mnemonicParsing="false" onAction="#reportSum" text="Report Summary" />
|
<MenuItem fx:id="reportsummary" mnemonicParsing="false" onAction="#reportSum" text="Report Summary" />
|
||||||
<MenuItem mnemonicParsing="false" onAction="#tourReport" text="Tour Report" />
|
<MenuItem fx:id="tourreport" mnemonicParsing="false" onAction="#tourReport" text="Tour Report" />
|
||||||
<MenuItem fx:id="beendenButton" mnemonicParsing="false" onAction="#quitApp" text="Beenden" />
|
<MenuItem fx:id="beendenButton" mnemonicParsing="false" onAction="#quitApp" text="Beenden" />
|
||||||
</items>
|
</items>
|
||||||
</Menu>
|
</Menu>
|
||||||
<Menu mnemonicParsing="false" text="Bearbeiten">
|
<Menu fx:id="menuebearbeiten" mnemonicParsing="false" text="Bearbeiten">
|
||||||
<items>
|
<items>
|
||||||
<MenuItem mnemonicParsing="false" onAction="#importBtn" text="Import" />
|
<MenuItem fx:id="menueimport" mnemonicParsing="false" onAction="#importBtn" text="Import" />
|
||||||
<MenuItem mnemonicParsing="false" onAction="#exportBtn" text="Export" />
|
<MenuItem fx:id="menueexport" mnemonicParsing="false" onAction="#exportBtn" text="Export" />
|
||||||
</items>
|
</items>
|
||||||
</Menu>
|
</Menu>
|
||||||
<Menu mnemonicParsing="false" text="Optionen">
|
<Menu fx:id="menueoptionen" mnemonicParsing="false" text="Optionen">
|
||||||
<items>
|
<items>
|
||||||
<CheckMenuItem mnemonicParsing="false" text="Map automatisch öffnen" />
|
<CheckMenuItem fx:id="openmap" mnemonicParsing="false" onAction="#openmapaction" text="Map automatisch öffnen" />
|
||||||
<CheckMenuItem mnemonicParsing="false" text="Report automatisch öffnen" />
|
<CheckMenuItem fx:id="openpdf" mnemonicParsing="false" onAction="#openpdfaction" text="Report automatisch öffnen" />
|
||||||
<Menu mnemonicParsing="false" text="Sprache">
|
<Menu fx:id="menuesprachen" mnemonicParsing="false" text="Sprache">
|
||||||
<items>
|
<items>
|
||||||
<RadioMenuItem mnemonicParsing="false" text="Deutsch" />
|
<RadioMenuItem fx:id="langdeutsch" mnemonicParsing="false" onAction="#onlangdeutsch" text="Deutsch" />
|
||||||
<RadioMenuItem mnemonicParsing="false" text="Englisch" />
|
<RadioMenuItem fx:id="langenglisch" mnemonicParsing="false" onAction="#onlangenglisch" text="Englisch" />
|
||||||
</items>
|
</items>
|
||||||
</Menu>
|
</Menu>
|
||||||
</items>
|
</items>
|
||||||
</Menu>
|
</Menu>
|
||||||
<Menu mnemonicParsing="false" text="Hilfe">
|
<Menu fx:id="menuehilfe" mnemonicParsing="false" text="Hilfe">
|
||||||
<items>
|
<items>
|
||||||
<MenuItem mnemonicParsing="false" onAction="#gitWebBrowser" text="Git Repo" />
|
<MenuItem mnemonicParsing="false" onAction="#gitWebBrowser" text="Git Repo" />
|
||||||
<MenuItem mnemonicParsing="false" onAction="#javaDocBrowser" text="JavaDoc" />
|
<MenuItem mnemonicParsing="false" onAction="#javaDocBrowser" text="JavaDoc" />
|
||||||
@ -84,7 +84,7 @@
|
|||||||
<Button fx:id="tourAdd" layoutX="58.0" mnemonicParsing="false" onAction="#addTour" text="+" />
|
<Button fx:id="tourAdd" layoutX="58.0" mnemonicParsing="false" onAction="#addTour" text="+" />
|
||||||
<Label layoutX="14.0" layoutY="4.0" text="Tours" />
|
<Label layoutX="14.0" layoutY="4.0" text="Tours" />
|
||||||
<Button fx:id="tourDel" layoutX="89.0" mnemonicParsing="false" onAction="#delTour" text="-" />
|
<Button fx:id="tourDel" layoutX="89.0" mnemonicParsing="false" onAction="#delTour" text="-" />
|
||||||
<Button layoutX="117.0" mnemonicParsing="false" onAction="#editTourBtn" text="Edit" />
|
<Button fx:id="editTourBtn" layoutX="117.0" mnemonicParsing="false" onAction="#editTourBtn" text="Edit" />
|
||||||
</children></AnchorPane>
|
</children></AnchorPane>
|
||||||
<TextField fx:id="sucheInput" promptText="Suche..." />
|
<TextField fx:id="sucheInput" promptText="Suche..." />
|
||||||
<Button fx:id="sucheButton" mnemonicParsing="false" onAction="#suche" text="Suchen" />
|
<Button fx:id="sucheButton" mnemonicParsing="false" onAction="#suche" text="Suchen" />
|
||||||
@ -133,9 +133,9 @@
|
|||||||
<children>
|
<children>
|
||||||
<TableView fx:id="beschreibungTableView" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
<TableView fx:id="beschreibungTableView" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
<columns>
|
<columns>
|
||||||
<TableColumn fx:id="nameCol" maxWidth="1.7976931348623157E308" minWidth="70.0" prefWidth="-1.0" text="Tourname" />
|
<TableColumn fx:id="nameCol" minWidth="100.0" prefWidth="-1.0" text="Tourname" />
|
||||||
<TableColumn fx:id="dauerCol" maxWidth="1.7976931348623157E308" minWidth="40.0" prefWidth="-1.0" text="Dauer" />
|
<TableColumn fx:id="dauerCol" maxWidth="1.7976931348623157E308" minWidth="100.0" prefWidth="-1.0" text="Dauer" />
|
||||||
<TableColumn fx:id="streckeCol" maxWidth="1.7976931348623157E308" minWidth="50.0" prefWidth="-1.0" text="Strecke" />
|
<TableColumn fx:id="streckeCol" maxWidth="1.7976931348623157E308" minWidth="100.0" prefWidth="-1.0" text="Strecke" />
|
||||||
<TableColumn fx:id="startCol" maxWidth="1.7976931348623157E308" minWidth="100.0" prefWidth="-1.0" text="Startpunk" />
|
<TableColumn fx:id="startCol" maxWidth="1.7976931348623157E308" minWidth="100.0" prefWidth="-1.0" text="Startpunk" />
|
||||||
<TableColumn fx:id="zielCol" maxWidth="1.7976931348623157E308" minWidth="100.0" prefWidth="-1.0" text="Zielpunkt" />
|
<TableColumn fx:id="zielCol" maxWidth="1.7976931348623157E308" minWidth="100.0" prefWidth="-1.0" text="Zielpunkt" />
|
||||||
</columns>
|
</columns>
|
||||||
@ -173,7 +173,7 @@
|
|||||||
<Insets />
|
<Insets />
|
||||||
</HBox.margin>
|
</HBox.margin>
|
||||||
</Button>
|
</Button>
|
||||||
<Button mnemonicParsing="false" onAction="#editLogBtn" text="Edit" />
|
<Button fx:id="editBtn" mnemonicParsing="false" onAction="#editLogBtn" text="Edit" />
|
||||||
</children>
|
</children>
|
||||||
<padding>
|
<padding>
|
||||||
<Insets bottom="3.0" left="3.0" right="3.0" top="3.0" />
|
<Insets bottom="3.0" left="3.0" right="3.0" top="3.0" />
|
||||||
@ -185,14 +185,14 @@
|
|||||||
<children>
|
<children>
|
||||||
<TableView fx:id="logTableView" onMouseClicked="#logItemSelected" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
<TableView fx:id="logTableView" onMouseClicked="#logItemSelected" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
<columns>
|
<columns>
|
||||||
<TableColumn fx:id="logDatumCol" prefWidth="49.0" text="Datum" />
|
<TableColumn fx:id="logDatumCol" minWidth="-1.0" prefWidth="-1.0" text="Datum" />
|
||||||
<TableColumn fx:id="logDauerCol" prefWidth="126.0" text="Dauer" />
|
<TableColumn fx:id="logDauerCol" minWidth="-1.0" prefWidth="-1.0" text="Dauer" />
|
||||||
<TableColumn fx:id="logStreckeCol" prefWidth="240.0" text="Entfernung" />
|
<TableColumn fx:id="logStreckeCol" minWidth="-1.0" prefWidth="-1.0" text="Entfernung" />
|
||||||
<TableColumn fx:id="logAvgCol" prefWidth="75.0" text="AVG Geschwindigkeit" />
|
<TableColumn fx:id="logAvgCol" minWidth="-1.0" prefWidth="-1.0" text="AVG Geschwindigkeit" />
|
||||||
<TableColumn fx:id="logHightCol" prefWidth="75.0" text="Höhenmeter" />
|
<TableColumn fx:id="logHightCol" minWidth="-1.0" prefWidth="75.0" text="Höhenmeter" />
|
||||||
<TableColumn fx:id="logPauseCol" prefWidth="75.0" text="Davon Pause" />
|
<TableColumn fx:id="logPauseCol" minWidth="-1.0" prefWidth="-1.0" text="Davon Pause" />
|
||||||
<TableColumn fx:id="logGegangenCol" prefWidth="75.0" text="Davon Unterwegs" />
|
<TableColumn fx:id="logGegangenCol" minWidth="-1.0" prefWidth="-1.0" text="Davon Unterwegs" />
|
||||||
<TableColumn fx:id="logBemerkungCol" prefWidth="75.0" text="Bemerkung" />
|
<TableColumn fx:id="logBemerkungCol" minWidth="-1.0" prefWidth="-1.0" text="Bemerkung" />
|
||||||
</columns>
|
</columns>
|
||||||
<columnResizePolicy>
|
<columnResizePolicy>
|
||||||
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
|
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
|
||||||
@ -210,7 +210,7 @@
|
|||||||
</SplitPane>
|
</SplitPane>
|
||||||
<HBox id="HBox" alignment="CENTER_LEFT" spacing="5.0" VBox.vgrow="NEVER">
|
<HBox id="HBox" alignment="CENTER_LEFT" spacing="5.0" VBox.vgrow="NEVER">
|
||||||
<children>
|
<children>
|
||||||
<Label maxHeight="1.7976931348623157E308" maxWidth="-1.0" text="Left status" HBox.hgrow="ALWAYS">
|
<Label maxHeight="1.7976931348623157E308" maxWidth="-1.0" text="Tourplaner" HBox.hgrow="ALWAYS">
|
||||||
<font>
|
<font>
|
||||||
<Font size="11.0" fx:id="x3" />
|
<Font size="11.0" fx:id="x3" />
|
||||||
</font>
|
</font>
|
||||||
@ -219,7 +219,7 @@
|
|||||||
</textFill>
|
</textFill>
|
||||||
</Label>
|
</Label>
|
||||||
<AnchorPane prefHeight="-1.0" prefWidth="-1.0" HBox.hgrow="ALWAYS" />
|
<AnchorPane prefHeight="-1.0" prefWidth="-1.0" HBox.hgrow="ALWAYS" />
|
||||||
<Label font="$x3" maxWidth="-1.0" text="Right status" textFill="$x4" HBox.hgrow="NEVER" />
|
<Label font="$x3" maxWidth="-1.0" text="Georg Reisinger" textFill="$x4" HBox.hgrow="NEVER" />
|
||||||
</children>
|
</children>
|
||||||
<padding>
|
<padding>
|
||||||
<Insets bottom="3.0" left="3.0" right="3.0" top="3.0" />
|
<Insets bottom="3.0" left="3.0" right="3.0" top="3.0" />
|
||||||
|
@ -10,6 +10,7 @@ import javafx.scene.layout.*;
|
|||||||
import javafx.stage.Stage;
|
import javafx.stage.Stage;
|
||||||
import javafx.stage.WindowEvent;
|
import javafx.stage.WindowEvent;
|
||||||
import tourplaner.business.ConfigHelper;
|
import tourplaner.business.ConfigHelper;
|
||||||
|
import tourplaner.business.EinheitenAdder;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.border.TitledBorder;
|
import javax.swing.border.TitledBorder;
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package tourplaner.ui;
|
package tourplaner.ui;
|
||||||
|
|
||||||
import javafx.collections.ObservableList;
|
|
||||||
import javafx.fxml.FXML;
|
import javafx.fxml.FXML;
|
||||||
import javafx.fxml.Initializable;
|
import javafx.fxml.Initializable;
|
||||||
import javafx.geometry.Orientation;
|
import javafx.geometry.Orientation;
|
||||||
import javafx.scene.control.*;
|
import javafx.scene.control.*;
|
||||||
|
import javafx.scene.control.Button;
|
||||||
import javafx.scene.control.Label;
|
import javafx.scene.control.Label;
|
||||||
import javafx.scene.control.TextField;
|
import javafx.scene.control.TextField;
|
||||||
import javafx.scene.control.cell.PropertyValueFactory;
|
import javafx.scene.control.cell.PropertyValueFactory;
|
||||||
@ -12,21 +12,13 @@ import javafx.scene.image.ImageView;
|
|||||||
import javafx.scene.input.MouseEvent;
|
import javafx.scene.input.MouseEvent;
|
||||||
import tourplaner.business.ConfigHelper;
|
import tourplaner.business.ConfigHelper;
|
||||||
import tourplaner.business.LogHelper;
|
import tourplaner.business.LogHelper;
|
||||||
import tourplaner.business.TourPlaner;
|
|
||||||
import tourplaner.object.Log;
|
import tourplaner.object.Log;
|
||||||
import tourplaner.object.Tour;
|
import tourplaner.object.Tour;
|
||||||
import tourplaner.viewmodels.ViewModel;
|
import tourplaner.viewmodels.ViewModel;
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import java.awt.*;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URI;
|
|
||||||
import java.net.URISyntaxException;
|
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.util.ResourceBundle;
|
import java.util.ResourceBundle;
|
||||||
import java.util.UUID;
|
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
|
||||||
|
|
||||||
public class TourplanerController implements Initializable {
|
public class TourplanerController implements Initializable {
|
||||||
//VM
|
//VM
|
||||||
@ -43,6 +35,26 @@ public class TourplanerController implements Initializable {
|
|||||||
//Log -> rechts unten
|
//Log -> rechts unten
|
||||||
public TableView<Log> logTableView;
|
public TableView<Log> logTableView;
|
||||||
public TableColumn<Log, String> logDauerCol, logStreckeCol, logDatumCol, logAvgCol, logHightCol, logPauseCol, logGegangenCol, logBemerkungCol;
|
public TableColumn<Log, String> logDauerCol, logStreckeCol, logDatumCol, logAvgCol, logHightCol, logPauseCol, logGegangenCol, logBemerkungCol;
|
||||||
|
//Menue
|
||||||
|
public CheckMenuItem openmap, openpdf;
|
||||||
|
public RadioMenuItem langenglisch, langdeutsch;
|
||||||
|
private ToggleGroup langgroup;
|
||||||
|
public Menu menueFile, menuebearbeiten, menueoptionen, menuesprachen, menuehilfe;
|
||||||
|
public MenuItem reportsummary, tourreport, beendenButton;
|
||||||
|
//Elemente
|
||||||
|
public Button sucheButton, editBtn, editTourBtn;
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private void onlangenglisch(){
|
||||||
|
ConfigHelper.setIniString(ConfigHelper.getStandartConfig(), "lang", "lang", "langen");
|
||||||
|
langToFxml();
|
||||||
|
}
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private void onlangdeutsch(){
|
||||||
|
ConfigHelper.setIniString(ConfigHelper.getStandartConfig(), "lang", "lang", "langde");
|
||||||
|
langToFxml();
|
||||||
|
}
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
private void tourReport(){
|
private void tourReport(){
|
||||||
@ -148,10 +160,10 @@ public class TourplanerController implements Initializable {
|
|||||||
this.viewModel.setSucheAktiv(false);
|
this.viewModel.setSucheAktiv(false);
|
||||||
progressBar.addProgress(10);
|
progressBar.addProgress(10);
|
||||||
syncTourNamen();
|
syncTourNamen();
|
||||||
progressBar.addProgress(40);
|
progressBar.setProgress(100);
|
||||||
this.sucheInput.setText("");
|
this.sucheInput.setText("");
|
||||||
}
|
}
|
||||||
progressBar.addProgress(50);
|
progressBar.setProgress(100);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -234,7 +246,77 @@ public class TourplanerController implements Initializable {
|
|||||||
TourListView.setOrientation(Orientation.VERTICAL);
|
TourListView.setOrientation(Orientation.VERTICAL);
|
||||||
syncTourNamen();
|
syncTourNamen();
|
||||||
deselectAll();
|
deselectAll();
|
||||||
|
if(ConfigHelper.getIniInt(ConfigHelper.getStandartConfig(), "settings", "openpdf") == 1){
|
||||||
|
this.openpdf.setSelected(true);
|
||||||
|
}else {
|
||||||
|
this.openpdf.setSelected(false);
|
||||||
|
}
|
||||||
|
if(ConfigHelper.getIniInt(ConfigHelper.getStandartConfig(), "settings", "openmap") == 1){
|
||||||
|
this.openmap.setSelected(true);
|
||||||
|
}else {
|
||||||
|
this.openmap.setSelected(false);
|
||||||
|
}
|
||||||
|
this.langgroup = new ToggleGroup();
|
||||||
|
this.langdeutsch.setToggleGroup(this.langgroup);
|
||||||
|
this.langenglisch.setToggleGroup(this.langgroup);
|
||||||
|
if(ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "lang", "lang").equals("langde")){
|
||||||
|
this.langdeutsch.setSelected(true);
|
||||||
|
this.langenglisch.setSelected(false);
|
||||||
|
}else if(ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "lang", "lang").equals("langen")){
|
||||||
|
this.langdeutsch.setSelected(false);
|
||||||
|
this.langenglisch.setSelected(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
langToFxml();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void langToFxml(){
|
||||||
|
this.kartenTab.setText(ConfigHelper.getLangIniString("fkarte"));
|
||||||
|
this.beschreibungTab.setText(ConfigHelper.getLangIniString("fbeschreibung"));
|
||||||
|
this.editBtn.setText(ConfigHelper.getLangIniString("fedit"));
|
||||||
|
this.editTourBtn.setText(ConfigHelper.getLangIniString("fedit"));
|
||||||
|
this.nameCol.setText(ConfigHelper.getLangIniString("fname"));
|
||||||
|
this.streckeCol.setText(ConfigHelper.getLangIniString("fstrecke"));
|
||||||
|
this.dauerCol.setText(ConfigHelper.getLangIniString("fdauer"));
|
||||||
|
this.zielCol.setText(ConfigHelper.getLangIniString("fziel"));
|
||||||
|
this.startCol .setText(ConfigHelper.getLangIniString("fstart"));
|
||||||
|
this.logAvgCol.setText(ConfigHelper.getLangIniString("favg"));
|
||||||
|
this.logBemerkungCol.setText(ConfigHelper.getLangIniString("fbemerkung"));
|
||||||
|
this.logDatumCol.setText(ConfigHelper.getLangIniString("fdatum"));
|
||||||
|
this.logDauerCol.setText(ConfigHelper.getLangIniString("fdauer"));
|
||||||
|
this.logGegangenCol.setText(ConfigHelper.getLangIniString("fgegangen"));
|
||||||
|
this.logHightCol.setText(ConfigHelper.getLangIniString("fhight"));
|
||||||
|
this.logPauseCol.setText(ConfigHelper.getLangIniString("fpause"));
|
||||||
|
this.logStreckeCol.setText(ConfigHelper.getLangIniString("fstrecke"));
|
||||||
|
|
||||||
|
this.sucheButton.setText(ConfigHelper.getLangIniString("fsuche"));
|
||||||
|
this.openmap.setText(ConfigHelper.getLangIniString("fopenmapsetting"));
|
||||||
|
this.openpdf.setText(ConfigHelper.getLangIniString("fopenpdfsetting"));
|
||||||
|
this.langenglisch.setText(ConfigHelper.getLangIniString("flangenglisch"));
|
||||||
|
this.langdeutsch.setText(ConfigHelper.getLangIniString("flangdeutsch"));
|
||||||
|
this.menueFile.setText(ConfigHelper.getLangIniString("fdatei"));
|
||||||
|
this.menuebearbeiten.setText(ConfigHelper.getLangIniString("fbearbeiten"));
|
||||||
|
this.menueoptionen.setText(ConfigHelper.getLangIniString("foptionen"));
|
||||||
|
this.menuesprachen.setText(ConfigHelper.getLangIniString("fsprache"));
|
||||||
|
this.menuehilfe.setText(ConfigHelper.getLangIniString("fhilfe"));
|
||||||
|
this.reportsummary.setText(ConfigHelper.getLangIniString("freposum"));
|
||||||
|
this.tourreport.setText(ConfigHelper.getLangIniString("frepotour"));
|
||||||
|
this.beendenButton.setText(ConfigHelper.getLangIniString("fbeenden"));
|
||||||
|
this.sucheInput.setPromptText(ConfigHelper.getLangIniString("fsuche")+ConfigHelper.getLangIniString("fpunkte"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private void openpdfaction(){
|
||||||
|
int selected = 0;
|
||||||
|
if(this.openpdf.isSelected()) selected = 1;
|
||||||
|
ConfigHelper.setIniInt(ConfigHelper.getStandartConfig(), "settings", "openpdf", selected);
|
||||||
|
}
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private void openmapaction(){
|
||||||
|
int selected = 0;
|
||||||
|
if(this.openmap.isSelected()) selected = 1;
|
||||||
|
ConfigHelper.setIniInt(ConfigHelper.getStandartConfig(), "settings", "openmap", selected);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void deselectAll(){
|
private void deselectAll(){
|
||||||
|
@ -195,48 +195,59 @@ public class ViewModel {
|
|||||||
* Bearbeitet einen gewählten Log eintrag
|
* Bearbeitet einen gewählten Log eintrag
|
||||||
*/
|
*/
|
||||||
public void editLog(){
|
public void editLog(){
|
||||||
AtomicReference<Tour> tourAkt = new AtomicReference<>();
|
System.out.println(this.selectedLog);
|
||||||
AtomicReference<Log> logAkt = new AtomicReference<>();
|
if(this.selectedTour != null) {
|
||||||
this.tourData.forEach(tourd -> {
|
if(this.selectedLog != null) {
|
||||||
if(tourd.getName().equals(this.selectedTour.getName())) {
|
AtomicReference<Tour> tourAkt = new AtomicReference<>();
|
||||||
tourd.getLogs().forEach(log -> {
|
AtomicReference<Log> logAkt = new AtomicReference<>();
|
||||||
if(this.selectedLog.getId().equals(log.getId())){
|
this.tourData.forEach(tourd -> {
|
||||||
logAkt.set(log);
|
if (tourd.getName().equals(this.selectedTour.getName())) {
|
||||||
tourAkt.set(tourd);
|
tourd.getLogs().forEach(log -> {
|
||||||
|
if (this.selectedLog.getId().equals(log.getId())) {
|
||||||
|
logAkt.set(log);
|
||||||
|
tourAkt.set(tourd);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
double dauer = dauerInput(this.selectedLog.getDauer());
|
||||||
});
|
double strecke = -1;
|
||||||
double dauer = dauerInput(this.selectedLog.getDauer());
|
double pause = -1.0;
|
||||||
double strecke = -1;
|
double hightmeter = -1.0;
|
||||||
double pause = -1.0;
|
boolean bemerkung = false;
|
||||||
double hightmeter = -1.0;
|
LocalDate datum = null;
|
||||||
boolean bemerkung = false;
|
if (dauer >= 0) {
|
||||||
LocalDate datum = null;
|
strecke = streckeInput(this.selectedLog.getStrecke() + "");
|
||||||
if (dauer >= 0) {
|
if (strecke >= 0) {
|
||||||
strecke = streckeInput(this.selectedLog.getStrecke() + "");
|
pause = pauseInput(this.selectedLog.getPause() + "");
|
||||||
if (strecke >= 0) {
|
if (pause >= 0.0) {
|
||||||
pause = pauseInput(this.selectedLog.getPause() + "");
|
hightmeter = hightmeterInput(this.selectedLog.getHightmeter() + "");
|
||||||
if(pause >= 0.0) {
|
if (hightmeter >= 0.0) {
|
||||||
hightmeter = hightmeterInput(this.selectedLog.getHightmeter() + "");
|
bemerkung = bemerkungInput(this.selectedLog.getBemerkung());
|
||||||
if (hightmeter >= 0.0) {
|
if (bemerkung) {
|
||||||
bemerkung = bemerkungInput(this.selectedLog.getBemerkung());
|
datum = dateInput(this.selectedLog.getDatum());
|
||||||
if (bemerkung) {
|
if (datum != null) {
|
||||||
datum = dateInput(this.selectedLog.getDatum());
|
Log newLog = new Log(this.selectedLog.getId(), dauer, datum, strecke, this.neueBemerkung, hightmeter, pause);
|
||||||
if (datum != null) {
|
this.logData.removeIf(ld -> ld.getId().equals(this.selectedLog.getId()));
|
||||||
Log newLog = new Log(this.selectedLog.getId(), dauer, datum, strecke, this.neueBemerkung, hightmeter, pause);
|
this.logData.add(newLog);
|
||||||
this.logData.removeIf(ld -> ld.getId().equals(this.selectedLog.getId()));
|
|
||||||
this.logData.add(newLog);
|
|
||||||
// tourAkt.get().delLog(this.selectedLog.getId());
|
// tourAkt.get().delLog(this.selectedLog.getId());
|
||||||
// tourAkt.get().addLog(newLog);
|
// tourAkt.get().addLog(newLog);
|
||||||
this.tourData.removeIf(td -> td.getName().equals(this.selectedTour.getName()));
|
this.tourData.removeIf(td -> td.getName().equals(this.selectedTour.getName()));
|
||||||
this.tourData.add(tourAkt.get());
|
this.tourData.add(tourAkt.get());
|
||||||
TourPlaner.editLog(this.selectedTour.getName(), newLog);
|
TourPlaner.editLog(this.selectedTour.getName(), newLog);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
//Kein log
|
||||||
|
AlertHelper.warn(ConfigHelper.getLangIniString("achtung"), ConfigHelper.getLangIniString("keinlogselected"), ConfigHelper.getLangIniString("keinlogselectedmsg"));
|
||||||
}
|
}
|
||||||
|
}else {
|
||||||
|
//Keine Tour
|
||||||
|
AlertHelper.warn(ConfigHelper.getLangIniString("achtung"), ConfigHelper.getLangIniString("keinetourselected"), ConfigHelper.getLangIniString("deltournoselectmsg"));
|
||||||
}
|
}
|
||||||
this.neueBemerkung = null;
|
this.neueBemerkung = null;
|
||||||
}
|
}
|
||||||
@ -406,8 +417,8 @@ public class ViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ObservableList<Log> getLogData() {
|
public ObservableList<Log> getLogData() {
|
||||||
logData.removeAll();
|
logData.removeIf(s -> true);
|
||||||
logData.addAll(TourPlaner.getLogs(this.selectedTour.getName()));
|
if(this.selectedTour != null) logData.addAll(TourPlaner.getLogs(this.selectedTour.getName()));
|
||||||
return logData;
|
return logData;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -500,16 +511,18 @@ public class ViewModel {
|
|||||||
* Entfernt eine Tour anhand der ausgewählten Tour
|
* Entfernt eine Tour anhand der ausgewählten Tour
|
||||||
*/
|
*/
|
||||||
public void delTour(){
|
public void delTour(){
|
||||||
try {
|
if (this.selectedTour != null) {
|
||||||
String tourname = this.selectedTour.getName();
|
String tourname = this.selectedTour.getName();
|
||||||
tourData.removeIf(s -> s.getName().equals(tourname));
|
try {
|
||||||
tourNamen.removeIf(s -> s.equals(tourname));
|
tourData.removeIf(s -> s.getName().equals(tourname));
|
||||||
logData.removeIf(s -> true);
|
tourNamen.removeIf(s -> s.equals(tourname));
|
||||||
setSelectedTour(null);
|
logData.removeIf(s -> true);
|
||||||
TourPlaner.delTour(tourname);
|
TourPlaner.delTour(tourname);
|
||||||
}catch (NullPointerException e){
|
setSelectedTour(null);
|
||||||
LogHelper.error(ConfigHelper.getLangIniString("keinetourselected"),
|
} catch (NullPointerException e) {
|
||||||
ConfigHelper.getLangIniString("deltournoselect"));
|
LogHelper.error(e);
|
||||||
|
}
|
||||||
|
}else {
|
||||||
AlertHelper.warn(ConfigHelper.getLangIniString("achtung"),
|
AlertHelper.warn(ConfigHelper.getLangIniString("achtung"),
|
||||||
ConfigHelper.getLangIniString("keinetourselected"),
|
ConfigHelper.getLangIniString("keinetourselected"),
|
||||||
ConfigHelper.getLangIniString("deltournoselectmsg"));
|
ConfigHelper.getLangIniString("deltournoselectmsg"));
|
||||||
@ -612,7 +625,6 @@ public class ViewModel {
|
|||||||
*/
|
*/
|
||||||
public void exportData(){
|
public void exportData(){
|
||||||
String file = AlertHelper.fileChooser("Exportiere");
|
String file = AlertHelper.fileChooser("Exportiere");
|
||||||
System.out.println("EXPORT: " + file);
|
|
||||||
if(file != null){
|
if(file != null){
|
||||||
try {
|
try {
|
||||||
new Exporter(file).doExport();
|
new Exporter(file).doExport();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user