Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
03fb15b62b | |||
a8f2ce36e5 | |||
a345cb5e49 | |||
29476f49e7 | |||
df1cef295b | |||
a7479726ac | |||
33aaaebe89 | |||
18aa9ffce6 |
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,2 +1,3 @@
|
||||
.idea/
|
||||
out/
|
||||
out/
|
||||
conf.ini
|
||||
|
@ -0,0 +1,8 @@
|
||||
# Tourplaner
|
||||
|
||||
# Config
|
||||
* 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
|
9
conf.ini
9
conf.ini
@ -1,9 +0,0 @@
|
||||
[start]
|
||||
message = Tour Planer App gestartet
|
||||
|
||||
[db]
|
||||
dbname = tourplaner
|
||||
url = 192.168.1.116
|
||||
port = 5432
|
||||
user = user
|
||||
pw = user
|
39
conf.ini.sample
Normal file
39
conf.ini.sample
Normal file
@ -0,0 +1,39 @@
|
||||
[start]
|
||||
message = Tour Planer App gestartet
|
||||
|
||||
[db]
|
||||
dbname = tourplaner
|
||||
url =
|
||||
port = 5432
|
||||
user =
|
||||
pw =
|
||||
|
||||
[hilfe]
|
||||
gitrepo = https://git.dergeorg.at/dergeorg/tourplaner
|
||||
doxygendoc = https://git.dergeorg.at/dergeorg/tourplaner
|
||||
javadoc = https://git.dergeorg.at/dergeorg/tourplaner
|
||||
|
||||
|
||||
[langde]
|
||||
achtung = ACHTUNG
|
||||
openbrowsererror = TourplanerController -> Browser:
|
||||
browserexception = Browser Exception
|
||||
browserexceptionmsg = Error beim öffnen des Browsers
|
||||
suchfeldleer = Suchfeld ist leer!
|
||||
suchtextzuerst = Bitte zuerst den Suchtext in das Suchfeld eingeben!
|
||||
keinetourselected = Keine Tour ausgewählt!
|
||||
tournametitle = Tourname
|
||||
tournameheader = Bitte geben Sie den Namen der Tour an!
|
||||
tournamemsg = Name:
|
||||
namevergebenheader = Name bereits vergeben!
|
||||
namevergebenmsg1 = Der Name '
|
||||
namevergebenmsg2 = ' ist bereits vergeben, bitte verwenden Sie einen andern!
|
||||
startpunkttitle = Tour Startpunkt
|
||||
startpunktheader = Bitte geben Sie den Startpunkt der Tour an!
|
||||
startpunktmsg = Startpunkt:
|
||||
zielpunkttitle = Tour zielpunkt
|
||||
zielpunktheader = Bitte geben Sie den Zielpunkt der Tour an!
|
||||
zielpunktmsg = Zielpunkt:
|
||||
deltournoselect = ViewModel -> DelTour
|
||||
deltournoselectmsg = Bitte wählen Sie zuerst eine Tour aus, bevor Sie auf löschen klicken!
|
||||
exceptionstackheader = Exception stacktrace:
|
@ -63,3 +63,77 @@ App started
|
||||
2021-03-03 15:50:47 INFO PostgresHelper:15 - User Table created
|
||||
2021-03-03 15:52:06 INFO TourPlaner:15 - Tour Planer App gestartet
|
||||
2021-03-03 15:52:07 INFO PostgresHelper:15 - User Table created
|
||||
2021-03-16 22:03:23 INFO TourPlaner:15 - Tour Planer App gestartet
|
||||
2021-03-16 22:03:23 INFO PostgresHelper:15 - User Table created
|
||||
2021-03-16 22:03:25 ERROR PSQLException:33 - Connection to 192.168.1.116:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
|
||||
2021-03-16 22:03:25 ERROR NullPointerException:33 -
|
||||
2021-03-16 22:03:58 INFO TourPlaner:15 - Tour Planer App gestartet
|
||||
2021-03-16 22:03:58 INFO PostgresHelper:15 - User Table created
|
||||
2021-03-16 22:04:00 ERROR PSQLException:33 - Connection to 192.168.1.116:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
|
||||
2021-03-16 22:04:00 ERROR NullPointerException:33 -
|
||||
2021-03-16 22:04:06 INFO TourPlaner:15 - Tour Planer App gestartet
|
||||
2021-03-16 22:04:06 INFO PostgresHelper:15 - User Table created
|
||||
2021-03-16 22:04:08 ERROR PSQLException:33 - Connection to 192.168.1.116:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
|
||||
2021-03-16 22:04:08 ERROR NullPointerException:33 -
|
||||
2021-03-17 13:13:25 INFO TourPlaner:15 - Tour Planer App gestartet
|
||||
2021-03-17 13:13:25 INFO PostgresHelper:15 - User Table created
|
||||
2021-03-17 13:13:27 ERROR PSQLException:33 - Connection to 192.168.1.116:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
|
||||
2021-03-17 13:13:27 ERROR NullPointerException:33 -
|
||||
2021-03-17 14:39:16 INFO TourPlaner:15 - Tour Planer App gestartet
|
||||
2021-03-17 14:39:16 INFO PostgresHelper:15 - User Table created
|
||||
2021-03-17 14:39:18 ERROR PSQLException:33 - Connection to 192.168.1.116:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
|
||||
2021-03-17 14:39:18 ERROR NullPointerException:33 -
|
||||
2021-03-17 14:46:45 INFO TourPlaner:15 - Tour Planer App gestartet
|
||||
2021-03-17 14:46:45 INFO PostgresHelper:15 - User Table created
|
||||
2021-03-17 14:46:47 ERROR PSQLException:33 - Connection to 192.168.1.116:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
|
||||
2021-03-17 14:46:47 ERROR NullPointerException:33 -
|
||||
2021-03-17 14:48:46 INFO TourPlaner:15 - Tour Planer App gestartet
|
||||
2021-03-17 14:48:46 INFO PostgresHelper:15 - User Table created
|
||||
2021-03-17 14:48:48 ERROR PSQLException:33 - Connection to 192.168.1.116:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
|
||||
2021-03-17 14:48:48 ERROR NullPointerException:33 -
|
||||
2021-03-17 15:20:09 INFO TourPlaner:15 - Tour Planer App gestartet
|
||||
2021-03-17 15:20:09 INFO PostgresHelper:15 - User Table created
|
||||
2021-03-17 15:20:11 ERROR PSQLException:33 - Connection to 192.168.1.116:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
|
||||
2021-03-17 15:20:11 ERROR NullPointerException:33 -
|
||||
2021-03-17 15:36:24 ERROR ViewModel -> DelTour:33 - Keine Tour ausgewählt!
|
||||
2021-03-17 15:38:41 ERROR ViewModel -> DelTour:33 - Keine Tour ausgewählt!
|
||||
2021-03-17 16:02:24 INFO TourPlaner:15 - Tour Planer App gestartet
|
||||
2021-03-17 16:02:24 INFO PostgresHelper:15 - User Table created
|
||||
2021-03-17 16:02:26 ERROR PSQLException:33 - Connection to 192.168.1.116:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
|
||||
2021-03-17 16:02:26 ERROR NullPointerException:33 -
|
||||
2021-03-17 16:03:16 INFO TourPlaner:15 - Tour Planer App gestartet
|
||||
2021-03-17 16:03:16 INFO PostgresHelper:15 - User Table created
|
||||
2021-03-17 16:03:18 ERROR PSQLException:33 - Connection to 192.168.1.116:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
|
||||
2021-03-17 16:03:18 ERROR NullPointerException:33 -
|
||||
2021-03-17 16:04:18 INFO TourPlaner:15 - Tour Planer App gestartet
|
||||
2021-03-17 16:04:18 INFO PostgresHelper:15 - User Table created
|
||||
2021-03-17 16:04:20 ERROR PSQLException:33 - Connection to 192.168.1.116:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
|
||||
2021-03-17 16:04:20 ERROR NullPointerException:33 -
|
||||
2021-03-17 16:04:26 INFO TourPlaner:15 - Tour Planer App gestartet
|
||||
2021-03-17 16:04:26 INFO PostgresHelper:15 - User Table created
|
||||
2021-03-17 16:04:28 ERROR PSQLException:33 - Connection to 192.168.1.116:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
|
||||
2021-03-17 16:04:28 ERROR NullPointerException:33 -
|
||||
2021-03-17 16:06:47 INFO TourPlaner:15 - Tour Planer App gestartet
|
||||
2021-03-17 16:06:47 INFO PostgresHelper:15 - User Table created
|
||||
2021-03-17 16:06:49 ERROR PSQLException:33 - Connection to 192.168.1.116:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
|
||||
2021-03-17 16:06:49 ERROR NullPointerException:33 -
|
||||
2021-03-17 16:06:55 INFO TourPlaner:15 - Tour Planer App gestartet
|
||||
2021-03-17 16:06:55 INFO PostgresHelper:15 - User Table created
|
||||
2021-03-17 16:06:57 ERROR PSQLException:33 - Connection to 192.168.1.116:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
|
||||
2021-03-17 16:06:57 ERROR NullPointerException:33 -
|
||||
2021-03-17 17:02:33 INFO TourPlaner:15 - Tour Planer App gestartet
|
||||
2021-03-17 17:02:33 INFO PostgresHelper:15 - User Table created
|
||||
2021-03-17 17:02:35 ERROR PSQLException:33 - Connection to 192.168.1.116:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
|
||||
2021-03-17 17:02:35 ERROR NullPointerException:33 -
|
||||
2021-03-17 17:02:38 INFO TourPlaner:15 - Tour Planer App gestartet
|
||||
2021-03-17 17:02:38 INFO PostgresHelper:15 - User Table created
|
||||
2021-03-17 17:02:40 ERROR PSQLException:33 - Connection to 192.168.1.116:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
|
||||
2021-03-17 17:02:40 ERROR NullPointerException:33 -
|
||||
2021-03-17 17:08:23 INFO TourPlaner:15 - Tour Planer App gestartet
|
||||
2021-03-17 17:08:23 INFO PostgresHelper:15 - User Table created
|
||||
2021-03-17 17:08:25 ERROR PSQLException:33 - Connection to 192.168.1.116:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
|
||||
2021-03-17 17:08:25 ERROR NullPointerException:33 -
|
||||
2021-03-17 17:08:31 INFO TourPlaner:15 - Tour Planer App gestartet
|
||||
2021-03-17 17:08:31 INFO PostgresHelper:15 - User Table created
|
||||
2021-03-17 17:08:33 ERROR PSQLException:33 - Connection to 192.168.1.116:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
|
||||
2021-03-17 17:08:33 ERROR NullPointerException:33 -
|
||||
|
@ -6,7 +6,7 @@ import javafx.scene.Parent;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
import tourplaner.business.LogHelper;
|
||||
import tourplaner.business.ConfigHelper;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@ -20,7 +20,7 @@ public class Main extends Application {
|
||||
@Override
|
||||
public void start(Stage primaryStage) throws IOException {
|
||||
Parent root = FXMLLoader.load(Main.class.getResource("tourplaner.fxml"));
|
||||
primaryStage.setTitle("DerGeorg Touren Planer");
|
||||
primaryStage.setTitle(ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "start", "apptitle"));
|
||||
primaryStage.setScene(new Scene(root, 600, 600));
|
||||
primaryStage.show();
|
||||
}
|
||||
|
79
src/tourplaner/business/AlertHelper.java
Normal file
79
src/tourplaner/business/AlertHelper.java
Normal file
@ -0,0 +1,79 @@
|
||||
package tourplaner.business;
|
||||
|
||||
import javafx.scene.control.Alert;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.TextArea;
|
||||
import javafx.scene.control.TextInputDialog;
|
||||
import javafx.scene.layout.GridPane;
|
||||
import javafx.scene.layout.Priority;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
public class AlertHelper {
|
||||
public static void warn(String title, String header, String msg){
|
||||
alertType(Alert.AlertType.WARNING, title, header, msg);
|
||||
}
|
||||
public static void inform(String title, String header, String msg){
|
||||
alertType(Alert.AlertType.INFORMATION, title, header, msg);
|
||||
}
|
||||
|
||||
public static void informNoHeader(String title, String msg){
|
||||
inform(title, null, msg);
|
||||
}
|
||||
|
||||
public static void error(String title, String header, String msg){
|
||||
alertType(Alert.AlertType.ERROR, title, header, msg);
|
||||
}
|
||||
|
||||
public static void exerror(String title, String header, String msg, Exception ex){
|
||||
Alert alert = new Alert(Alert.AlertType.ERROR);
|
||||
alert.setTitle(title);
|
||||
alert.setHeaderText(header);
|
||||
alert.setContentText(msg);
|
||||
StringWriter sw = new StringWriter();
|
||||
PrintWriter pw = new PrintWriter(sw);
|
||||
ex.printStackTrace(pw);
|
||||
String exceptionText = sw.toString();
|
||||
Label label = new Label(ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "exceptionstackheader"));
|
||||
TextArea textArea = new TextArea(exceptionText);
|
||||
textArea.setEditable(false);
|
||||
textArea.setWrapText(true);
|
||||
textArea.setMaxWidth(Double.MAX_VALUE);
|
||||
textArea.setMaxHeight(Double.MAX_VALUE);
|
||||
GridPane.setVgrow(textArea, Priority.ALWAYS);
|
||||
GridPane.setHgrow(textArea, Priority.ALWAYS);
|
||||
GridPane expContent = new GridPane();
|
||||
expContent.setMaxWidth(Double.MAX_VALUE);
|
||||
expContent.add(label, 0, 0);
|
||||
expContent.add(textArea, 0, 1);
|
||||
alert.getDialogPane().setExpandableContent(expContent);
|
||||
alert.showAndWait();
|
||||
}
|
||||
|
||||
private static void alertType(Alert.AlertType alertly, String title, String header, String msg){
|
||||
Alert alert = new Alert(alertly);
|
||||
alert.setTitle(title);
|
||||
alert.setHeaderText(header);
|
||||
alert.setContentText(msg);
|
||||
|
||||
alert.showAndWait();
|
||||
}
|
||||
|
||||
public static String inputText(String title, String header, String msg) {
|
||||
TextInputDialog dialog = new TextInputDialog();
|
||||
dialog.setTitle(title);
|
||||
dialog.setHeaderText(header);
|
||||
dialog.setContentText(msg);
|
||||
Optional<String> result = dialog.showAndWait();
|
||||
AtomicReference<String> returnText = new AtomicReference<>("");
|
||||
result.ifPresent(returnText::set);
|
||||
if(!returnText.get().isEmpty()){
|
||||
return returnText.get();
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,6 +1,5 @@
|
||||
package tourplaner.business;
|
||||
|
||||
import javafx.stage.Stage;
|
||||
import org.apache.log4j.Logger;
|
||||
import tourplaner.data.DbConnect;
|
||||
|
||||
@ -10,14 +9,14 @@ import tourplaner.data.DbConnect;
|
||||
public class TourPlaner{
|
||||
private Logger logger;
|
||||
|
||||
/**
|
||||
* Startet alle bennötigten Komponenten
|
||||
* @param primaryStage Stage für den Presenter
|
||||
*/
|
||||
public TourPlaner(Stage primaryStage){
|
||||
String startText = ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "start", "message");
|
||||
LogHelper.info(startText, "TourPlaner");
|
||||
public TourPlaner(){
|
||||
LogHelper.info(ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "start", "message"),
|
||||
ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "start", "app"));
|
||||
new DbConnect().init();
|
||||
|
||||
}
|
||||
|
||||
public String getMapJson(String start, String ziel){
|
||||
return start + " " + ziel;
|
||||
}
|
||||
}
|
||||
|
@ -6,22 +6,18 @@ package tourplaner.object;
|
||||
public class Tour {
|
||||
private String dauer;
|
||||
private String mapJson;
|
||||
private double distanz;
|
||||
private double strecke;
|
||||
private String name;
|
||||
private String start;
|
||||
private String ziel;
|
||||
|
||||
public Tour(String name, String dauer, String mapJson, double distanz) {
|
||||
public Tour(String name, String dauer, String mapJson, double strecke, String start, String ziel) {
|
||||
this.dauer = dauer;
|
||||
this.mapJson = mapJson;
|
||||
this.distanz = distanz;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.strecke = strecke;
|
||||
this.name = name;
|
||||
this.start = start;
|
||||
this.ziel = ziel;
|
||||
}
|
||||
|
||||
public String getDauer() {
|
||||
@ -40,11 +36,35 @@ public class Tour {
|
||||
this.mapJson = mapJson;
|
||||
}
|
||||
|
||||
public double getDistanz() {
|
||||
return distanz;
|
||||
public double getStrecke() {
|
||||
return strecke;
|
||||
}
|
||||
|
||||
public void setDistanz(double distanz) {
|
||||
this.distanz = distanz;
|
||||
public void setStrecke(double strecke) {
|
||||
this.strecke = strecke;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getStart() {
|
||||
return start;
|
||||
}
|
||||
|
||||
public void setStart(String start) {
|
||||
this.start = start;
|
||||
}
|
||||
|
||||
public String getZiel() {
|
||||
return ziel;
|
||||
}
|
||||
|
||||
public void setZiel(String ziel) {
|
||||
this.ziel = ziel;
|
||||
}
|
||||
}
|
||||
|
@ -32,77 +32,54 @@
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-->
|
||||
|
||||
<?import javafx.geometry.*?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
<?import javafx.scene.paint.*?>
|
||||
<?import javafx.scene.text.*?>
|
||||
<?import javafx.scene.web.*?>
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.control.ListView?>
|
||||
<?import javafx.scene.control.Menu?>
|
||||
<?import javafx.scene.control.MenuBar?>
|
||||
<?import javafx.scene.control.MenuItem?>
|
||||
<?import javafx.scene.control.SplitPane?>
|
||||
<?import javafx.scene.control.Tab?>
|
||||
<?import javafx.scene.control.TabPane?>
|
||||
<?import javafx.scene.control.TableColumn?>
|
||||
<?import javafx.scene.control.TableView?>
|
||||
<?import javafx.scene.control.TextField?>
|
||||
<?import javafx.scene.layout.AnchorPane?>
|
||||
<?import javafx.scene.layout.HBox?>
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
<?import javafx.scene.paint.Color?>
|
||||
<?import javafx.scene.text.Font?>
|
||||
|
||||
<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/15.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="tourplaner.ui.TourplanerController">
|
||||
<children>
|
||||
<MenuBar VBox.vgrow="NEVER">
|
||||
<menus>
|
||||
<Menu fx:id="menueFile" mnemonicParsing="false" text="Datei">
|
||||
<items>
|
||||
<MenuItem mnemonicParsing="false" text="Neu" />
|
||||
<MenuItem mnemonicParsing="false" text="Öffnen" />
|
||||
<Menu mnemonicParsing="false" text="Open Recent" />
|
||||
<SeparatorMenuItem mnemonicParsing="false" />
|
||||
<MenuItem mnemonicParsing="false" text="Close" />
|
||||
<MenuItem mnemonicParsing="false" text="Save" />
|
||||
<MenuItem mnemonicParsing="false" text="Save As…" />
|
||||
<MenuItem mnemonicParsing="false" text="Revert" />
|
||||
<SeparatorMenuItem mnemonicParsing="false" />
|
||||
<MenuItem mnemonicParsing="false" text="Preferences…" />
|
||||
<SeparatorMenuItem mnemonicParsing="false" />
|
||||
<MenuItem mnemonicParsing="false" text="Quit" />
|
||||
<MenuItem fx:id="beendenButton" mnemonicParsing="false" onAction="#quitApp" text="Beenden" />
|
||||
</items>
|
||||
</Menu>
|
||||
<Menu mnemonicParsing="false" text="Bearbeiten">
|
||||
<items>
|
||||
<MenuItem mnemonicParsing="false" text="Undo" />
|
||||
<MenuItem mnemonicParsing="false" text="Redo" />
|
||||
<SeparatorMenuItem mnemonicParsing="false" />
|
||||
<MenuItem mnemonicParsing="false" text="Cut" />
|
||||
<MenuItem mnemonicParsing="false" text="Copy" />
|
||||
<MenuItem mnemonicParsing="false" text="Paste" />
|
||||
<MenuItem mnemonicParsing="false" text="Delete" />
|
||||
<SeparatorMenuItem mnemonicParsing="false" />
|
||||
<MenuItem mnemonicParsing="false" text="Select All" />
|
||||
<MenuItem mnemonicParsing="false" text="Unselect All" />
|
||||
</items>
|
||||
</Menu>
|
||||
<Menu mnemonicParsing="false" text="Optionen">
|
||||
<items>
|
||||
<MenuItem mnemonicParsing="false" text="Undo" />
|
||||
<MenuItem mnemonicParsing="false" text="Redo" />
|
||||
<SeparatorMenuItem mnemonicParsing="false" />
|
||||
<MenuItem mnemonicParsing="false" text="Cut" />
|
||||
<MenuItem mnemonicParsing="false" text="Copy" />
|
||||
<MenuItem mnemonicParsing="false" text="Paste" />
|
||||
<MenuItem mnemonicParsing="false" text="Delete" />
|
||||
<SeparatorMenuItem mnemonicParsing="false" />
|
||||
<MenuItem mnemonicParsing="false" text="Select All" />
|
||||
<MenuItem mnemonicParsing="false" text="Unselect All" />
|
||||
</items>
|
||||
</Menu>
|
||||
<Menu mnemonicParsing="false" text="Bearbeiten" />
|
||||
<Menu mnemonicParsing="false" text="Optionen" />
|
||||
<Menu mnemonicParsing="false" text="Hilfe">
|
||||
<items>
|
||||
<MenuItem mnemonicParsing="false" text="About MyHelloApp" />
|
||||
<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>
|
||||
</menus>
|
||||
</MenuBar>
|
||||
<HBox id="HBox" alignment="CENTER_LEFT" layoutX="10.0" layoutY="588.0" spacing="5.0">
|
||||
<children>
|
||||
<AnchorPane prefHeight="-1.0" prefWidth="-1.0" HBox.hgrow="ALWAYS">
|
||||
<AnchorPane prefWidth="-1.0" HBox.hgrow="ALWAYS">
|
||||
<children>
|
||||
<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="-" />
|
||||
</children></AnchorPane>
|
||||
<TextField fx:id="sucheInput" text="Suche...." />
|
||||
<TextField fx:id="sucheInput" promptText="Suche..." />
|
||||
<Button fx:id="sucheButton" mnemonicParsing="false" onAction="#suche" text="Suchen" />
|
||||
</children>
|
||||
<padding>
|
||||
@ -111,20 +88,16 @@
|
||||
</HBox>
|
||||
<SplitPane dividerPositions="0.21492204899777284" focusTraversable="true" prefHeight="522.0" prefWidth="900.0" VBox.vgrow="ALWAYS">
|
||||
<items>
|
||||
<AnchorPane prefHeight="520.0" prefWidth="239.0">
|
||||
<AnchorPane prefWidth="239.0">
|
||||
<children>
|
||||
<ListView fx:id="TourListView" layoutX="-1.0" prefHeight="520.0" prefWidth="190.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<padding>
|
||||
<Insets bottom="20.0" left="20.0" right="20.0" top="20.0" />
|
||||
</padding>
|
||||
</ListView>
|
||||
<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" />
|
||||
</children>
|
||||
</AnchorPane>
|
||||
<SplitPane dividerPositions="0.5" orientation="VERTICAL" prefHeight="496.0" prefWidth="620.0">
|
||||
<items>
|
||||
<VBox prefHeight="200.0" prefWidth="100.0">
|
||||
<VBox prefWidth="100.0">
|
||||
<children>
|
||||
<AnchorPane prefHeight="51.0" prefWidth="676.0">
|
||||
<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>
|
||||
@ -133,26 +106,34 @@
|
||||
<Insets left="10.0" />
|
||||
</HBox.margin>
|
||||
</Label>
|
||||
<TextField fx:id="titleInput" />
|
||||
<TextField fx:id="titleTextView" editable="false" />
|
||||
</children>
|
||||
</HBox>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
<AnchorPane prefHeight="200.0" prefWidth="200.0">
|
||||
<AnchorPane prefWidth="200.0">
|
||||
<children>
|
||||
<TabPane layoutX="1.0" layoutY="69.0" prefHeight="225.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">
|
||||
<tabs>
|
||||
<Tab text="Route">
|
||||
<Tab fx:id="kartenTab" text="Karte">
|
||||
<content>
|
||||
<AnchorPane prefHeight="200.0" prefWidth="200.0">
|
||||
<AnchorPane />
|
||||
</content></Tab>
|
||||
<Tab fx:id="beschreibungTab" text="Beschreibung">
|
||||
<content>
|
||||
<AnchorPane>
|
||||
<children>
|
||||
<WebView id="mapView" prefHeight="200.0" prefWidth="200.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
|
||||
<TableView fx:id="beschreibungTableView" prefHeight="200.0" prefWidth="200.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<columns>
|
||||
<TableColumn fx:id="nameCol" maxWidth="1.7976931348623157E308" minWidth="70.0" prefWidth="-1.0" text="Tourname" />
|
||||
<TableColumn fx:id="dauerCol" maxWidth="1.7976931348623157E308" minWidth="40.0" prefWidth="-1.0" text="Dauer" />
|
||||
<TableColumn fx:id="streckeCol" maxWidth="1.7976931348623157E308" minWidth="50.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>
|
||||
<Tab text="Description">
|
||||
<content>
|
||||
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0" />
|
||||
</content>
|
||||
</Tab>
|
||||
</tabs>
|
||||
@ -161,13 +142,13 @@
|
||||
</AnchorPane>
|
||||
</children>
|
||||
</VBox>
|
||||
<AnchorPane prefHeight="200.0" prefWidth="200.0">
|
||||
<AnchorPane prefWidth="200.0">
|
||||
<children>
|
||||
<VBox prefHeight="200.0" 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">
|
||||
<children>
|
||||
<AnchorPane prefHeight="51.0" prefWidth="676.0">
|
||||
<AnchorPane prefWidth="676.0">
|
||||
<children>
|
||||
<HBox id="HBox" alignment="CENTER_LEFT" prefHeight="38.0" prefWidth="702.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" prefWidth="702.0" spacing="5.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<children>
|
||||
<Label text="Logs:">
|
||||
<HBox.margin>
|
||||
@ -191,14 +172,17 @@
|
||||
</HBox>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
<AnchorPane prefHeight="200.0" prefWidth="200.0">
|
||||
<AnchorPane prefWidth="200.0">
|
||||
<children>
|
||||
<TableView prefHeight="209.0" prefWidth="702.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<TableView AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<columns>
|
||||
<TableColumn prefWidth="238.0" text="Date" />
|
||||
<TableColumn prefWidth="223.0" text="Duration" />
|
||||
<TableColumn prefWidth="240.0" text="Distance" />
|
||||
</columns>
|
||||
<columnResizePolicy>
|
||||
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
|
||||
</columnResizePolicy>
|
||||
</TableView>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
|
@ -1,13 +1,27 @@
|
||||
package tourplaner.ui;
|
||||
|
||||
import javafx.collections.ObservableList;
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.geometry.Orientation;
|
||||
import javafx.scene.control.ListView;
|
||||
import javafx.scene.control.SelectionMode;
|
||||
import javafx.scene.control.*;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.control.cell.PropertyValueFactory;
|
||||
import javafx.scene.input.MouseEvent;
|
||||
import javafx.scene.layout.Pane;
|
||||
import javafx.scene.web.WebView;
|
||||
import tourplaner.business.AlertHelper;
|
||||
import tourplaner.business.ConfigHelper;
|
||||
import tourplaner.business.LogHelper;
|
||||
import tourplaner.object.Tour;
|
||||
import tourplaner.viewmodels.ViewModel;
|
||||
|
||||
import java.awt.*;
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
@ -15,29 +29,132 @@ public class TourplanerController implements Initializable {
|
||||
|
||||
public ViewModel viewModel = new ViewModel();
|
||||
public ListView<String> TourListView = new ListView<>();
|
||||
public TabPane viewTabPane;
|
||||
public Tab kartenTab, beschreibungTab;
|
||||
public TableView<Tour> beschreibungTableView;
|
||||
public TableColumn<Tour, String> startCol, zielCol, dauerCol, streckeCol, nameCol;
|
||||
public TextField titleTextView, sucheInput;
|
||||
|
||||
/**
|
||||
* Öffnet github im standart browser
|
||||
*
|
||||
*/
|
||||
@FXML
|
||||
private void gitWebBrowser(){
|
||||
openBrowser(ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "hilfe", "gitrepo"), "Git");
|
||||
}
|
||||
|
||||
/**
|
||||
* Öffnet Java Doc im standart browser
|
||||
*
|
||||
*/
|
||||
@FXML
|
||||
private void javaDocBrowser(){
|
||||
openBrowser(ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "hilfe", "javadoc"), "JavaDoc");
|
||||
}
|
||||
|
||||
/**
|
||||
* Öffnet Doxygen Doc im standart browser
|
||||
*
|
||||
*/
|
||||
@FXML
|
||||
private void doxygenDocBrowser(){
|
||||
openBrowser(ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "hilfe", "doxygendoc"), "Doxygen");
|
||||
}
|
||||
|
||||
/**
|
||||
* Öffnet einen link im Standart Browser
|
||||
* @param uriString
|
||||
* @param appname
|
||||
*/
|
||||
private void openBrowser(String uriString, String appname){
|
||||
Desktop desktop = java.awt.Desktop.getDesktop();
|
||||
try {
|
||||
URI oURL = new URI(
|
||||
uriString);
|
||||
desktop.browse(oURL);
|
||||
} catch (URISyntaxException | IOException e) {
|
||||
LogHelper.error(e.getMessage(), ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "openbrowsererror") + appname);
|
||||
AlertHelper.exerror(ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "browserexception"),
|
||||
ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "openbrowsererror") + appname,
|
||||
ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "browserexceptionmsg"), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Wird gestartet wenn eine Tour in der Tour listView ausgewählt wird
|
||||
* @param mouseEvent Triggered Event
|
||||
*/
|
||||
@FXML
|
||||
private void tourListSelectedItem(MouseEvent mouseEvent){
|
||||
String selectedItem = TourListView.getSelectionModel().getSelectedItem();
|
||||
this.viewModel.selectTour(selectedItem);
|
||||
titleTextView.setText(selectedItem);
|
||||
beschreibungTableView.getItems().removeIf(s -> true); //Leert die Table View komplett
|
||||
beschreibungTableView.getItems().add(this.viewModel.getTour(selectedItem));
|
||||
startCol.setCellValueFactory(new PropertyValueFactory<Tour, String>("start"));
|
||||
zielCol.setCellValueFactory(new PropertyValueFactory<Tour, String>("ziel"));
|
||||
dauerCol.setCellValueFactory(new PropertyValueFactory<Tour, String>("dauer"));
|
||||
streckeCol.setCellValueFactory(new PropertyValueFactory<Tour, String>("strecke"));
|
||||
nameCol.setCellValueFactory(new PropertyValueFactory<Tour, String>("name"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Beendet die App
|
||||
* Verbunden mit dem Menu -> Datei -> Beenden
|
||||
*/
|
||||
@FXML
|
||||
private void quitApp(){
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fügt eine Tour hinzu
|
||||
* Verbunden mit Button -> Tour -> +
|
||||
*/
|
||||
@FXML
|
||||
private void addTour(){
|
||||
this.viewModel.addTour();
|
||||
}
|
||||
|
||||
/**
|
||||
* Entfernt eine ausgewählte Tour
|
||||
* Verbunden mit Button -> Tour -> -
|
||||
*/
|
||||
@FXML
|
||||
private void delTour(){
|
||||
this.beschreibungTableView.getItems().removeIf(s -> true); //löscht alles aus der tabelle
|
||||
this.titleTextView.setText("Keine Tour ausgewählt!");
|
||||
this.viewModel.delTour();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sucht eine Tour
|
||||
* Verbunden mit Button -> Suche
|
||||
*/
|
||||
@FXML
|
||||
private void suche(){
|
||||
this.viewModel.suche();
|
||||
String sucheInput = this.sucheInput.getText();
|
||||
if(sucheInput.isEmpty()){
|
||||
AlertHelper.warn(ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "achtung"),
|
||||
ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "suchfeldleer"),
|
||||
ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "suchtextzuerst"));
|
||||
}else {
|
||||
this.viewModel.suche(sucheInput);
|
||||
}
|
||||
}
|
||||
|
||||
@FXML
|
||||
private WebView mapView;
|
||||
|
||||
/**
|
||||
* Wird beim Start ausgeführt
|
||||
* @param url
|
||||
* @param resourceBundle
|
||||
*/
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle resourceBundle) {
|
||||
TourListView.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
|
||||
TourListView.setOrientation(Orientation.VERTICAL);
|
||||
TourListView.setItems(this.viewModel.getTourNamen());
|
||||
this.beschreibungTableView.setPlaceholder(new Label( ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "keinetourselected")));
|
||||
this.titleTextView.setText( ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "keinetourselected"));
|
||||
}
|
||||
}
|
||||
|
@ -2,17 +2,91 @@ package tourplaner.viewmodels;
|
||||
|
||||
import javafx.collections.FXCollections;
|
||||
import javafx.collections.ObservableList;
|
||||
import javafx.scene.control.Alert;
|
||||
import javafx.scene.control.TextInputDialog;
|
||||
import tourplaner.business.AlertHelper;
|
||||
import tourplaner.business.ConfigHelper;
|
||||
import tourplaner.business.LogHelper;
|
||||
import tourplaner.business.TourPlaner;
|
||||
import tourplaner.object.Tour;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
public class ViewModel {
|
||||
|
||||
private final ObservableList<Tour> tourData = FXCollections.observableArrayList(new Tour("Test 1", "120", "json dings", 22.3),new Tour("Test 2", "210", "json dings", 42.3));
|
||||
private final ObservableList<Tour> tourData = FXCollections.observableArrayList(new Tour("Test 1", "120", "json dings", 22.3, "Wien", "Graz"),new Tour("Test 2", "210", "json dings", 42.3, "Da", "Dort"));
|
||||
private final ObservableList<String> tourNamen = FXCollections.observableArrayList("Test 1", "Test 2");
|
||||
//private final ObservableList<Tour> selectedTour = FXCollections.observableArrayList();
|
||||
private Tour selectedTour;
|
||||
private String neueTourName, neueTourStart, neueTourZiel;
|
||||
|
||||
private String neueTourName, neueTourStart;
|
||||
/**
|
||||
* Fügt eine neue Tour hinzu
|
||||
*/
|
||||
public void addTour(){
|
||||
while(this.neueTourName == null) {
|
||||
this.neueTourName = AlertHelper.inputText(ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "tournametitle"),
|
||||
ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "tournameheader"),
|
||||
ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "tournamemsg"));
|
||||
if (getTour(this.neueTourName) != null) {
|
||||
AlertHelper.warn(ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "achtung"),
|
||||
ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "namevergebenheader"),
|
||||
ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "namevergebenmsg1")
|
||||
+ this.neueTourName +
|
||||
ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "namevergebenmsg2"));
|
||||
this.neueTourName = null;
|
||||
}
|
||||
}
|
||||
while(this.neueTourStart == null){
|
||||
this.neueTourStart = AlertHelper.inputText(ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "startpunkttitle"),
|
||||
ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "startpunktheader"),
|
||||
ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "startpunktmsg"));
|
||||
}
|
||||
while(this.neueTourZiel == null){
|
||||
this.neueTourZiel = AlertHelper.inputText(ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "zielpunkttitle"),
|
||||
ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "zielpunktheader"),
|
||||
ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "zielpunktmsg"));
|
||||
}
|
||||
if (getTour(this.neueTourName) == null) {
|
||||
tourData.add(new Tour(this.neueTourName, "TBD", "TBD", 0, this.neueTourStart, this.neueTourZiel));
|
||||
tourNamen.add(this.neueTourName);
|
||||
}
|
||||
this.neueTourStart = null;
|
||||
this.neueTourZiel = null;
|
||||
this.neueTourName = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Holt das Tourobjekt anhand des Namens
|
||||
* @param tourname Name der Tour
|
||||
* @return Gefundene Tour
|
||||
*/
|
||||
public Tour getTour(String tourname){
|
||||
AtomicReference<Tour> returnTour = new AtomicReference<>();
|
||||
tourData.forEach(s -> {
|
||||
if(s.getName().equals(tourname)){
|
||||
returnTour.set(s);
|
||||
}
|
||||
});
|
||||
return returnTour.get();
|
||||
}
|
||||
|
||||
public void selectTour(String tourname){
|
||||
this.selectedTour = getTour(tourname);
|
||||
// this.selectedTour.removeIf(s -> true);//Alle deselect
|
||||
// this.selectedTour.add(getTour(tourname));
|
||||
}
|
||||
|
||||
public Tour getSelectedTour() {
|
||||
return selectedTour;
|
||||
}
|
||||
|
||||
public String getNeueTourZiel() {
|
||||
return neueTourZiel;
|
||||
}
|
||||
|
||||
public void setNeueTourZiel(String neueTourZiel) {
|
||||
this.neueTourZiel = neueTourZiel;
|
||||
}
|
||||
|
||||
public ObservableList<String> getTourNamen() {
|
||||
return tourNamen;
|
||||
@ -38,37 +112,27 @@ public class ViewModel {
|
||||
return tourData;
|
||||
}
|
||||
|
||||
public void addTour(){
|
||||
TextInputDialog dialog = new TextInputDialog("");
|
||||
dialog.setTitle("Tour Name");
|
||||
dialog.setHeaderText("Bitte geben Sie den Namen der Tour an!");
|
||||
dialog.setContentText("Name: ");
|
||||
|
||||
// Traditional way to get the response value.
|
||||
Optional<String> result = dialog.showAndWait();
|
||||
result.ifPresent(s -> {
|
||||
this.neueTourName = result.get();
|
||||
TextInputDialog dialogg = new TextInputDialog("");
|
||||
dialogg.setTitle("Tour Startpunkt");
|
||||
dialogg.setHeaderText("Bitte geben Sie den Startpunkt der Tour an!");
|
||||
dialogg.setContentText("Startpunkt: ");
|
||||
|
||||
// Traditional way to get the response value.
|
||||
Optional<String> resultt = dialogg.showAndWait();
|
||||
result.ifPresent(ss -> {
|
||||
this.neueTourStart = resultt.get();
|
||||
tourData.add(new Tour("Test 3", "120", "json dings", 22.3));
|
||||
tourNamen.add("Test 3");
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* Entfernt eine Tour anhand der ausgewählten Tour
|
||||
*/
|
||||
public void delTour(){
|
||||
try {
|
||||
String tourname = this.selectedTour.getName();
|
||||
tourData.removeIf(s -> s.getName().equals(tourname));
|
||||
tourNamen.removeIf(s -> s.equals(tourname));
|
||||
}catch (NullPointerException e){
|
||||
LogHelper.error(ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "keinetourselected"),
|
||||
ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "deltournoselect"));
|
||||
AlertHelper.warn(ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "achtung"),
|
||||
ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "keinetourselected"),
|
||||
ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "deltournoselectmsg"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void delTour() {
|
||||
}
|
||||
|
||||
public void suche(){
|
||||
/**
|
||||
* Sucht eine Tour
|
||||
*/
|
||||
public void suche(String suchString){
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user