Compare commits

..

No commits in common. "master" and "2.1.0" have entirely different histories.

8 changed files with 20 additions and 61 deletions

1
.gitignore vendored
View File

@ -5,4 +5,3 @@ reports/
.idea/dataSources*
doxygendoc/
javadoc/
TourplanerImages/

View File

@ -7,6 +7,7 @@ import tourplaner.object.Tour;
import tourplaner.ui.ProgressBar;
import java.io.*;
import java.sql.SQLException;
import java.util.ArrayList;
/**
@ -45,8 +46,6 @@ public class Exporter {
/**
* Führt den Imput aus: File holen, Daten in db erstellen
* @param progressBar Progressbar
* @param progressMax Progressbar Maximum
*/
public void doImport(ProgressBar progressBar, int progressMax) {
try {

View File

@ -32,8 +32,6 @@ public class Reporter {
/**
* Erstellt den Summary Report
* @param progressBar Progressbar
* @param maxLevel Progressbar Maximum
*/
public static void sumReport(ProgressBar progressBar, int maxLevel){
ArrayList<Tour> tours = TourPlaner.getAllTours(progressBar, maxLevel);

View File

@ -9,6 +9,7 @@ import tourplaner.ui.ProgressBar;
import java.io.File;
import java.io.IOException;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Locale;
import java.util.UUID;
@ -29,8 +30,6 @@ public class TourPlaner{
/**
* Holt alle touren aus der DB
* @return Alle touren als ArrayList
* @param progressBar Progressbar
* @param maxLevel Progressbar Maximum
*/
public static ArrayList<Tour> getAllTours(ProgressBar progressBar, int maxLevel){
return new DbConnect().getAllTouren(progressBar, maxLevel);
@ -40,8 +39,8 @@ public class TourPlaner{
* Bearbeitet eine Tour
* @param oldname Alter Tourname
* @param tour Neuer Tourname
* @throws DbErrorException Fehler beim editieren der Tour
* @throws DirectionMapException Fehler in der DirectionMap Abfrage
* @return false bei error
* @throws IOException Fehler beim editieren der Tour
*/
public static void editTour(String oldname, Tour tour) throws DbErrorException, DirectionMapException {
ProgressBar progressBar = new ProgressBar("Edit...");
@ -60,7 +59,6 @@ public class TourPlaner{
/**
* Löscht eine Tour
* @param tourname Tourname
* @throws DbErrorException Fehler beim editieren der Tour
*/
public static void delTour(String tourname) throws DbErrorException {
FileHelper.delFile(new File(getImagePath(tourname)));
@ -72,8 +70,7 @@ public class TourPlaner{
* @param newTour Neue Tour
* @param progressBar Aktuelle Progressbar
* @param progressMax Maximale anzeige der Progress bar
* @throws DbErrorException Fehler beim editieren der Tour
* @throws DirectionMapException Fehler in der DirectionMap Abfrage
* @throws IOException Fehler beim hinzufügen der Tour
*/
public static void addTourMax(Tour newTour, ProgressBar progressBar, int progressMax) throws DbErrorException, DirectionMapException {
int step = progressBar.getProgressSize(2, progressMax);
@ -89,8 +86,7 @@ public class TourPlaner{
* Fügt eine Tour hinzu
* @param newTour Neue Tour
* @param progressBar Aktuelle Progressbar
* @throws DbErrorException Fehler beim editieren der Tour
* @throws DirectionMapException Fehler in der DirectionMap Abfrage
* @throws IOException Fehler beim hinzufügen der Tour
*/
public static void addTour(Tour newTour, ProgressBar progressBar) throws DbErrorException, DirectionMapException {
addTourMax(newTour, progressBar, 100);
@ -102,7 +98,6 @@ public class TourPlaner{
* @return Path zu dem Bild für die GUI
*/
public static String getImagePath(String tourname){
System.out.println(ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "map", "path") + tourname + ".jpg");
return ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "map", "path") + tourname + ".jpg";
}
@ -146,7 +141,6 @@ public class TourPlaner{
* Fügt ein Log hinzu
* @param tourname Name der Tour
* @param log Neues Log
* @throws DbErrorException Fehler beim editieren der Tour
*/
public static void addLog(String tourname, Log log) throws DbErrorException {
if(Double.isInfinite(log.getAvgspeed())) log.setAvgspeed(-1.0);
@ -157,7 +151,6 @@ public class TourPlaner{
* Löscht ein Log
* @param tourname Name der Tour
* @param id Id des Logs
* @throws DbErrorException Fehler beim editieren der Tour
*/
public static void delLog(String tourname, String id) throws DbErrorException {
new DbConnect().delLog(tourname, id);
@ -167,7 +160,6 @@ public class TourPlaner{
* Editiert ein Log
* @param tourname Name der Tour
* @param log Neues Log
* @throws DbErrorException Fehler beim editieren der Tour
*/
public static void editLog(String tourname, Log log) throws DbErrorException {
if(Double.isInfinite(log.getAvgspeed())) log.setAvgspeed(-1.0);
@ -177,8 +169,6 @@ public class TourPlaner{
/**
* Sucht alle touren die den gegebenen tournamen enthalten
* @param tourname Name der zu suchen ist
* @param progressBar Progressbar
* @param maxProgress Progressbar Maximum
* @return Alle touren die auf den Suchterm passen
*/
public static ArrayList<Tour> sucheTour(String tourname, ProgressBar progressBar, int maxProgress){

View File

@ -40,7 +40,6 @@ public class DbConnect {
* Bearbeitet eine Tour
* @param oldname Alter Tour name
* @param tour Neues Tour Object
* @throws DbErrorException Datenbank error
*/
public void editTour(String oldname, Tour tour) throws DbErrorException {
String tourname = tour.getName();
@ -71,7 +70,7 @@ public class DbConnect {
/**
* Fügt eine Tour hinzu
* @param tour Neue Tour
* @throws DbErrorException Db error
* @return false bei error
*/
public void addTour(Tour tour) throws DbErrorException {
try{
@ -84,7 +83,6 @@ public class DbConnect {
/**
* Löscht eine Tour anhand des Tournamens
* @param tourname Tourname der zu löschen ist
* @throws DbErrorException Db error
*/
public void delTour(String tourname) throws DbErrorException {
try {
@ -95,11 +93,6 @@ public class DbConnect {
}
}
/**
* Holt die Logs einer Tour
* @param tourname name der Tour
* @return Logs der Tour
*/
public ArrayList<Log> getLogs(String tourname){
this.c = PostgresHelper.con();
@ -142,8 +135,8 @@ public class DbConnect {
* Füght einen Logeintrag ein
* @param tourname Zu welcher Tour der Logeintrag gehört
* @param log Der Logeintrag
* @throws DbErrorException DB Error
* */
* @return false bei error
*/
public void addLog(String tourname, Log log) throws DbErrorException {
if(Double.isInfinite(log.getAvgspeed())) log.setAvgspeed(-1.0);
try{
@ -153,12 +146,6 @@ public class DbConnect {
}
}
/**
* Edit Log
* @param tourname Name der Tour
* @param log ID des logs
* @throws DbErrorException DB Error
*/
public void editLog(String tourname, Log log) throws DbErrorException {
try{
PostgresHelper.executeUpdateEditLog("UPDATE public.log SET bemerkung = ?, datum = ?, strecke = ?, avg = ?, hightmeter = ?, pause = ?, gegangen = ?, dauer = ?, rating = ? WHERE tourname = ? and id = ?", log.getBemerkung(),log.getDatum(),log.getStrecke(),log.getAvgspeed(),log.getHightmeter(),log.getPause(),log.getGegangen(),log.getDauer(),log.getRating(),tourname ,log.getId());
@ -167,12 +154,6 @@ public class DbConnect {
}
}
/**
* Del Log
* @param tourname Name der Tour
* @param id ID des Logs
* @throws DbErrorException DB Error
*/
public void delLog(String tourname, String id) throws DbErrorException {
try{
PostgresHelper.executeUpdateDelLog("DELETE FROM public.log WHERE tourname = ? and id = ?", tourname, id);
@ -181,11 +162,6 @@ public class DbConnect {
}
}
/**
* holt Die Tour größe
* @return Größe der Tour
* @throws DbErrorException DB Error
*/
private int getTourSize() throws DbErrorException {
Connection con = PostgresHelper.con();
try{

View File

@ -68,6 +68,7 @@ public class PostgresHelper {
* @param gegangen Gegangene Zeit des Logs
* @param dauer Dauer des Logs
* @param rating Rating des Logs
* @return false bei error
* @throws SQLException Sql error
*/
public static void executeUpdateAddLog(String content, String tourname, String id, String bemerkung, LocalDate datum, double strecke, double avgspeed, double hightmeter, double pause, double gegangen, double dauer, String rating) throws SQLException {
@ -102,6 +103,7 @@ public class PostgresHelper {
* @param rating Rating des Logs
* @param tourname Name der Tour des Logs
* @param id ID des Logs
* @return false bei error
* @throws SQLException Sql error
*/
public static void executeUpdateEditLog(String content, String bemerkung, LocalDate datum, double strecke, double avgspeed, double hightmeter, double pause, double gegangen, double dauer, String rating, String tourname, String id) throws SQLException {
@ -127,6 +129,7 @@ public class PostgresHelper {
* @param content Sql statement
* @param tourname Name der Tour
* @param id Id des logs
* @return false bei error
* @throws SQLException SQL error
*/
public static void executeUpdateDelLog(String content, String tourname, String id) throws SQLException {
@ -142,6 +145,7 @@ public class PostgresHelper {
* Führt sql statement aus, mit einem String
* @param content Sql Statement
* @param string String im statement
* @return false bei error
* @throws SQLException Sql error
*/
public static void executeUpdateString(String content, String string) throws SQLException {
@ -161,6 +165,7 @@ public class PostgresHelper {
* @param start Start der Tour
* @param ziel Ziel der Tour
* @param strecke Strecke der Tour
* @return false bei error
* @throws SQLException Sql error
*/
public static void executeUpdateAddTour(String content, String name, String dauer, String mapJson, String start, String ziel, double strecke) throws SQLException {
@ -186,6 +191,7 @@ public class PostgresHelper {
* @param ziel Ziel der Tour
* @param strecke Strecke der Tour
* @param oldname Alter Name der Tour
* @return false bei error
* @throws SQLException Sql error
*/
public static void executeUpdateEditTour(String content, String name, String mapJson, String start, String ziel, double strecke, String oldname) throws SQLException {

View File

@ -20,6 +20,7 @@ import tourplaner.viewmodels.ViewModel;
import java.io.IOException;
import java.net.URL;
import java.sql.SQLException;
import java.util.ResourceBundle;
import java.util.concurrent.atomic.AtomicInteger;

View File

@ -11,7 +11,6 @@ import tourplaner.object.Tour;
import tourplaner.ui.ProgressBar;
import java.awt.*;
import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
@ -34,14 +33,13 @@ public class ViewModel {
public Image getImage(String tourname){
return new Image(ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "map", "file_pre") + new File(TourPlaner.getImagePath(tourname)).getAbsolutePath());
return new Image( ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "map", "file_pre") + TourPlaner.getImagePath(tourname));
}
/**
* Bearbeitet eine bereits bestehende Tour
* prüft ob eine tour ausgewählt ist
* @throws DbErrorException Fehler beim editieren der Tour
* @throws DirectionMapException Fehler in der DirectionMap Abfrage
* @throws IOException Fehler beim editieren der Tour
*/
public void editTour() throws DbErrorException, DirectionMapException {
if (this.selectedTour == null){
@ -196,7 +194,6 @@ public class ViewModel {
/**
* Bearbeitet einen gewählten Log eintrag
* @throws DbErrorException Fehler beim editieren der Tour
*/
@SuppressWarnings("UnusedAssignment")
public void editLog() throws DbErrorException {
@ -406,7 +403,6 @@ public class ViewModel {
/**
* Entfernt ein Log anhand des selectierten Logs
* @throws DbErrorException Fehler beim editieren der Tour
*/
public void delLog() throws DbErrorException {
if(this.selectedLog != null) {
@ -525,8 +521,6 @@ public class ViewModel {
/**
* Sucht eine Tour
* @param sucheInput Text nach dem gesucht werden soll
* @param progressBar ProgressBar
* @param maxProgress Maximaler Progress
*/
public void suche(String sucheInput, ProgressBar progressBar, int maxProgress){
if(sucheInput.isEmpty()){
@ -629,7 +623,6 @@ public class ViewModel {
/**
* Importiert alle daten von einem File das hier gewählt wird
* @return Die aktuelle Progressbar
* @param maxProgress Maximaler Progress
*/
public ProgressBar importData(int maxProgress) {
String file = AlertHelper.fileChooser("Importiere");
@ -658,7 +651,6 @@ public class ViewModel {
/**
* Kopiert einen Log eintrag und erstellt dafür eine neue Id für das kopierte log
* @throws DbErrorException DB Error
*/
public void copyLog() throws DbErrorException {
Log selectedLog = getSelectedLog();
@ -679,8 +671,6 @@ public class ViewModel {
/**
* Kopiert eie Tour und hängt dafür am ende des namens ein _copy an
* @param progressBar ProgressBar
* @param maxLevel Maximaler Progress
*/
public void copyTour(ProgressBar progressBar, int maxLevel) {
Tour selectedTour = getSelectedTour();