Del unused

This commit is contained in:
Georg Reisinger 2021-04-18 21:02:32 +02:00
parent a578df5184
commit 830bb54e9f
18 changed files with 210 additions and 476 deletions

View File

@ -10,7 +10,7 @@ import java.io.IOException;
*/ */
public class ConfigHelper { public class ConfigHelper {
public static String standartConfig = "conf.ini"; // Config.ini befindet sich im Root Verzeichnis public static final String standartConfig = "conf.ini"; // Config.ini befindet sich im Root Verzeichnis
/** /**
* Liest einen Int aus der Config aus * Liest einen Int aus der Config aus

View File

@ -9,8 +9,6 @@ import java.io.IOException;
*/ */
public class DirectionMap { public class DirectionMap {
private double dauer, strecke; private double dauer, strecke;
private String start, end, tourname, file, filepdf;
private Image map, mappdf;
/** /**
* Holt die Map als image und alle Daten zur berechneten Route * Holt die Map als image und alle Daten zur berechneten Route
@ -21,15 +19,12 @@ public class DirectionMap {
* @throws IOException Fehler beim Image der Map * @throws IOException Fehler beim Image der Map
*/ */
public DirectionMap (String start, String ende, String tourname) throws IOException { public DirectionMap (String start, String ende, String tourname) throws IOException {
this.map = getMap(start, ende, ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "map", "size")); Image map = getMap(start, ende, ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "map", "size"));
this.mappdf = getMap(start, ende, ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "map", "sizePdf")); Image mappdf = getMap(start, ende, ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "map", "sizePdf"));
this.start = start; String file = ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "map", "path") + tourname + ".jpg";
this.end = ende; String filepdf = ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "map", "path") + tourname + "_pdf.jpg";
this.tourname = tourname; FileHelper.saveImage(map, "jpg", new File(file));
this.file = ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "map", "path") + this.tourname + ".jpg"; FileHelper.saveImage(mappdf, "jpg", new File(filepdf));
this.filepdf = ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "map", "path") + this.tourname + "_pdf.jpg";
FileHelper.saveImage(this.map, "jpg", new File(this.file));
FileHelper.saveImage(this.mappdf, "jpg", new File(this.filepdf));
getDirections(start, ende); getDirections(start, ende);
if(ConfigHelper.getIniInt(ConfigHelper.getStandartConfig(), "settings", "openmap") == 1) { if(ConfigHelper.getIniInt(ConfigHelper.getStandartConfig(), "settings", "openmap") == 1) {
FileHelper.openDefault(file); FileHelper.openDefault(file);

View File

@ -3,10 +3,8 @@ package tourplaner.business;
import tourplaner.data.DbConnect; import tourplaner.data.DbConnect;
import tourplaner.object.Log; import tourplaner.object.Log;
import tourplaner.object.Tour; import tourplaner.object.Tour;
import tourplaner.ui.AlertHelper;
import tourplaner.ui.ProgressBar; import tourplaner.ui.ProgressBar;
import javax.swing.*;
import java.io.*; import java.io.*;
import java.util.ArrayList; import java.util.ArrayList;
@ -15,8 +13,7 @@ import java.util.ArrayList;
*/ */
public class Exporter { public class Exporter {
private ArrayList<Tour> touren; private final String path;
private String path;
/** /**
* Erstellt den Exporter mit dem gegebenen Path * Erstellt den Exporter mit dem gegebenen Path
@ -51,12 +48,12 @@ 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(EinheitenAdder.addJson(this.path))); ArrayList<Tour> 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);
int size = progressBar.getProgressSize(this.touren.size() * 3, 100); int size = progressBar.getProgressSize(touren.size() * 3, 100);
for (Tour tour:this.touren) { for (Tour tour: touren) {
new DirectionMap(tour.getStart(), tour.getZiel(), tour.getName()); new DirectionMap(tour.getStart(), tour.getZiel(), tour.getName());
progressBar.addProgress(size); progressBar.addProgress(size);
dbConnect.addTour(tour); dbConnect.addTour(tour);

View File

@ -34,15 +34,6 @@ public class JsonHelper {
return getJObj(json).get("route").getAsJsonObject().get(gets).getAsDouble(); return getJObj(json).get("route").getAsJsonObject().get(gets).getAsDouble();
} }
/**
* Erzeugt ein Json aus einem Object
* @param obj Das Objekt
* @return Json des Objektes
*/
public static String getJsonFromObj(Object obj){
return new Gson().toJson(obj);
}
/** /**
* Erzeugt ein Json aus einem Object * Erzeugt ein Json aus einem Object
* @param obj Das Objekt * @param obj Das Objekt

View File

@ -15,15 +15,6 @@ public class LogHelper{
getLog(name).info(msg); getLog(name).info(msg);
} }
/**
* Log info in file und Console
* @param msg Nachricht in dem Log
* @param name Name des Log Eintrags
*/
public static void warn(String msg, String name){
getLog(name).warn(msg);
}
/** /**
* Log info in file und Console * Log info in file und Console
* @param msg Nachricht in dem Log * @param msg Nachricht in dem Log
@ -41,15 +32,6 @@ public class LogHelper{
getLog(e.getClass().getName()).error(e.getMessage()); getLog(e.getClass().getName()).error(e.getMessage());
} }
/**
* Log info in file und Console
* @param msg Nachricht in dem Log
* @param name Name des Log Eintrags
*/
public static void fatal(String msg, String name){
getLog(name).fatal(msg);
}
/** /**
* Instanziert den Logger * Instanziert den Logger
* @param name Name des Loggers * @param name Name des Loggers

View File

@ -25,13 +25,9 @@ import java.util.Date;
*/ */
public class Reporter { public class Reporter {
private static Font catFont = new Font(Font.TIMES_ROMAN, 18, private static final Font catFont = new Font(Font.TIMES_ROMAN, 18,
Font.BOLD); Font.BOLD);
private static Font redFont = new Font(Font.TIMES_ROMAN, 12, private static final Font subFont = new Font(Font.TIMES_ROMAN, 16,
Font.NORMAL, Color.RED);
private static Font subFont = new Font(Font.TIMES_ROMAN, 16,
Font.BOLD);
private static Font smallBold = new Font(Font.TIMES_ROMAN, 12,
Font.BOLD); Font.BOLD);
/** /**
@ -192,53 +188,4 @@ public class Reporter {
paragraph.add(new Paragraph(" ")); paragraph.add(new Paragraph(" "));
} }
} }
// private static void createTable(Section subCatPart)
// throws BadElementException {
// PdfPTable table = new PdfPTable(5);
//
// // t.setBorderColor(BaseColor.GRAY);
// // t.setPadding(4);
// // t.setSpacing(4);
// // t.setBorderWidth(1);
//
// PdfPCell c1 = new PdfPCell(new Phrase("NR"));
// c1.setHorizontalAlignment(Element.ALIGN_CENTER);
// table.addCell(c1);
//
// c1 = new PdfPCell(new Phrase("Datum"));
// c1.setHorizontalAlignment(Element.ALIGN_CENTER);
// table.addCell(c1);
//
// c1 = new PdfPCell(new Phrase("Entfernung"));
// c1.setHorizontalAlignment(Element.ALIGN_CENTER);
// table.addCell(c1);
//
// c1 = new PdfPCell(new Phrase("Höhenmeter"));
// c1.setHorizontalAlignment(Element.ALIGN_CENTER);
// table.addCell(c1);
//
// c1 = new PdfPCell(new Phrase("AVG Geschwindigkeit"));
// c1.setHorizontalAlignment(Element.ALIGN_CENTER);
// table.addCell(c1);
//
//
// table.setHeaderRows(1);
//
// table.addCell("1.0");
// table.addCell("1.1");
// table.addCell("1.2");
// table.addCell("1.3");
// table.addCell("1.4");
// table.addCell("1.5");
//
// table.addCell("2.0");
// table.addCell("2.1");
// table.addCell("2.2");
// table.addCell("2.3");
// table.addCell("2.4");
// table.addCell("2.5");
//
// subCatPart.add(table);
//
// }
} }

View File

@ -8,7 +8,6 @@ import tourplaner.ui.ProgressBar;
import java.awt.*; import java.awt.*;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
@ -16,7 +15,6 @@ import java.util.ArrayList;
* Haupt Logik des Tourplaners * Haupt Logik des Tourplaners
*/ */
public class TourPlaner{ public class TourPlaner{
private Logger logger;
/** /**
* Erstellt alle DB Tabellen falls nötig * Erstellt alle DB Tabellen falls nötig
@ -90,16 +88,6 @@ public class TourPlaner{
} }
/** /**
* Holt das Gui Bild
* @param tourname Name der Tour
* @return Das Bild
* @throws IOException Error beim Bild holen
*/
public static Image getImage(String tourname) throws IOException {
return FileHelper.getImage(new File(getImagePath(tourname)));
}
/**
* Path zu dem Bild für die GUI * Path zu dem Bild für die GUI
* @param tourname Name der Tour * @param tourname Name der Tour
* @return Path zu dem Bild für die GUI * @return Path zu dem Bild für die GUI
@ -117,16 +105,6 @@ public class TourPlaner{
return ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "map", "path") + tourname + "_pdf.jpg"; return ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "map", "path") + tourname + "_pdf.jpg";
} }
/**
* Öffnet ein Bild einer Tour
* @param tourname Tourname
*/
public static void openImage(String tourname){
if(ConfigHelper.getIniInt(ConfigHelper.getStandartConfig(), "settings", "openmap") == 1) {
FileHelper.openDefault(getImagePath(tourname));
}
}
/** /**
* Holt alle Logs einer Tour * Holt alle Logs einer Tour

View File

@ -1,14 +1,11 @@
package tourplaner.data; package tourplaner.data;
import javafx.geometry.Pos;
import tourplaner.business.LogHelper; import tourplaner.business.LogHelper;
import tourplaner.object.Log; import tourplaner.object.Log;
import tourplaner.object.Tour; import tourplaner.object.Tour;
import tourplaner.ui.AlertHelper;
import tourplaner.ui.ProgressBar; import tourplaner.ui.ProgressBar;
import java.sql.*; import java.sql.*;
import java.time.LocalDate;
import java.util.ArrayList; import java.util.ArrayList;
/** /**
@ -54,9 +51,7 @@ public class DbConnect {
ArrayList<Log> logs = getLogs(oldname); ArrayList<Log> logs = getLogs(oldname);
result.add(delLogs(oldname)); result.add(delLogs(oldname));
result.add(PostgresHelper.executeUpdate("UPDATE public.tour SET tourname = '"+tour.getName()+"', dauer = 1, mapjson = '"+tour.getMapJson()+"', start = '"+tour.getStart()+"', ziel = '"+tour.getZiel()+"', strecke = "+tour.getStrecke()+" WHERE tourname ='" + oldname + "';")); result.add(PostgresHelper.executeUpdate("UPDATE public.tour SET tourname = '"+tour.getName()+"', dauer = 1, mapjson = '"+tour.getMapJson()+"', start = '"+tour.getStart()+"', ziel = '"+tour.getZiel()+"', strecke = "+tour.getStrecke()+" WHERE tourname ='" + oldname + "';"));
logs.forEach(log -> { logs.forEach(log -> result.add(addLog(tourname, log)));
result.add(addLog(tourname, log));
});
return !result.contains(false); return !result.contains(false);
} }

View File

@ -3,20 +3,15 @@ package tourplaner.data;
import tourplaner.business.ConfigHelper; import tourplaner.business.ConfigHelper;
import tourplaner.business.LogHelper; import tourplaner.business.LogHelper;
import tourplaner.object.Tour;
import java.sql.Connection; import java.sql.Connection;
import java.sql.DriverManager; import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement; import java.sql.Statement;
import java.util.ArrayList;
/** /**
* Hilfsfunktionen für die verwendung der Postgres DB * Hilfsfunktionen für die verwendung der Postgres DB
*/ */
public class PostgresHelper { public class PostgresHelper {
private Connection c;
private Statement stmt;
/** /**
* Verbindet mit der Datenbank * Verbindet mit der Datenbank
* @return Das Connection Objekt * @return Das Connection Objekt

View File

@ -1,9 +1,6 @@
package tourplaner.object; package tourplaner.object;
import jdk.jshell.spi.ExecutionControl;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.Date;
public class Log { public class Log {
private String id, bemerkung, rating; private String id, bemerkung, rating;
@ -30,18 +27,10 @@ public class Log {
return rating; return rating;
} }
public void setRating(String rating) {
this.rating = rating;
}
public String getBemerkung() { public String getBemerkung() {
return bemerkung; return bemerkung;
} }
public void setBemerkung(String bemerkung) {
this.bemerkung = bemerkung;
}
public double getAvgspeed() { public double getAvgspeed() {
return avgspeed; return avgspeed;
} }
@ -54,55 +43,28 @@ public class Log {
return hightmeter; return hightmeter;
} }
public void setHightmeter(double hightmeter) {
this.hightmeter = hightmeter;
}
public double getPause() { public double getPause() {
return pause; return pause;
} }
public void setPause(double pause) {
this.pause = pause;
}
public double getGegangen() { public double getGegangen() {
return gegangen; return gegangen;
} }
public void setGegangen(double gegangen) {
this.gegangen = gegangen;
}
public String getId() { public String getId() {
return id; return id;
} }
public void setId(String id) {
this.id = id;
}
public double getDauer() { public double getDauer() {
return dauer; return dauer;
} }
public void setDauer(double dauer) {
this.dauer = dauer;
}
public LocalDate getDatum() { public LocalDate getDatum() {
return datum; return datum;
} }
public void setDatum(LocalDate datum) {
this.datum = datum;
}
public double getStrecke() { public double getStrecke() {
return strecke; return strecke;
} }
public void setStrecke(double strecke) {
this.strecke = strecke;
}
} }

View File

@ -7,7 +7,11 @@ import java.util.concurrent.atomic.AtomicReference;
* Model einer Tour * Model einer Tour
*/ */
public class Tour { public class Tour {
private String dauer, mapJson, name, start, ziel, rating; private String dauer;
private String mapJson;
private String name;
private String start;
private String ziel;
private double strecke; private double strecke;
private ArrayList<Log> log; private ArrayList<Log> log;
@ -31,16 +35,6 @@ public class Tour {
this.log = logs; this.log = logs;
} }
public void setTour(Tour tour){
this.dauer = tour.getDauer();
this.mapJson = tour.getMapJson();
this.strecke = tour.getStrecke();
this.name = tour.getName();
this.start = tour.getStart();
this.ziel = tour.getZiel();
this.log = tour.getLogs();
}
public void setLog(ArrayList<Log> log) { public void setLog(ArrayList<Log> log) {
this.log = log; this.log = log;
} }
@ -96,10 +90,6 @@ public class Tour {
return mapJson; return mapJson;
} }
public void setMapJson(String mapJson) {
this.mapJson = mapJson;
}
public double getStrecke() { public double getStrecke() {
return strecke; return strecke;
} }
@ -112,23 +102,12 @@ public class Tour {
return name; return name;
} }
public void setName(String name) {
this.name = name;
}
public String getStart() { public String getStart() {
return start; return start;
} }
public void setStart(String start) {
this.start = start;
}
public String getZiel() { public String getZiel() {
return ziel; return ziel;
} }
public void setZiel(String ziel) {
this.ziel = ziel;
}
} }

View File

@ -9,10 +9,6 @@ import static org.junit.jupiter.api.Assertions.*;
class EinheitenAdderTest { class EinheitenAdderTest {
@BeforeEach
void setUp() {
}
@Test @Test
void addMeter() { void addMeter() {
assertEquals(EinheitenAdder.addMeter("1"), "1"+ " " + ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "einheiten", "meter")); assertEquals(EinheitenAdder.addMeter("1"), "1"+ " " + ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "einheiten", "meter"));

View File

@ -19,9 +19,9 @@ class TourTest {
@BeforeEach @BeforeEach
void setUp() { void setUp() {
this.tour = new Tour("String name", "String dauer", "String mapJson", 2, "String start", "String ziel"); this.tour = new Tour("String name", "String dauer", "String mapJson", 2, "String start", "String ziel");
this.log1 = new Log("1", 2, this.date, 3, "4", 5, 6, "7");; this.log1 = new Log("1", 2, this.date, 3, "4", 5, 6, "7");
this.log2 = new Log("2", 2, this.date, 3, "4", 5, 6, "7");; this.log2 = new Log("2", 2, this.date, 3, "4", 5, 6, "7");
this.log3 = new Log("3", 2, this.date, 3, "4", 5, 6, "7");; this.log3 = new Log("3", 2, this.date, 3, "4", 5, 6, "7");
} }
@Test @Test

View File

@ -39,192 +39,185 @@
<?import javafx.scene.paint.*?> <?import javafx.scene.paint.*?>
<?import javafx.scene.text.*?> <?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"
<children> fx:controller="tourplaner.ui.TourplanerController">
<MenuBar VBox.vgrow="NEVER"> <MenuBar VBox.vgrow="NEVER">
<menus>
<Menu fx:id="menueFile" mnemonicParsing="false" text="Datei"> <Menu fx:id="menueFile" mnemonicParsing="false" text="Datei">
<items> <MenuItem fx:id="reportsummary" mnemonicParsing="false" onAction="#reportSum" text="Report Summary"/>
<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="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>
</Menu> </Menu>
<Menu fx:id="menuebearbeiten" mnemonicParsing="false" text="Bearbeiten"> <Menu fx:id="menuebearbeiten" mnemonicParsing="false" text="Bearbeiten">
<items> <MenuItem fx:id="menueimport" mnemonicParsing="false" onAction="#importBtn" text="Import"/>
<MenuItem fx:id="menueimport" mnemonicParsing="false" onAction="#importBtn" text="Import" /> <MenuItem fx:id="menueexport" mnemonicParsing="false" onAction="#exportBtn" text="Export"/>
<MenuItem fx:id="menueexport" mnemonicParsing="false" onAction="#exportBtn" text="Export" />
</items>
</Menu> </Menu>
<Menu fx:id="menueoptionen" mnemonicParsing="false" text="Optionen"> <Menu fx:id="menueoptionen" mnemonicParsing="false" text="Optionen">
<items> <CheckMenuItem fx:id="openmap" mnemonicParsing="false" onAction="#openmapaction"
<CheckMenuItem fx:id="openmap" mnemonicParsing="false" onAction="#openmapaction" text="Map automatisch öffnen" /> text="Map automatisch öffnen"/>
<CheckMenuItem fx:id="openpdf" mnemonicParsing="false" onAction="#openpdfaction" text="Report automatisch öffnen" /> <CheckMenuItem fx:id="openpdf" mnemonicParsing="false" onAction="#openpdfaction"
<Menu fx:id="menuesprachen" mnemonicParsing="false" text="Sprache"> text="Report automatisch öffnen"/>
<items> <Menu fx:id="menuesprachen" mnemonicParsing="false" text="Sprache">
<RadioMenuItem fx:id="langdeutsch" mnemonicParsing="false" onAction="#onlangdeutsch" text="Deutsch" /> <RadioMenuItem fx:id="langdeutsch" mnemonicParsing="false" onAction="#onlangdeutsch"
<RadioMenuItem fx:id="langenglisch" mnemonicParsing="false" onAction="#onlangenglisch" text="Englisch" /> text="Deutsch"/>
</items> <RadioMenuItem fx:id="langenglisch" mnemonicParsing="false" onAction="#onlangenglisch"
</Menu> text="Englisch"/>
</items>
</Menu> </Menu>
<Menu fx:id="menuehilfe" mnemonicParsing="false" text="Hilfe">
<items>
<MenuItem mnemonicParsing="false" onAction="#gitWebBrowser" text="Git Repo" />
<MenuItem mnemonicParsing="false" onAction="#javaDocBrowser" text="JavaDoc" />
<MenuItem mnemonicParsing="false" onAction="#doxygenDocBrowser" text="Doxygen Doc" />
</items>
</Menu> </Menu>
</menus> <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"/>
</Menu>
</MenuBar> </MenuBar>
<HBox id="HBox" alignment="CENTER_LEFT" layoutX="10.0" layoutY="588.0" spacing="5.0"> <HBox id="HBox" alignment="CENTER_LEFT" layoutX="10.0" layoutY="588.0" spacing="5.0">
<children> <padding>
<AnchorPane prefWidth="-1.0" HBox.hgrow="ALWAYS"> <Insets bottom="3.0" left="3.0" right="3.0" top="3.0"/>
<children> </padding>
<Button fx:id="tourAdd" layoutX="58.0" mnemonicParsing="false" onAction="#addTour" text="+" /> <AnchorPane HBox.hgrow="ALWAYS">
<Label layoutX="14.0" layoutY="4.0" text="Tours" /> <Button fx:id="tourAdd" layoutX="58.0" mnemonicParsing="false" onAction="#addTour" text="+"/>
<Button fx:id="tourDel" layoutX="89.0" mnemonicParsing="false" onAction="#delTour" text="-" /> <Label layoutX="14.0" layoutY="4.0" text="Tours"/>
<Button fx:id="editTourBtn" layoutX="117.0" mnemonicParsing="false" onAction="#editTourBtn" text="Edit" /> <Button fx:id="tourDel" layoutX="89.0" mnemonicParsing="false" onAction="#delTour" text="-"/>
</children></AnchorPane> <Button fx:id="editTourBtn" layoutX="117.0" mnemonicParsing="false" onAction="#editTourBtn"
<TextField fx:id="sucheInput" promptText="Suche..." /> text="Edit"/>
<Button fx:id="sucheButton" mnemonicParsing="false" onAction="#suche" text="Suchen" /> </AnchorPane>
</children> <TextField fx:id="sucheInput" promptText="Suche..."/>
<padding> <Button fx:id="sucheButton" mnemonicParsing="false" onAction="#suche" text="Suchen"/>
<Insets bottom="3.0" left="3.0" right="3.0" top="3.0" /> </HBox>
</padding> <SplitPane dividerPositions="0.060133630289532294" focusTraversable="true" prefHeight="522.0" prefWidth="300.0"
</HBox> VBox.vgrow="ALWAYS">
<SplitPane dividerPositions="0.060133630289532294" focusTraversable="true" prefHeight="522.0" prefWidth="300.0" VBox.vgrow="ALWAYS"> <AnchorPane prefWidth="239.0">
<items> <ListView fx:id="TourListView" layoutX="-1.0" onMouseClicked="#tourListSelectedItem" prefHeight="520.0"
<AnchorPane prefWidth="239.0"> prefWidth="190.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0"
<children> 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>
</children> <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">
<Label text="Title:">
<HBox.margin>
<Insets left="10.0"/>
</HBox.margin>
</Label>
<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">
<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"/>
</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">
<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"/>
</columns>
</TableView>
</AnchorPane>
</Tab>
</TabPane>
</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">
<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">
<padding>
<Insets bottom="3.0" left="3.0" right="3.0" top="3.0"/>
</padding>
<Label text="Logs:">
<HBox.margin>
<Insets left="10.0"/>
</HBox.margin>
</Label>
<Button mnemonicParsing="false" onAction="#addLog" text="+"
textAlignment="CENTER">
<HBox.margin>
<Insets/>
</HBox.margin>
</Button>
<Button fx:id="logDel" mnemonicParsing="false" onAction="#delLog"
prefWidth="21.0" text="-" textAlignment="CENTER">
<HBox.margin>
<Insets/>
</HBox.margin>
</Button>
<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">
<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"/>
</columns>
<columnResizePolicy>
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY"/>
</columnResizePolicy>
</TableView>
</AnchorPane>
</VBox>
</AnchorPane> </AnchorPane>
<SplitPane dividerPositions="0.5" orientation="VERTICAL" prefHeight="496.0" prefWidth="620.0"> </SplitPane>
<items>
<VBox prefWidth="100.0">
<children>
<AnchorPane prefWidth="676.0">
<children>
<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">
<children>
<Label text="Title:">
<HBox.margin>
<Insets left="10.0" />
</HBox.margin>
</Label>
<TextField fx:id="titleTextView" editable="false" />
</children>
</HBox>
</children>
</AnchorPane>
<AnchorPane prefWidth="200.0">
<children>
<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">
<tabs>
<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" />
</AnchorPane>
</Tab>
<Tab fx:id="beschreibungTab" text="Beschreibung">
<content>
<AnchorPane>
<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">
<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" />
</columns>
</TableView>
</children>
</AnchorPane>
</content>
</Tab>
</tabs>
</TabPane>
</children>
</AnchorPane>
</children>
</VBox>
<AnchorPane prefWidth="200.0">
<children>
<VBox prefWidth="100.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<children>
<AnchorPane>
<children>
<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">
<children>
<Label text="Logs:">
<HBox.margin>
<Insets left="10.0" />
</HBox.margin>
</Label>
<Button mnemonicParsing="false" onAction="#addLog" text="+" textAlignment="CENTER">
<HBox.margin>
<Insets />
</HBox.margin>
</Button>
<Button fx:id="logDel" mnemonicParsing="false" onAction="#delLog" prefWidth="21.0" text="-" textAlignment="CENTER">
<HBox.margin>
<Insets />
</HBox.margin>
</Button>
<Button fx:id="editBtn" mnemonicParsing="false" onAction="#editLogBtn" text="Edit" />
</children>
<padding>
<Insets bottom="3.0" left="3.0" right="3.0" top="3.0" />
</padding>
</HBox>
</children>
</AnchorPane>
<AnchorPane>
<children>
<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" />
</columns>
<columnResizePolicy>
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
</columnResizePolicy>
</TableView>
</children>
</AnchorPane>
</children>
</VBox>
</children>
</AnchorPane>
</items>
</SplitPane>
</items>
</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> <padding>
<Label maxHeight="1.7976931348623157E308" maxWidth="-1.0" text="Tourplaner" HBox.hgrow="ALWAYS"> <Insets bottom="3.0" left="3.0" right="3.0" top="3.0"/>
<font> </padding>
<Font size="11.0" fx:id="x3" /> <Label maxHeight="1.7976931348623157E308" text="Tourplaner" HBox.hgrow="ALWAYS">
</font> <font>
<textFill> <Font size="11.0" fx:id="x3"/>
<Color red="0.625" green="0.625" blue="0.625" fx:id="x4" /> </font>
</textFill> <textFill>
<Color red="0.625" green="0.625" blue="0.625" fx:id="x4"/>
</textFill>
</Label> </Label>
<AnchorPane prefHeight="-1.0" prefWidth="-1.0" HBox.hgrow="ALWAYS" /> <AnchorPane HBox.hgrow="ALWAYS"/>
<Label font="$x3" maxWidth="-1.0" text="Georg Reisinger" textFill="$x4" HBox.hgrow="NEVER" /> <Label font="$x3" text="Georg Reisinger" textFill="$x4" HBox.hgrow="NEVER"/>
</children>
<padding>
<Insets bottom="3.0" left="3.0" right="3.0" top="3.0" />
</padding>
</HBox> </HBox>
</children>
</VBox> </VBox>

View File

@ -1,6 +1,5 @@
package tourplaner.ui; package tourplaner.ui;
import javafx.event.EventHandler;
import javafx.scene.Scene; import javafx.scene.Scene;
import javafx.scene.control.*; import javafx.scene.control.*;
import javafx.scene.control.Label; import javafx.scene.control.Label;
@ -8,15 +7,9 @@ import javafx.scene.control.TextArea;
import javafx.scene.image.Image; import javafx.scene.image.Image;
import javafx.scene.layout.*; import javafx.scene.layout.*;
import javafx.stage.Stage; import javafx.stage.Stage;
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.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.io.StringWriter; import java.io.StringWriter;
import java.time.LocalDate; import java.time.LocalDate;
@ -45,15 +38,6 @@ public class AlertHelper {
alertType(Alert.AlertType.INFORMATION, title, header, msg); alertType(Alert.AlertType.INFORMATION, title, header, msg);
} }
/**
* Info Dialog ohne Header
* @param title Title des Dialogs
* @param msg Nachricht des Dialogs
*/
public static void informNoHeader(String title, String msg){
inform(title, null, msg);
}
/** /**
* Error Dialog * Error Dialog
* @param title Title des Dialogs * @param title Title des Dialogs
@ -190,7 +174,7 @@ public class AlertHelper {
double returnDouble = -2.0; double returnDouble = -2.0;
while (returnDouble < -1.0) { while (returnDouble < -1.0) {
Optional<String> result = inputHelper(title, header, msg, content); Optional<String> result = inputHelper(title, header, msg, content);
AtomicReference<Double> returnText = new AtomicReference<Double>(-1.0); AtomicReference<Double> returnText = new AtomicReference<>(-1.0);
result.ifPresent(s -> { result.ifPresent(s -> {
try { try {
double resultDouble = Double.parseDouble(result.get()); double resultDouble = Double.parseDouble(result.get());
@ -221,9 +205,7 @@ public class AlertHelper {
stage.getIcons().add( stage.getIcons().add(
new Image("file:"+ ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "start", "logo"))); new Image("file:"+ ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "start", "logo")));
AtomicReference<LocalDate> selectedDate = new AtomicReference<>(); AtomicReference<LocalDate> selectedDate = new AtomicReference<>();
stage.setOnCloseRequest(ev -> { stage.setOnCloseRequest(ev -> stage.close());
stage.close();
});
datePicker.setOnAction(event -> { datePicker.setOnAction(event -> {
LocalDate date = datePicker.getValue(); LocalDate date = datePicker.getValue();

View File

@ -1,6 +1,5 @@
package tourplaner.ui; package tourplaner.ui;
import javafx.scene.image.Image;
import tourplaner.business.ConfigHelper; import tourplaner.business.ConfigHelper;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;

View File

@ -4,9 +4,6 @@ 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.TextField;
import javafx.scene.control.cell.PropertyValueFactory; import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.image.ImageView; import javafx.scene.image.ImageView;
import javafx.scene.input.MouseEvent; import javafx.scene.input.MouseEvent;
@ -38,7 +35,6 @@ public class TourplanerController implements Initializable {
//Menue //Menue
public CheckMenuItem openmap, openpdf; public CheckMenuItem openmap, openpdf;
public RadioMenuItem langenglisch, langdeutsch; public RadioMenuItem langenglisch, langdeutsch;
private ToggleGroup langgroup;
public Menu menueFile, menuebearbeiten, menueoptionen, menuesprachen, menuehilfe; public Menu menueFile, menuebearbeiten, menueoptionen, menuesprachen, menuehilfe;
public MenuItem reportsummary, tourreport, beendenButton; public MenuItem reportsummary, tourreport, beendenButton;
//Elemente //Elemente
@ -134,11 +130,11 @@ public class TourplanerController implements Initializable {
progressBar.addProgress(10); progressBar.addProgress(10);
syncTour(selectedItem); syncTour(selectedItem);
progressBar.addProgress(10); progressBar.addProgress(10);
startCol.setCellValueFactory(new PropertyValueFactory<Tour, String>("start")); startCol.setCellValueFactory(new PropertyValueFactory<>("start"));
zielCol.setCellValueFactory(new PropertyValueFactory<Tour, String>("ziel")); zielCol.setCellValueFactory(new PropertyValueFactory<>("ziel"));
dauerCol.setCellValueFactory(new PropertyValueFactory<Tour, String>("dauer")); dauerCol.setCellValueFactory(new PropertyValueFactory<>("dauer"));
streckeCol.setCellValueFactory(new PropertyValueFactory<Tour, String>("strecke")); streckeCol.setCellValueFactory(new PropertyValueFactory<>("strecke"));
nameCol.setCellValueFactory(new PropertyValueFactory<Tour, String>("name")); nameCol.setCellValueFactory(new PropertyValueFactory<>("name"));
//Log anzeigen //Log anzeigen
logTableView.setPlaceholder(new Label( ConfigHelper.getLangIniString("keinelogsvorhanden"))); logTableView.setPlaceholder(new Label( ConfigHelper.getLangIniString("keinelogsvorhanden")));
@ -146,15 +142,15 @@ public class TourplanerController implements Initializable {
progressBar.addProgress(10); progressBar.addProgress(10);
logTableView.setItems(this.viewModel.getLogData()); logTableView.setItems(this.viewModel.getLogData());
progressBar.addProgress(10); progressBar.addProgress(10);
logDauerCol.setCellValueFactory(new PropertyValueFactory<Log, String>("dauer")); logDauerCol.setCellValueFactory(new PropertyValueFactory<>("dauer"));
logStreckeCol.setCellValueFactory(new PropertyValueFactory<Log, String>("strecke")); logStreckeCol.setCellValueFactory(new PropertyValueFactory<>("strecke"));
logDatumCol.setCellValueFactory(new PropertyValueFactory<Log, String>("datum")); logDatumCol.setCellValueFactory(new PropertyValueFactory<>("datum"));
logAvgCol.setCellValueFactory(new PropertyValueFactory<Log, String>("avgspeed")); logAvgCol.setCellValueFactory(new PropertyValueFactory<>("avgspeed"));
logHightCol.setCellValueFactory(new PropertyValueFactory<Log, String>("hightmeter")); logHightCol.setCellValueFactory(new PropertyValueFactory<>("hightmeter"));
logPauseCol.setCellValueFactory(new PropertyValueFactory<Log, String>("pause")); logPauseCol.setCellValueFactory(new PropertyValueFactory<>("pause"));
logGegangenCol.setCellValueFactory(new PropertyValueFactory<Log, String>("gegangen")); logGegangenCol.setCellValueFactory(new PropertyValueFactory<>("gegangen"));
logBemerkungCol.setCellValueFactory(new PropertyValueFactory<Log, String>("bemerkung")); logBemerkungCol.setCellValueFactory(new PropertyValueFactory<>("bemerkung"));
logRatingCol1.setCellValueFactory(new PropertyValueFactory<Log, String>("rating")); logRatingCol1.setCellValueFactory(new PropertyValueFactory<>("rating"));
progressBar.addProgress(10); progressBar.addProgress(10);
mapImageView.setImage(this.viewModel.getImage(this.viewModel.getSelectedTour().getName())); mapImageView.setImage(this.viewModel.getImage(this.viewModel.getSelectedTour().getName()));
if(this.viewModel.isSucheAktiv()){ if(this.viewModel.isSucheAktiv()){
@ -257,9 +253,9 @@ public class TourplanerController implements Initializable {
}else { }else {
this.openmap.setSelected(false); this.openmap.setSelected(false);
} }
this.langgroup = new ToggleGroup(); ToggleGroup langgroup = new ToggleGroup();
this.langdeutsch.setToggleGroup(this.langgroup); this.langdeutsch.setToggleGroup(langgroup);
this.langenglisch.setToggleGroup(this.langgroup); this.langenglisch.setToggleGroup(langgroup);
if(ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "lang", "lang").equals("langde")){ if(ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "lang", "lang").equals("langde")){
this.langdeutsch.setSelected(true); this.langdeutsch.setSelected(true);
this.langenglisch.setSelected(false); this.langenglisch.setSelected(false);
@ -347,12 +343,4 @@ public class TourplanerController implements Initializable {
this.viewModel.sumReport(); this.viewModel.sumReport();
} }
/**
* Funktion für noch nicht implementierte sachen wie im Menu der 'Bearbeiten' und 'Optionen' Knopf
*/
@FXML
private void nimpButton(){
this.viewModel.nimpButton();
}
} }

View File

@ -235,8 +235,6 @@ public class ViewModel {
Log newLog = new Log(this.selectedLog.getId(), dauer, datum, strecke, this.neueBemerkung, hightmeter, pause, rating + ""); Log newLog = new Log(this.selectedLog.getId(), dauer, datum, strecke, this.neueBemerkung, hightmeter, pause, rating + "");
this.logData.removeIf(ld -> ld.getId().equals(this.selectedLog.getId())); this.logData.removeIf(ld -> ld.getId().equals(this.selectedLog.getId()));
this.logData.add(newLog); this.logData.add(newLog);
// tourAkt.get().delLog(this.selectedLog.getId());
// 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);
@ -427,14 +425,6 @@ public class ViewModel {
this.selectedLog = getLog(id); this.selectedLog = getLog(id);
} }
/**
* Holt das selectierte Log als Log Objekt
* @return Das selectierte Log Objekt
*/
public Log getSelectedLog(){
return this.selectedLog;
}
/** /**
* Holt ein Log anhand seiner ID * Holt ein Log anhand seiner ID
* @param id Id des Log Eintrags * @param id Id des Log Eintrags
@ -485,53 +475,18 @@ public class ViewModel {
this.logData.addAll(this.selectedTour.getLogs()); this.logData.addAll(this.selectedTour.getLogs());
} }
// /**
// * Selectiert eine Tour anhand des Tour Objects.
// * Kann z.b. verwerndet werden um das selectierte Tour Object zu bearbeiten
// * @param selected
// */
// public void setSelectedTour(Tour selected){
// this.selectedTour = selected;
// }
public Tour getSelectedTour() { public Tour getSelectedTour() {
return selectedTour; return selectedTour;
} }
public String getNeueTourZiel() {
return neueTourZiel;
}
public void setNeueTourZiel(String neueTourZiel) {
this.neueTourZiel = neueTourZiel;
}
public ObservableList<String> getTourNamen() { public ObservableList<String> getTourNamen() {
ArrayList<String> namen = new ArrayList<>(); ArrayList<String> namen = new ArrayList<>();
getTourData().forEach(s -> { getTourData().forEach(s -> namen.add(s.getName()));
namen.add(s.getName());
});
tourNamen.clear(); tourNamen.clear();
tourNamen.addAll(namen); tourNamen.addAll(namen);
return tourNamen; return tourNamen;
} }
public String getNeueTourName() {
return neueTourName;
}
public void setNeueTourName(String neueTourName) {
this.neueTourName = neueTourName;
}
public String getNeueTourStart() {
return neueTourStart;
}
public void setNeueTourStart(String neueTourStart) {
this.neueTourStart = neueTourStart;
}
public ObservableList<Tour> getTourData() { public ObservableList<Tour> getTourData() {
tourData.clear(); tourData.clear();
ArrayList<Tour> touren = TourPlaner.getAllTours(); ArrayList<Tour> touren = TourPlaner.getAllTours();