Compare commits
	
		
			6 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 0402252029 | |||
| f45e890fdd | |||
| 34c11dd6ae | |||
| f189928634 | |||
| d92f538129 | |||
| f2aa9576ba | 
							
								
								
									
										28
									
								
								Doxyfile
									
									
									
									
									
								
							
							
						
						
									
										28
									
								
								Doxyfile
									
									
									
									
									
								
							@@ -38,27 +38,27 @@ PROJECT_NAME           = Tourplaner
 | 
			
		||||
# could be handy for archiving the generated documentation or if some version
 | 
			
		||||
# control system is used.
 | 
			
		||||
 | 
			
		||||
PROJECT_NUMBER         = 0.0.2
 | 
			
		||||
PROJECT_NUMBER         = 1
 | 
			
		||||
 | 
			
		||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
 | 
			
		||||
# for a project that appears at the top of each page and should give viewer a
 | 
			
		||||
# quick idea about the purpose of the project. Keep the description short.
 | 
			
		||||
 | 
			
		||||
PROJECT_BRIEF          = DGTP
 | 
			
		||||
PROJECT_BRIEF          = tpl
 | 
			
		||||
 | 
			
		||||
# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
 | 
			
		||||
# in the documentation. The maximum height of the logo should not exceed 55
 | 
			
		||||
# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
 | 
			
		||||
# the logo to the output directory.
 | 
			
		||||
 | 
			
		||||
PROJECT_LOGO           =
 | 
			
		||||
PROJECT_LOGO           = D:/FH_OFFLINE/tourplaner/logo_sm.png
 | 
			
		||||
 | 
			
		||||
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
 | 
			
		||||
# into which the generated documentation will be written. If a relative path is
 | 
			
		||||
# entered, it will be relative to the location where doxygen was started. If
 | 
			
		||||
# left blank the current directory will be used.
 | 
			
		||||
 | 
			
		||||
OUTPUT_DIRECTORY       = C:\Users\georg\OneDrive\FH\Swe\Tourplaner\doxygendoc
 | 
			
		||||
OUTPUT_DIRECTORY       = D:\FH_OFFLINE\tourplaner\doxygendoc
 | 
			
		||||
 | 
			
		||||
# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
 | 
			
		||||
# directories (in 2 levels) under the output directory of each output format and
 | 
			
		||||
@@ -864,7 +864,7 @@ WARN_LOGFILE           =
 | 
			
		||||
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
 | 
			
		||||
# Note: If this tag is empty the current directory is searched.
 | 
			
		||||
 | 
			
		||||
INPUT                  = C:\Users\georg\OneDrive\FH\Swe\Tourplaner\src\tourplaner
 | 
			
		||||
INPUT                  = D:\FH_OFFLINE\tourplaner\src
 | 
			
		||||
 | 
			
		||||
# This tag can be used to specify the character encoding of the source files
 | 
			
		||||
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
 | 
			
		||||
@@ -1304,7 +1304,7 @@ HTML_EXTRA_FILES       =
 | 
			
		||||
# Minimum value: 0, maximum value: 359, default value: 220.
 | 
			
		||||
# This tag requires that the tag GENERATE_HTML is set to YES.
 | 
			
		||||
 | 
			
		||||
HTML_COLORSTYLE_HUE    = 220
 | 
			
		||||
HTML_COLORSTYLE_HUE    = 359
 | 
			
		||||
 | 
			
		||||
# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
 | 
			
		||||
# in the HTML output. For a value of 0 the output will use grayscales only. A
 | 
			
		||||
@@ -1312,7 +1312,7 @@ HTML_COLORSTYLE_HUE    = 220
 | 
			
		||||
# Minimum value: 0, maximum value: 255, default value: 100.
 | 
			
		||||
# This tag requires that the tag GENERATE_HTML is set to YES.
 | 
			
		||||
 | 
			
		||||
HTML_COLORSTYLE_SAT    = 100
 | 
			
		||||
HTML_COLORSTYLE_SAT    = 0
 | 
			
		||||
 | 
			
		||||
# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
 | 
			
		||||
# luminance component of the colors in the HTML output. Values below 100
 | 
			
		||||
@@ -1323,7 +1323,7 @@ HTML_COLORSTYLE_SAT    = 100
 | 
			
		||||
# Minimum value: 40, maximum value: 240, default value: 80.
 | 
			
		||||
# This tag requires that the tag GENERATE_HTML is set to YES.
 | 
			
		||||
 | 
			
		||||
HTML_COLORSTYLE_GAMMA  = 80
 | 
			
		||||
HTML_COLORSTYLE_GAMMA  = 240
 | 
			
		||||
 | 
			
		||||
# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
 | 
			
		||||
# page will contain the date and time when the page was generated. Setting this
 | 
			
		||||
@@ -1582,7 +1582,7 @@ DISABLE_INDEX          = NO
 | 
			
		||||
# The default value is: NO.
 | 
			
		||||
# This tag requires that the tag GENERATE_HTML is set to YES.
 | 
			
		||||
 | 
			
		||||
GENERATE_TREEVIEW      = YES
 | 
			
		||||
GENERATE_TREEVIEW      = NO
 | 
			
		||||
 | 
			
		||||
# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
 | 
			
		||||
# doxygen will group on one line in the generated HTML documentation.
 | 
			
		||||
@@ -1790,7 +1790,7 @@ EXTRA_SEARCH_MAPPINGS  =
 | 
			
		||||
# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output.
 | 
			
		||||
# The default value is: YES.
 | 
			
		||||
 | 
			
		||||
GENERATE_LATEX         = YES
 | 
			
		||||
GENERATE_LATEX         = NO
 | 
			
		||||
 | 
			
		||||
# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
 | 
			
		||||
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
 | 
			
		||||
@@ -2050,7 +2050,7 @@ RTF_SOURCE_CODE        = NO
 | 
			
		||||
# classes and files.
 | 
			
		||||
# The default value is: NO.
 | 
			
		||||
 | 
			
		||||
GENERATE_MAN           = YES
 | 
			
		||||
GENERATE_MAN           = NO
 | 
			
		||||
 | 
			
		||||
# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a
 | 
			
		||||
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
 | 
			
		||||
@@ -2128,7 +2128,7 @@ XML_NS_MEMB_FILE_SCOPE = NO
 | 
			
		||||
# that can be used to generate PDF.
 | 
			
		||||
# The default value is: NO.
 | 
			
		||||
 | 
			
		||||
GENERATE_DOCBOOK       = YES
 | 
			
		||||
GENERATE_DOCBOOK       = NO
 | 
			
		||||
 | 
			
		||||
# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.
 | 
			
		||||
# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in
 | 
			
		||||
@@ -2336,7 +2336,7 @@ EXTERNAL_PAGES         = YES
 | 
			
		||||
# powerful graphs.
 | 
			
		||||
# The default value is: YES.
 | 
			
		||||
 | 
			
		||||
CLASS_DIAGRAMS         = YES
 | 
			
		||||
CLASS_DIAGRAMS         = NO
 | 
			
		||||
 | 
			
		||||
# You can include diagrams made with dia in doxygen documentation. Doxygen will
 | 
			
		||||
# then run dia to produce the diagram and insert it in the documentation. The
 | 
			
		||||
@@ -2358,7 +2358,7 @@ HIDE_UNDOC_RELATIONS   = YES
 | 
			
		||||
# set to NO
 | 
			
		||||
# The default value is: NO.
 | 
			
		||||
 | 
			
		||||
HAVE_DOT               = NO
 | 
			
		||||
HAVE_DOT               = YES
 | 
			
		||||
 | 
			
		||||
# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
 | 
			
		||||
# to run in parallel. When set to 0 doxygen will base this on the number of
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										16
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								README.md
									
									
									
									
									
								
							@@ -1,8 +1,16 @@
 | 
			
		||||
# Tourplaner
 | 
			
		||||
* JavaDoc: https://dergeorg.at/javadoc
 | 
			
		||||
* DoxygenDoc: https://dergeorg.at/doxygendoc/html
 | 
			
		||||
 | 
			
		||||
# Config
 | 
			
		||||
* DB informationen müssen in das config.ini.sample unter [db] eingetragen werden
 | 
			
		||||
* DB informationen müssen in das config.ini.sample unter ```[db]``` eingetragen werden
 | 
			
		||||
* Datei muss in config.ini umbenannt werden
 | 
			
		||||
* [langde] beinhaltet alle Deutschen Texte der Gui
 | 
			
		||||
* [start] beinhaltet den Title und infos die beim start verabeitet werden
 | 
			
		||||
* [hilfe] beinhaltet die Links zu den Hilfeseiten
 | 
			
		||||
* ```langde.ini``` beinhaltet alle Deutschen Texte der Gui
 | 
			
		||||
* ```langen.ini``` beinhaltet alle Englischen Texte der Gui
 | 
			
		||||
* Bei ```[map] -> key``` muss ein API Key zu Mapquest eingegeben werden
 | 
			
		||||
* Bei ```[report] -> path``` kann der Path eingestellt werden, wo die Reports gespeichert werden
 | 
			
		||||
* Bei ```[map] -> path``` kann der Path eingestellt werden, wo die Maps gespeichert werden
 | 
			
		||||
 | 
			
		||||
# UML
 | 
			
		||||
```[UML.svg]``` (https://git.dergeorg.at/dergeorg/tourplaner/src/branch/master/uml.svg)
 | 
			
		||||

 | 
			
		||||
@@ -9,6 +9,7 @@ import java.io.IOException;
 | 
			
		||||
 */
 | 
			
		||||
public class DirectionMap {
 | 
			
		||||
    private double dauer, strecke;
 | 
			
		||||
    private String sessionId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Holt die Map als image und alle Daten zur berechneten Route
 | 
			
		||||
@@ -19,13 +20,13 @@ public class DirectionMap {
 | 
			
		||||
     * @throws IOException Fehler beim Image der Map
 | 
			
		||||
     */
 | 
			
		||||
    public DirectionMap (String start, String ende, String tourname) throws IOException {
 | 
			
		||||
        Image map = getMap(start, ende, ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "map", "size"));
 | 
			
		||||
        Image mappdf = getMap(start, ende, ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "map", "sizePdf"));
 | 
			
		||||
        getDirections(start, ende);
 | 
			
		||||
        Image map = getMap(ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "map", "size"));
 | 
			
		||||
        Image mappdf = getMap(ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "map", "sizePdf"));
 | 
			
		||||
        String file = ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "map", "path") + tourname + ".jpg";
 | 
			
		||||
        String filepdf = ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "map", "path") + tourname + "_pdf.jpg";
 | 
			
		||||
        FileHelper.saveImage(map, "jpg", new File(file));
 | 
			
		||||
        FileHelper.saveImage(mappdf, "jpg", new File(filepdf));
 | 
			
		||||
        getDirections(start, ende);
 | 
			
		||||
        if(ConfigHelper.getIniInt(ConfigHelper.getStandartConfig(), "settings", "openmap") == 1) {
 | 
			
		||||
            FileHelper.openDefault(file);
 | 
			
		||||
        }
 | 
			
		||||
@@ -54,8 +55,8 @@ public class DirectionMap {
 | 
			
		||||
     * @return Image von der Map
 | 
			
		||||
     * @throws IOException Fehler beim Get der Map
 | 
			
		||||
     */
 | 
			
		||||
    private Image getMap(String start, String ende, String size) throws IOException {
 | 
			
		||||
        return HttpHelper.httpGetImage("https://www.mapquestapi.com/staticmap/v5/map?start="+start+"&end="+ende+"&size="+size+"&key="+ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "map", "key"));
 | 
			
		||||
    private Image getMap(String size) throws IOException {
 | 
			
		||||
        return HttpHelper.httpGetImage("https://www.mapquestapi.com/staticmap/v5/map?session="+this.sessionId+"&size="+size+"&key="+ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "map", "key"));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
@@ -65,12 +66,10 @@ public class DirectionMap {
 | 
			
		||||
     * @throws IOException Fehler beim besorgen der infos über die Tour
 | 
			
		||||
     */
 | 
			
		||||
    private void getDirections(String start, String ende) throws IOException {
 | 
			
		||||
        System.out.println("LOCS: " + start + ende);
 | 
			
		||||
        String json = HttpHelper.httpGetJsonString("https://www.mapquestapi.com/directions/v2/route?key="+ ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "map", "key")+"&from="+start+"&to="+ende+"&outFormat=json&ambiguities=ignore&routeType=fastest&doReverseGeocode=false&enhancedNarrative=false&avoidTimedConditions=false");
 | 
			
		||||
        System.out.println("JSON: " + json);
 | 
			
		||||
        System.out.println("URL https://www.mapquestapi.com/directions/v2/route?key="+ ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "map", "key")+"&from="+start+"&to="+ende+"&outFormat=json&ambiguities=ignore&routeType=fastest&doReverseGeocode=false&enhancedNarrative=false&avoidTimedConditions=false");
 | 
			
		||||
        this.strecke = JsonHelper.getDoubleFromJson(json, "distance");
 | 
			
		||||
        this.dauer = formatetTimeToMinutes(JsonHelper.getStingFromJson(json, "formattedTime"));
 | 
			
		||||
        this.sessionId = JsonHelper.getStingFromJson(json, "sessionId");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 
 | 
			
		||||
@@ -50,19 +50,25 @@ public class Exporter {
 | 
			
		||||
        try {
 | 
			
		||||
            ArrayList<Tour> touren = JsonHelper.getTourenFromJson(new FileReader(EinheitenAdder.addJson(this.path)));
 | 
			
		||||
            DbConnect dbConnect = new DbConnect();
 | 
			
		||||
            dbConnect.delAllData();
 | 
			
		||||
            progressBar.addProgress(5);
 | 
			
		||||
            int size = progressBar.getProgressSize(touren.size() * 3, 100);
 | 
			
		||||
            ArrayList<Tour> allTours = dbConnect.getAllTouren();
 | 
			
		||||
            progressBar.addProgress(2);
 | 
			
		||||
            int size = progressBar.getProgressSize(allTours.size(), 25);
 | 
			
		||||
            allTours.forEach(t -> {
 | 
			
		||||
                TourPlaner.delTour(t.getName());
 | 
			
		||||
                progressBar.addProgress(size);
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            int finalSize = progressBar.getProgressSize(touren.size() * 3, 100);
 | 
			
		||||
            for (Tour tour: touren) {
 | 
			
		||||
                    new DirectionMap(tour.getStart(), tour.getZiel(), tour.getName());
 | 
			
		||||
                progressBar.addProgress(size);
 | 
			
		||||
                progressBar.addProgress(finalSize);
 | 
			
		||||
                dbConnect.addTour(tour);
 | 
			
		||||
                progressBar.addProgress(size);
 | 
			
		||||
                progressBar.addProgress(finalSize);
 | 
			
		||||
                ArrayList<Log> logs = tour.getLogs();
 | 
			
		||||
                for (Log log:logs) {
 | 
			
		||||
                    dbConnect.addLog(tour.getName(), log);
 | 
			
		||||
                }
 | 
			
		||||
                progressBar.addProgress(size);
 | 
			
		||||
                progressBar.addProgress(finalSize);
 | 
			
		||||
            }
 | 
			
		||||
        } catch (IOException e) {
 | 
			
		||||
            LogHelper.error(e);
 | 
			
		||||
 
 | 
			
		||||
@@ -40,6 +40,7 @@ public class Reporter {
 | 
			
		||||
            Document document = new Document();
 | 
			
		||||
            PdfWriter.getInstance(document, new FileOutputStream(file));
 | 
			
		||||
            document.open();
 | 
			
		||||
            addMetaData(document, new Tour("Summary", "String dauer", "String mapJson", 1, "String start", "String ziel"));
 | 
			
		||||
            addSumRepo(document, tours);
 | 
			
		||||
 | 
			
		||||
            document.close();
 | 
			
		||||
@@ -173,6 +174,7 @@ public class Reporter {
 | 
			
		||||
            subCatPart.add(new Paragraph(EinheitenAdder.addKm(ConfigHelper.getLangIniString("logstrecke") + " " + log.getStrecke())));
 | 
			
		||||
            subCatPart.add(new Paragraph(EinheitenAdder.addMeter(ConfigHelper.getLangIniString("loghight") + " " + log.getHightmeter())));
 | 
			
		||||
            subCatPart.add(new Paragraph(ConfigHelper.getLangIniString("logbemerkung") + " " + log.getBemerkung()));
 | 
			
		||||
            subCatPart.add(new Paragraph( "Rating " + log.getRating()));
 | 
			
		||||
        }
 | 
			
		||||
        // now add all this to the document
 | 
			
		||||
        document.add(catPart);
 | 
			
		||||
 
 | 
			
		||||
@@ -10,6 +10,7 @@ import java.awt.*;
 | 
			
		||||
import java.io.File;
 | 
			
		||||
import java.io.IOException;
 | 
			
		||||
import java.util.ArrayList;
 | 
			
		||||
import java.util.Locale;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Haupt Logik des Tourplaners
 | 
			
		||||
@@ -59,14 +60,9 @@ public class TourPlaner{
 | 
			
		||||
     * @return false bei error
 | 
			
		||||
     */
 | 
			
		||||
    public static boolean delTour(String tourname){
 | 
			
		||||
        ProgressBar progressBar = new ProgressBar("Del...");
 | 
			
		||||
        int step = progressBar.getProgressSize(3, 100);
 | 
			
		||||
        FileHelper.delFile(new File(getImagePath(tourname)));
 | 
			
		||||
        progressBar.addProgress(step);
 | 
			
		||||
        FileHelper.delFile(new File(getImagePdfPath(tourname)));
 | 
			
		||||
        progressBar.addProgress(step);
 | 
			
		||||
        boolean ret = new DbConnect().delTour(tourname);
 | 
			
		||||
        progressBar.setProgress(100);
 | 
			
		||||
        return ret;
 | 
			
		||||
    }
 | 
			
		||||
    /**
 | 
			
		||||
@@ -172,10 +168,22 @@ public class TourPlaner{
 | 
			
		||||
    public static ArrayList<Tour> sucheTour(String tourname){
 | 
			
		||||
        ArrayList<Tour> touren = new ArrayList<>();
 | 
			
		||||
        getAllTours().forEach(t ->{
 | 
			
		||||
            if(t.getName().contains(tourname)){
 | 
			
		||||
            ArrayList<Log> logs = t.getLogs();
 | 
			
		||||
            ArrayList<String> bemerkungen = new ArrayList<>();
 | 
			
		||||
            for (Log l:logs) {
 | 
			
		||||
                bemerkungen.add(l.getBemerkung().toLowerCase(Locale.ROOT));
 | 
			
		||||
            }
 | 
			
		||||
            bemerkungen.forEach(b -> {
 | 
			
		||||
                if(b.contains(tourname.toLowerCase(Locale.ROOT))){
 | 
			
		||||
                    touren.add(t);
 | 
			
		||||
                }
 | 
			
		||||
            });
 | 
			
		||||
            if(bemerkungen.contains(tourname.toLowerCase()) || t.getZiel().toLowerCase(Locale.ROOT).contains(tourname.toLowerCase()) || t.getName().toLowerCase(Locale.ROOT).contains(tourname.toLowerCase()) || t.getStart().toLowerCase(Locale.ROOT).contains(tourname.toLowerCase())){
 | 
			
		||||
                if(!touren.contains(t)) {
 | 
			
		||||
                    touren.add(t);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        });
 | 
			
		||||
        return touren;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -27,15 +27,12 @@ public class DbConnect {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Erstellt alle Tabellen die für den Betrieb der Software bennötigt werden
 | 
			
		||||
     * @return True bei erfolg, sonst error
 | 
			
		||||
     */
 | 
			
		||||
    public boolean init() {
 | 
			
		||||
        ArrayList<Boolean> errors = new ArrayList<>();
 | 
			
		||||
        errors.add(PostgresHelper.executeUpdateMessage("create table tour ( tourname varchar not null, dauer decimal, mapjson varchar, start varchar, ziel varchar, strecke decimal);", "Tour Table created"));
 | 
			
		||||
        errors.add(PostgresHelper.executeUpdateMessage("create unique index tour_tourname_uindex on tour (tourname);", "Tour Table unique created"));
 | 
			
		||||
        errors.add(PostgresHelper.executeUpdateMessage("alter table tour add constraint tour_pk primary key (tourname);", "Tour Table primary created"));
 | 
			
		||||
        errors.add(PostgresHelper.executeUpdateMessage("create table log(tourname varchar constraint log_tour_tourname_fk references tour,id varchar,bemerkung varchar,datum date,strecke decimal,avg decimal,hightmeter decimal,pause decimal,gegangen decimal,dauer decimal,rating varchar);", "Log Table created"));
 | 
			
		||||
        return !errors.contains(false);
 | 
			
		||||
    public void init() {
 | 
			
		||||
        PostgresHelper.executeUpdateNoLog("create table tour ( tourname varchar not null, dauer decimal, mapjson varchar, start varchar, ziel varchar, strecke decimal);");
 | 
			
		||||
        PostgresHelper.executeUpdateNoLog("create unique index tour_tourname_uindex on tour (tourname);");
 | 
			
		||||
        PostgresHelper.executeUpdateNoLog("alter table tour add constraint tour_pk primary key (tourname);");
 | 
			
		||||
        PostgresHelper.executeUpdateNoLog("create table log(tourname varchar constraint log_tour_tourname_fk references tour,id varchar,bemerkung varchar,datum date,strecke decimal,avg decimal,hightmeter decimal,pause decimal,gegangen decimal,dauer decimal,rating varchar);");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -125,7 +122,7 @@ public class DbConnect {
 | 
			
		||||
            this.c.close();
 | 
			
		||||
            return logs;
 | 
			
		||||
        } catch (Exception e) {
 | 
			
		||||
            System.err.println(e.getClass().getName() + ": " + e.getMessage());
 | 
			
		||||
            LogHelper.error(e);
 | 
			
		||||
            return null;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
@@ -139,15 +136,13 @@ public class DbConnect {
 | 
			
		||||
     */
 | 
			
		||||
    public boolean addLog(String tourname, Log log){
 | 
			
		||||
        if(Double.isInfinite(log.getAvgspeed())) log.setAvgspeed(-1.0);
 | 
			
		||||
        System.out.println("INSERT INTO public.log (tourname, id, bemerkung, datum, strecke, avg, hightmeter, pause, gegangen, dauer, rating) VALUES ('"+tourname+"', '"+log.getId()+"', '"+log.getBemerkung()+"', '"+log.getDatum()+"', "
 | 
			
		||||
                +log.getStrecke()+", "+log.getAvgspeed()+", "+log.getHightmeter()+", "+log.getPause()+", "+log.getGegangen()+", "+log.getDauer()+",'"+log.getRating()+"')");
 | 
			
		||||
        return PostgresHelper.executeUpdate("INSERT INTO public.log (tourname, id, bemerkung, datum, strecke, avg, hightmeter, pause, gegangen, dauer, rating) VALUES ('"+tourname+"', '"+log.getId()+"', '"+log.getBemerkung()+"', '"+log.getDatum()+"', "
 | 
			
		||||
                +log.getStrecke()+", "+log.getAvgspeed()+", "+log.getHightmeter()+", "+log.getPause()+", "+log.getGegangen()+", "+log.getDauer()+",'"+log.getRating()+"')");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public boolean editLog(String tourname, Log log){
 | 
			
		||||
        return PostgresHelper.executeUpdate("UPDATE public.log SET bemerkung = '"+log.getBemerkung()+"', datum = '"+log.getDatum()+"', strecke = "+log.getStrecke()+", avg = "+log.getAvgspeed()+", hightmeter = "+
 | 
			
		||||
                log.getHightmeter()+", pause = "+log.getPause()+", gegangen = "+log.getGegangen()+", dauer = "+log.getDauer()+" WHERE tourname = '"+tourname+"' and id = '"+log.getId()+"', rating = '"+log.getRating()+"'");
 | 
			
		||||
                log.getHightmeter()+", pause = "+log.getPause()+", gegangen = "+log.getGegangen()+", dauer = "+log.getDauer()+", rating = '"+log.getRating()+"' WHERE tourname = '"+tourname+"' and id = '"+log.getId()+"'");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public boolean delLog(String tourname, String id){
 | 
			
		||||
@@ -244,7 +239,7 @@ public class DbConnect {
 | 
			
		||||
            this.c.close();
 | 
			
		||||
            return touren;
 | 
			
		||||
        } catch (Exception e) {
 | 
			
		||||
            System.err.println(e.getClass().getName() + ": " + e.getMessage());
 | 
			
		||||
            LogHelper.error(e);
 | 
			
		||||
            return null;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -6,6 +6,7 @@ import tourplaner.business.LogHelper;
 | 
			
		||||
 | 
			
		||||
import java.sql.Connection;
 | 
			
		||||
import java.sql.DriverManager;
 | 
			
		||||
import java.sql.SQLException;
 | 
			
		||||
import java.sql.Statement;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
@@ -20,8 +21,6 @@ public class PostgresHelper {
 | 
			
		||||
        Connection c = null;
 | 
			
		||||
        try {
 | 
			
		||||
            Class.forName("org.postgresql.Driver");
 | 
			
		||||
            System.out.println("jdbc:postgresql://" + ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "db", "url") + ":" + ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "db", "port") + "/" + ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "db", "dbname")+
 | 
			
		||||
                    ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "db", "user")+ ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "db", "pw"));
 | 
			
		||||
            c = DriverManager
 | 
			
		||||
                    .getConnection("jdbc:postgresql://" + ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "db", "url") + ":" + ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "db", "port") + "/" + ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "db", "dbname"),
 | 
			
		||||
                            ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "db", "user"), ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "db", "pw"));
 | 
			
		||||
@@ -48,17 +47,38 @@ public class PostgresHelper {
 | 
			
		||||
     * @return True bei erfolg, sonst false
 | 
			
		||||
     */
 | 
			
		||||
    public static boolean executeUpdate(String sql){
 | 
			
		||||
        Connection c = con();
 | 
			
		||||
        Statement stmt;
 | 
			
		||||
        try {
 | 
			
		||||
            stmt = c.createStatement();
 | 
			
		||||
            stmt.executeUpdate(sql);
 | 
			
		||||
            stmt.close();
 | 
			
		||||
            c.close();
 | 
			
		||||
        } catch (Exception e) {
 | 
			
		||||
            exUpdate(sql);
 | 
			
		||||
        } catch (SQLException e) {
 | 
			
		||||
            LogHelper.error(e.getMessage(), e.getClass().getName());
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Führt ein Sql statement ohne rückgabe aus
 | 
			
		||||
     * @param sql Sql command
 | 
			
		||||
     * @return True bei erfolg, sonst false
 | 
			
		||||
     * @throws SQLException Fehler beim ausführen
 | 
			
		||||
     */
 | 
			
		||||
    private static boolean exUpdate(String sql) throws SQLException {
 | 
			
		||||
        Connection c = con();
 | 
			
		||||
        Statement stmt;
 | 
			
		||||
        stmt = c.createStatement();
 | 
			
		||||
        stmt.executeUpdate(sql);
 | 
			
		||||
        stmt.close();
 | 
			
		||||
        c.close();
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    public static boolean executeUpdateNoLog(String sql){
 | 
			
		||||
        try {
 | 
			
		||||
            exUpdate(sql);
 | 
			
		||||
            return true;
 | 
			
		||||
        }catch (Exception e){
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -39,101 +39,76 @@
 | 
			
		||||
<?import javafx.scene.paint.*?>
 | 
			
		||||
<?import javafx.scene.text.*?>
 | 
			
		||||
 | 
			
		||||
<VBox prefHeight="600.0" prefWidth="900.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1"
 | 
			
		||||
      fx:controller="tourplaner.ui.TourplanerController">
 | 
			
		||||
<VBox prefHeight="600.0" prefWidth="900.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="tourplaner.ui.TourplanerController">
 | 
			
		||||
    <MenuBar VBox.vgrow="NEVER">
 | 
			
		||||
        <Menu fx:id="menueFile" mnemonicParsing="false" text="Datei">
 | 
			
		||||
            <MenuItem fx:id="reportsummary" mnemonicParsing="false" onAction="#reportSum" text="Report Summary"/>
 | 
			
		||||
            <MenuItem fx:id="tourreport" mnemonicParsing="false" onAction="#tourReport" text="Tour Report"/>
 | 
			
		||||
            <MenuItem fx:id="beendenButton" mnemonicParsing="false" onAction="#quitApp" text="Beenden"/>
 | 
			
		||||
            <MenuItem fx:id="reportsummary" mnemonicParsing="false" onAction="#reportSum" text="Report Summary" />
 | 
			
		||||
            <MenuItem fx:id="tourreport" mnemonicParsing="false" onAction="#tourReport" text="Tour Report" />
 | 
			
		||||
            <MenuItem fx:id="beendenButton" mnemonicParsing="false" onAction="#quitApp" text="Beenden" />
 | 
			
		||||
        </Menu>
 | 
			
		||||
        <Menu fx:id="menuebearbeiten" mnemonicParsing="false" text="Bearbeiten">
 | 
			
		||||
            <MenuItem fx:id="menueimport" mnemonicParsing="false" onAction="#importBtn" text="Import"/>
 | 
			
		||||
            <MenuItem fx:id="menueexport" mnemonicParsing="false" onAction="#exportBtn" text="Export"/>
 | 
			
		||||
            <MenuItem fx:id="menueimport" mnemonicParsing="false" onAction="#importBtn" text="Import" />
 | 
			
		||||
            <MenuItem fx:id="menueexport" mnemonicParsing="false" onAction="#exportBtn" text="Export" />
 | 
			
		||||
        </Menu>
 | 
			
		||||
        <Menu fx:id="menueoptionen" mnemonicParsing="false" text="Optionen">
 | 
			
		||||
            <CheckMenuItem fx:id="openmap" mnemonicParsing="false" onAction="#openmapaction"
 | 
			
		||||
                           text="Map automatisch öffnen"/>
 | 
			
		||||
            <CheckMenuItem fx:id="openpdf" mnemonicParsing="false" onAction="#openpdfaction"
 | 
			
		||||
                           text="Report automatisch öffnen"/>
 | 
			
		||||
            <CheckMenuItem fx:id="openmap" mnemonicParsing="false" onAction="#openmapaction" text="Map automatisch öffnen" />
 | 
			
		||||
            <CheckMenuItem fx:id="openpdf" mnemonicParsing="false" onAction="#openpdfaction" text="Report automatisch öffnen" />
 | 
			
		||||
            <Menu fx:id="menuesprachen" mnemonicParsing="false" text="Sprache">
 | 
			
		||||
                <RadioMenuItem fx:id="langdeutsch" mnemonicParsing="false" onAction="#onlangdeutsch"
 | 
			
		||||
                               text="Deutsch"/>
 | 
			
		||||
                <RadioMenuItem fx:id="langenglisch" mnemonicParsing="false" onAction="#onlangenglisch"
 | 
			
		||||
                               text="Englisch"/>
 | 
			
		||||
                <RadioMenuItem fx:id="langdeutsch" mnemonicParsing="false" onAction="#onlangdeutsch" text="Deutsch" />
 | 
			
		||||
                <RadioMenuItem fx:id="langenglisch" mnemonicParsing="false" onAction="#onlangenglisch" text="Englisch" />
 | 
			
		||||
            </Menu>
 | 
			
		||||
        </Menu>
 | 
			
		||||
        <Menu fx:id="menuehilfe" mnemonicParsing="false" text="Hilfe">
 | 
			
		||||
            <MenuItem mnemonicParsing="false" onAction="#gitWebBrowser" text="Git Repo"/>
 | 
			
		||||
            <MenuItem mnemonicParsing="false" onAction="#javaDocBrowser" text="JavaDoc"/>
 | 
			
		||||
            <MenuItem mnemonicParsing="false" onAction="#doxygenDocBrowser" text="Doxygen Doc"/>
 | 
			
		||||
            <MenuItem mnemonicParsing="false" onAction="#gitWebBrowser" text="Git Repo" />
 | 
			
		||||
            <MenuItem mnemonicParsing="false" onAction="#javaDocBrowser" text="JavaDoc" />
 | 
			
		||||
            <MenuItem mnemonicParsing="false" onAction="#doxygenDocBrowser" text="Doxygen Doc" />
 | 
			
		||||
        </Menu>
 | 
			
		||||
    </MenuBar>
 | 
			
		||||
    <HBox id="HBox" alignment="CENTER_LEFT" layoutX="10.0" layoutY="588.0" spacing="5.0">
 | 
			
		||||
        <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" />
 | 
			
		||||
        </padding>
 | 
			
		||||
        <AnchorPane HBox.hgrow="ALWAYS">
 | 
			
		||||
            <Button fx:id="tourAdd" layoutX="58.0" mnemonicParsing="false" onAction="#addTour" text="+"/>
 | 
			
		||||
            <Label layoutX="14.0" layoutY="4.0" text="Tours"/>
 | 
			
		||||
            <Button fx:id="tourDel" layoutX="89.0" mnemonicParsing="false" onAction="#delTour" text="-"/>
 | 
			
		||||
            <Button fx:id="editTourBtn" layoutX="117.0" mnemonicParsing="false" onAction="#editTourBtn"
 | 
			
		||||
                    text="Edit"/>
 | 
			
		||||
            <Button fx:id="tourAdd" layoutX="58.0" mnemonicParsing="false" onAction="#addTour" text="+" />
 | 
			
		||||
            <Label layoutX="14.0" layoutY="4.0" text="Tours" />
 | 
			
		||||
            <Button fx:id="tourDel" layoutX="89.0" mnemonicParsing="false" onAction="#delTour" text="-" />
 | 
			
		||||
            <Button fx:id="editTourBtn" layoutX="117.0" mnemonicParsing="false" onAction="#editTourBtn" text="Edit" />
 | 
			
		||||
        </AnchorPane>
 | 
			
		||||
        <TextField fx:id="sucheInput" promptText="Suche..."/>
 | 
			
		||||
        <Button fx:id="sucheButton" mnemonicParsing="false" onAction="#suche" text="Suchen"/>
 | 
			
		||||
        <TextField fx:id="sucheInput" onKeyPressed="#sucheEnter" promptText="Suche..." />
 | 
			
		||||
        <Button fx:id="sucheButton" mnemonicParsing="false" onAction="#suche" text="Suchen" />
 | 
			
		||||
    </HBox>
 | 
			
		||||
    <SplitPane dividerPositions="0.060133630289532294" focusTraversable="true" prefHeight="522.0" prefWidth="300.0"
 | 
			
		||||
               VBox.vgrow="ALWAYS">
 | 
			
		||||
    <SplitPane dividerPositions="0.060133630289532294" focusTraversable="true" prefHeight="522.0" prefWidth="300.0" VBox.vgrow="ALWAYS">
 | 
			
		||||
        <AnchorPane prefWidth="239.0">
 | 
			
		||||
            <ListView fx:id="TourListView" layoutX="-1.0" onMouseClicked="#tourListSelectedItem" prefHeight="520.0"
 | 
			
		||||
                      prefWidth="190.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0"
 | 
			
		||||
                      AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"/>
 | 
			
		||||
            <ListView fx:id="TourListView" layoutX="-1.0" onMouseClicked="#tourListSelectedItem" prefHeight="520.0" prefWidth="190.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
 | 
			
		||||
        </AnchorPane>
 | 
			
		||||
        <SplitPane dividerPositions="0.5" orientation="VERTICAL" prefHeight="496.0" prefWidth="620.0">
 | 
			
		||||
            <VBox prefWidth="100.0">
 | 
			
		||||
                <AnchorPane prefWidth="676.0">
 | 
			
		||||
                    <HBox id="HBox" alignment="CENTER_LEFT" prefHeight="7.0" prefWidth="44.0" spacing="5.0"
 | 
			
		||||
                          AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0"
 | 
			
		||||
                          AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
 | 
			
		||||
                    <HBox id="HBox" alignment="CENTER_LEFT" prefHeight="7.0" prefWidth="44.0" spacing="5.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
 | 
			
		||||
                        <Label text="Title:">
 | 
			
		||||
                            <HBox.margin>
 | 
			
		||||
                                <Insets left="10.0"/>
 | 
			
		||||
                                <Insets left="10.0" />
 | 
			
		||||
                            </HBox.margin>
 | 
			
		||||
                        </Label>
 | 
			
		||||
                        <TextField fx:id="titleTextView" editable="false"/>
 | 
			
		||||
                        <TextField fx:id="titleTextView" editable="false" />
 | 
			
		||||
                    </HBox>
 | 
			
		||||
                </AnchorPane>
 | 
			
		||||
                <AnchorPane prefWidth="200.0">
 | 
			
		||||
                    <TabPane fx:id="viewTabPane" layoutX="1.0" layoutY="69.0" prefWidth="702.0"
 | 
			
		||||
                             tabClosingPolicy="UNAVAILABLE" AnchorPane.bottomAnchor="-67.0"
 | 
			
		||||
                             AnchorPane.leftAnchor="1.0" AnchorPane.rightAnchor="1.0"
 | 
			
		||||
                             AnchorPane.topAnchor="0.0">
 | 
			
		||||
                    <TabPane fx:id="viewTabPane" layoutX="1.0" layoutY="69.0" prefWidth="702.0" tabClosingPolicy="UNAVAILABLE" AnchorPane.bottomAnchor="-67.0" AnchorPane.leftAnchor="1.0" AnchorPane.rightAnchor="1.0" AnchorPane.topAnchor="0.0">
 | 
			
		||||
                        <Tab fx:id="kartenTab" text="Karte">
 | 
			
		||||
                            <AnchorPane>
 | 
			
		||||
                                <ImageView fx:id="mapImageView" pickOnBounds="true" preserveRatio="true"
 | 
			
		||||
                                           AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0"
 | 
			
		||||
                                           AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"/>
 | 
			
		||||
                                <ImageView fx:id="mapImageView" pickOnBounds="true" preserveRatio="true" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
 | 
			
		||||
                            </AnchorPane>
 | 
			
		||||
                        </Tab>
 | 
			
		||||
                        <Tab fx:id="beschreibungTab" text="Beschreibung">
 | 
			
		||||
                            <AnchorPane>
 | 
			
		||||
                                <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>
 | 
			
		||||
                                        <TableColumn fx:id="nameCol" minWidth="100.0" prefWidth="-1.0"
 | 
			
		||||
                                                     text="Tourname"/>
 | 
			
		||||
                                        <TableColumn fx:id="dauerCol" maxWidth="1.7976931348623157E308"
 | 
			
		||||
                                                     minWidth="100.0" prefWidth="-1.0" text="Dauer"/>
 | 
			
		||||
                                        <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="zielCol" maxWidth="1.7976931348623157E308"
 | 
			
		||||
                                                     minWidth="100.0" prefWidth="-1.0" text="Zielpunkt"/>
 | 
			
		||||
                                        <TableColumn fx:id="nameCol" minWidth="100.0" prefWidth="-1.0" text="Tourname" />
 | 
			
		||||
                                        <TableColumn fx:id="dauerCol" maxWidth="1.7976931348623157E308" minWidth="100.0" prefWidth="-1.0" text="Dauer" />
 | 
			
		||||
                                        <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="zielCol" maxWidth="1.7976931348623157E308" minWidth="100.0" prefWidth="-1.0" text="Zielpunkt" />
 | 
			
		||||
                                    </columns>
 | 
			
		||||
                                </TableView>
 | 
			
		||||
                            </AnchorPane>
 | 
			
		||||
@@ -142,62 +117,45 @@
 | 
			
		||||
                </AnchorPane>
 | 
			
		||||
            </VBox>
 | 
			
		||||
            <AnchorPane prefWidth="200.0">
 | 
			
		||||
                <VBox prefWidth="100.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0"
 | 
			
		||||
                      AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
 | 
			
		||||
                <VBox prefWidth="100.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
 | 
			
		||||
                    <AnchorPane>
 | 
			
		||||
                        <HBox id="HBox" alignment="CENTER_LEFT" layoutY="2.0" prefWidth="702.0"
 | 
			
		||||
                              spacing="5.0" AnchorPane.bottomAnchor="-2.0" AnchorPane.leftAnchor="0.0"
 | 
			
		||||
                              AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="2.0">
 | 
			
		||||
                        <HBox id="HBox" alignment="CENTER_LEFT" layoutY="2.0" prefWidth="702.0" spacing="5.0" AnchorPane.bottomAnchor="-2.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="2.0">
 | 
			
		||||
                            <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" />
 | 
			
		||||
                            </padding>
 | 
			
		||||
                            <Label text="Logs:">
 | 
			
		||||
                                <HBox.margin>
 | 
			
		||||
                                    <Insets left="10.0"/>
 | 
			
		||||
                                    <Insets left="10.0" />
 | 
			
		||||
                                </HBox.margin>
 | 
			
		||||
                            </Label>
 | 
			
		||||
                            <Button mnemonicParsing="false" onAction="#addLog" text="+"
 | 
			
		||||
                                    textAlignment="CENTER">
 | 
			
		||||
                            <Button mnemonicParsing="false" onAction="#addLog" text="+" textAlignment="CENTER">
 | 
			
		||||
                                <HBox.margin>
 | 
			
		||||
                                    <Insets/>
 | 
			
		||||
                                    <Insets />
 | 
			
		||||
                                </HBox.margin>
 | 
			
		||||
                            </Button>
 | 
			
		||||
                            <Button fx:id="logDel" mnemonicParsing="false" onAction="#delLog"
 | 
			
		||||
                                    prefWidth="21.0" text="-" textAlignment="CENTER">
 | 
			
		||||
                            <Button fx:id="logDel" mnemonicParsing="false" onAction="#delLog" prefWidth="21.0" text="-" textAlignment="CENTER">
 | 
			
		||||
                                <HBox.margin>
 | 
			
		||||
                                    <Insets/>
 | 
			
		||||
                                    <Insets />
 | 
			
		||||
                                </HBox.margin>
 | 
			
		||||
                            </Button>
 | 
			
		||||
                            <Button fx:id="editBtn" mnemonicParsing="false" onAction="#editLogBtn"
 | 
			
		||||
                                    text="Edit"/>
 | 
			
		||||
                            <Button fx:id="editBtn" mnemonicParsing="false" onAction="#editLogBtn" text="Edit" />
 | 
			
		||||
                        </HBox>
 | 
			
		||||
                    </AnchorPane>
 | 
			
		||||
                    <AnchorPane>
 | 
			
		||||
                        <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>
 | 
			
		||||
                                <TableColumn fx:id="logDatumCol" minWidth="-1.0" prefWidth="-1.0"
 | 
			
		||||
                                             text="Datum"/>
 | 
			
		||||
                                <TableColumn fx:id="logDauerCol" minWidth="-1.0" prefWidth="-1.0"
 | 
			
		||||
                                             text="Dauer"/>
 | 
			
		||||
                                <TableColumn fx:id="logStreckeCol" minWidth="-1.0" prefWidth="-1.0"
 | 
			
		||||
                                             text="Entfernung"/>
 | 
			
		||||
                                <TableColumn fx:id="logAvgCol" minWidth="-1.0" prefWidth="-1.0"
 | 
			
		||||
                                             text="AVG Geschwindigkeit"/>
 | 
			
		||||
                                <TableColumn fx:id="logHightCol" minWidth="-1.0" prefWidth="75.0"
 | 
			
		||||
                                             text="Höhenmeter"/>
 | 
			
		||||
                                <TableColumn fx:id="logPauseCol" minWidth="-1.0" prefWidth="-1.0"
 | 
			
		||||
                                             text="Davon Pause"/>
 | 
			
		||||
                                <TableColumn fx:id="logGegangenCol" minWidth="-1.0" prefWidth="-1.0"
 | 
			
		||||
                                             text="Davon Unterwegs"/>
 | 
			
		||||
                                <TableColumn fx:id="logBemerkungCol" minWidth="-1.0" prefWidth="-1.0"
 | 
			
		||||
                                             text="Bemerkung"/>
 | 
			
		||||
                                <TableColumn fx:id="logRatingCol1" minWidth="-1.0" prefWidth="-1.0"
 | 
			
		||||
                                             text="Rating"/>
 | 
			
		||||
                                <TableColumn fx:id="logDatumCol" minWidth="-1.0" prefWidth="-1.0" text="Datum" />
 | 
			
		||||
                                <TableColumn fx:id="logDauerCol" minWidth="-1.0" prefWidth="-1.0" text="Dauer" />
 | 
			
		||||
                                <TableColumn fx:id="logStreckeCol" minWidth="-1.0" prefWidth="-1.0" text="Entfernung" />
 | 
			
		||||
                                <TableColumn fx:id="logAvgCol" minWidth="-1.0" prefWidth="-1.0" text="AVG Geschwindigkeit" />
 | 
			
		||||
                                <TableColumn fx:id="logHightCol" minWidth="-1.0" prefWidth="75.0" text="Höhenmeter" />
 | 
			
		||||
                                <TableColumn fx:id="logPauseCol" minWidth="-1.0" prefWidth="-1.0" text="Davon Pause" />
 | 
			
		||||
                                <TableColumn fx:id="logGegangenCol" minWidth="-1.0" prefWidth="-1.0" text="Davon Unterwegs" />
 | 
			
		||||
                                <TableColumn fx:id="logBemerkungCol" minWidth="-1.0" prefWidth="-1.0" text="Bemerkung" />
 | 
			
		||||
                                <TableColumn fx:id="logRatingCol1" minWidth="-1.0" prefWidth="-1.0" text="Rating" />
 | 
			
		||||
                            </columns>
 | 
			
		||||
                            <columnResizePolicy>
 | 
			
		||||
                                <TableView fx:constant="CONSTRAINED_RESIZE_POLICY"/>
 | 
			
		||||
                                <TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
 | 
			
		||||
                            </columnResizePolicy>
 | 
			
		||||
                        </TableView>
 | 
			
		||||
                    </AnchorPane>
 | 
			
		||||
@@ -207,17 +165,17 @@
 | 
			
		||||
    </SplitPane>
 | 
			
		||||
    <HBox id="HBox" alignment="CENTER_LEFT" spacing="5.0" VBox.vgrow="NEVER">
 | 
			
		||||
        <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" />
 | 
			
		||||
        </padding>
 | 
			
		||||
        <Label maxHeight="1.7976931348623157E308" text="Tourplaner" HBox.hgrow="ALWAYS">
 | 
			
		||||
            <font>
 | 
			
		||||
                <Font size="11.0" fx:id="x3"/>
 | 
			
		||||
                <Font size="11.0" fx:id="x3" />
 | 
			
		||||
            </font>
 | 
			
		||||
            <textFill>
 | 
			
		||||
                <Color red="0.625" green="0.625" blue="0.625" fx:id="x4"/>
 | 
			
		||||
                <Color red="0.625" green="0.625" blue="0.625" fx:id="x4" />
 | 
			
		||||
            </textFill>
 | 
			
		||||
        </Label>
 | 
			
		||||
        <AnchorPane HBox.hgrow="ALWAYS"/>
 | 
			
		||||
        <Label font="$x3" text="Georg Reisinger" textFill="$x4" HBox.hgrow="NEVER"/>
 | 
			
		||||
        <AnchorPane HBox.hgrow="ALWAYS" />
 | 
			
		||||
        <Label font="$x3" text="Georg Reisinger" textFill="$x4" HBox.hgrow="NEVER" />
 | 
			
		||||
    </HBox>
 | 
			
		||||
</VBox>
 | 
			
		||||
 
 | 
			
		||||
@@ -209,7 +209,6 @@ public class AlertHelper {
 | 
			
		||||
 | 
			
		||||
        datePicker.setOnAction(event -> {
 | 
			
		||||
            LocalDate date = datePicker.getValue();
 | 
			
		||||
            System.out.println("Selected date: " + date);
 | 
			
		||||
            selectedDate.set(date);
 | 
			
		||||
            stage.close();
 | 
			
		||||
        });
 | 
			
		||||
 
 | 
			
		||||
@@ -28,6 +28,7 @@ public class ProgressBar {
 | 
			
		||||
        Container content = this.frame.getContentPane();
 | 
			
		||||
        this.progressBar = new JProgressBar();
 | 
			
		||||
        this.progressBar.setValue(0);
 | 
			
		||||
        this.progressBar.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
 | 
			
		||||
        this.progressBar.setStringPainted(true);
 | 
			
		||||
        TitledBorder border = BorderFactory.createTitledBorder("Laden....");
 | 
			
		||||
        this.progressBar.setBorder(border);
 | 
			
		||||
 
 | 
			
		||||
@@ -6,6 +6,8 @@ import javafx.geometry.Orientation;
 | 
			
		||||
import javafx.scene.control.*;
 | 
			
		||||
import javafx.scene.control.cell.PropertyValueFactory;
 | 
			
		||||
import javafx.scene.image.ImageView;
 | 
			
		||||
import javafx.scene.input.KeyCode;
 | 
			
		||||
import javafx.scene.input.KeyEvent;
 | 
			
		||||
import javafx.scene.input.MouseEvent;
 | 
			
		||||
import tourplaner.business.ConfigHelper;
 | 
			
		||||
import tourplaner.business.LogHelper;
 | 
			
		||||
@@ -16,6 +18,7 @@ import tourplaner.viewmodels.ViewModel;
 | 
			
		||||
import java.io.IOException;
 | 
			
		||||
import java.net.URL;
 | 
			
		||||
import java.util.ResourceBundle;
 | 
			
		||||
import java.util.concurrent.atomic.AtomicInteger;
 | 
			
		||||
 | 
			
		||||
public class TourplanerController implements Initializable {
 | 
			
		||||
    //VM
 | 
			
		||||
@@ -123,6 +126,7 @@ public class TourplanerController implements Initializable {
 | 
			
		||||
     */
 | 
			
		||||
    @FXML
 | 
			
		||||
    private void tourListSelectedItem(MouseEvent mouseEvent){
 | 
			
		||||
        //Beschreibung
 | 
			
		||||
        ProgressBar progressBar = new ProgressBar("Tour auswählen...");
 | 
			
		||||
        String selectedItem = TourListView.getSelectionModel().getSelectedItem();
 | 
			
		||||
        this.viewModel.selectTour(selectedItem);
 | 
			
		||||
@@ -159,6 +163,16 @@ public class TourplanerController implements Initializable {
 | 
			
		||||
            syncTourNamen();
 | 
			
		||||
            progressBar.setProgress(100);
 | 
			
		||||
            this.sucheInput.setText("");
 | 
			
		||||
            //Tour namen select focus
 | 
			
		||||
            AtomicInteger index = new AtomicInteger();
 | 
			
		||||
            AtomicInteger indexF = new AtomicInteger();
 | 
			
		||||
            this.viewModel.getTourNamen().forEach(tn -> {
 | 
			
		||||
                index.getAndIncrement();
 | 
			
		||||
                if(tn.equals(this.viewModel.getSelectedTour().getName())){
 | 
			
		||||
                    indexF.set(index.get());
 | 
			
		||||
                }
 | 
			
		||||
            });
 | 
			
		||||
            TourListView.getFocusModel().focus(indexF.intValue() - 1);
 | 
			
		||||
        }
 | 
			
		||||
        progressBar.setProgress(100);
 | 
			
		||||
    }
 | 
			
		||||
@@ -206,6 +220,13 @@ public class TourplanerController implements Initializable {
 | 
			
		||||
        progressBar.closeProgress();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @FXML
 | 
			
		||||
    private void sucheEnter(KeyEvent event){
 | 
			
		||||
        if(event.getCode().equals(KeyCode.ENTER)) {
 | 
			
		||||
            suche();
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Fügt einen Log eintrag zu einer Tour hinzu.
 | 
			
		||||
     * Ist keine Tour ausgewählt, dann kommt eine Warnung an den User!
 | 
			
		||||
 
 | 
			
		||||
@@ -98,7 +98,6 @@ public class ViewModel {
 | 
			
		||||
            this.neueTourName = AlertHelper.inputText(ConfigHelper.getLangIniString("tournametitle"),
 | 
			
		||||
                    ConfigHelper.getLangIniString("tournameheader"),
 | 
			
		||||
                    ConfigHelper.getLangIniString("tournamemsg"), content);
 | 
			
		||||
            System.out.println(this.neueTourName);
 | 
			
		||||
            if(this.neueTourName.isEmpty()){
 | 
			
		||||
                return false;
 | 
			
		||||
            }
 | 
			
		||||
@@ -197,7 +196,6 @@ public class ViewModel {
 | 
			
		||||
     * Bearbeitet einen gewählten Log eintrag
 | 
			
		||||
     */
 | 
			
		||||
    public void editLog(){
 | 
			
		||||
        System.out.println(this.selectedLog);
 | 
			
		||||
        if(this.selectedTour != null) {
 | 
			
		||||
            if(this.selectedLog != null) {
 | 
			
		||||
                AtomicReference<Tour> tourAkt = new AtomicReference<>();
 | 
			
		||||
@@ -314,7 +312,6 @@ public class ViewModel {
 | 
			
		||||
    private LocalDate dateInput(LocalDate date){
 | 
			
		||||
        LocalDate neuesDatum = null;
 | 
			
		||||
        neuesDatum = AlertHelper.datePicker(date);
 | 
			
		||||
        System.out.println(neuesDatum);
 | 
			
		||||
        return neuesDatum;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -506,8 +503,10 @@ public class ViewModel {
 | 
			
		||||
                tourData.removeIf(s -> s.getName().equals(tourname));
 | 
			
		||||
                tourNamen.removeIf(s -> s.equals(tourname));
 | 
			
		||||
                logData.removeIf(s -> true);
 | 
			
		||||
                ProgressBar progressBar = new ProgressBar("");
 | 
			
		||||
                TourPlaner.delTour(tourname);
 | 
			
		||||
                setSelectedTour(null);
 | 
			
		||||
                progressBar.setProgress(100);
 | 
			
		||||
            } catch (NullPointerException e) {
 | 
			
		||||
                LogHelper.error(e);
 | 
			
		||||
            }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user