Compare commits

..

3 Commits
0.0.7 ... 0.1.0

Author SHA1 Message Date
a7479726ac Del Tour 2021-03-17 15:20:31 +01:00
33aaaebe89 Tour Listview onclick + Tour Beschreibung Daten Laden 2021-03-17 14:55:56 +01:00
18aa9ffce6 Erster Button klickbar v2 2021-03-17 13:49:25 +01:00
6 changed files with 228 additions and 87 deletions

View File

@ -63,3 +63,31 @@ App started
2021-03-03 15:50:47 INFO PostgresHelper:15 - User Table created 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:06 INFO TourPlaner:15 - Tour Planer App gestartet
2021-03-03 15:52:07 INFO PostgresHelper:15 - User Table created 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 -

View File

@ -1,6 +1,5 @@
package tourplaner.business; package tourplaner.business;
import javafx.stage.Stage;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import tourplaner.data.DbConnect; import tourplaner.data.DbConnect;
@ -10,14 +9,14 @@ import tourplaner.data.DbConnect;
public class TourPlaner{ public class TourPlaner{
private Logger logger; private Logger logger;
/** public TourPlaner(){
* Startet alle bennötigten Komponenten
* @param primaryStage Stage für den Presenter
*/
public TourPlaner(Stage primaryStage){
String startText = ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "start", "message"); String startText = ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "start", "message");
LogHelper.info(startText, "TourPlaner"); LogHelper.info(startText, "TourPlaner");
new DbConnect().init(); new DbConnect().init();
} }
public String getMapJson(String start, String ziel){
return start + " " + ziel;
}
} }

View File

@ -6,22 +6,18 @@ package tourplaner.object;
public class Tour { public class Tour {
private String dauer; private String dauer;
private String mapJson; private String mapJson;
private double distanz; private double strecke;
private String name; 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.dauer = dauer;
this.mapJson = mapJson; this.mapJson = mapJson;
this.distanz = distanz; this.strecke = strecke;
this.name = name;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name; this.name = name;
this.start = start;
this.ziel = ziel;
} }
public String getDauer() { public String getDauer() {
@ -40,11 +36,35 @@ public class Tour {
this.mapJson = mapJson; this.mapJson = mapJson;
} }
public double getDistanz() { public double getStrecke() {
return distanz; return strecke;
} }
public void setDistanz(double distanz) { public void setStrecke(double strecke) {
this.distanz = distanz; 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;
} }
} }

View File

@ -32,14 +32,27 @@
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--> -->
<?import javafx.geometry.*?> <?import javafx.geometry.Insets?>
<?import javafx.scene.control.*?> <?import javafx.scene.control.Button?>
<?import javafx.scene.layout.*?> <?import javafx.scene.control.Label?>
<?import javafx.scene.paint.*?> <?import javafx.scene.control.ListView?>
<?import javafx.scene.text.*?> <?import javafx.scene.control.Menu?>
<?import javafx.scene.web.*?> <?import javafx.scene.control.MenuBar?>
<?import javafx.scene.control.MenuItem?>
<?import javafx.scene.control.SeparatorMenuItem?>
<?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> <children>
<MenuBar VBox.vgrow="NEVER"> <MenuBar VBox.vgrow="NEVER">
<menus> <menus>
@ -96,7 +109,7 @@
</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> <children>
<AnchorPane prefHeight="-1.0" prefWidth="-1.0" HBox.hgrow="ALWAYS"> <AnchorPane prefWidth="-1.0" HBox.hgrow="ALWAYS">
<children> <children>
<Button fx:id="tourAdd" layoutX="58.0" mnemonicParsing="false" onAction="#addTour" text="+" /> <Button fx:id="tourAdd" layoutX="58.0" mnemonicParsing="false" onAction="#addTour" text="+" />
<Label layoutX="14.0" layoutY="4.0" text="Tours" /> <Label layoutX="14.0" layoutY="4.0" text="Tours" />
@ -111,20 +124,16 @@
</HBox> </HBox>
<SplitPane dividerPositions="0.21492204899777284" focusTraversable="true" prefHeight="522.0" prefWidth="900.0" VBox.vgrow="ALWAYS"> <SplitPane dividerPositions="0.21492204899777284" focusTraversable="true" prefHeight="522.0" prefWidth="900.0" VBox.vgrow="ALWAYS">
<items> <items>
<AnchorPane prefHeight="520.0" prefWidth="239.0"> <AnchorPane prefWidth="239.0">
<children> <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"> <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" />
<padding>
<Insets bottom="20.0" left="20.0" right="20.0" top="20.0" />
</padding>
</ListView>
</children> </children>
</AnchorPane> </AnchorPane>
<SplitPane dividerPositions="0.5" orientation="VERTICAL" prefHeight="496.0" prefWidth="620.0"> <SplitPane dividerPositions="0.5" orientation="VERTICAL" prefHeight="496.0" prefWidth="620.0">
<items> <items>
<VBox prefHeight="200.0" prefWidth="100.0"> <VBox prefWidth="100.0">
<children> <children>
<AnchorPane prefHeight="51.0" prefWidth="676.0"> <AnchorPane prefWidth="676.0">
<children> <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"> <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> <children>
@ -133,26 +142,34 @@
<Insets left="10.0" /> <Insets left="10.0" />
</HBox.margin> </HBox.margin>
</Label> </Label>
<TextField fx:id="titleInput" /> <TextField fx:id="titleTextView" editable="false" />
</children> </children>
</HBox> </HBox>
</children> </children>
</AnchorPane> </AnchorPane>
<AnchorPane prefHeight="200.0" prefWidth="200.0"> <AnchorPane prefWidth="200.0">
<children> <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> <tabs>
<Tab text="Route"> <Tab fx:id="kartenTab" text="Karte">
<content> <content>
<AnchorPane prefHeight="200.0" prefWidth="200.0"> <AnchorPane />
</content></Tab>
<Tab fx:id="beschreibungTab" text="Beschreibung">
<content>
<AnchorPane>
<children> <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> </children>
</AnchorPane> </AnchorPane>
</content></Tab>
<Tab text="Description">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0" />
</content> </content>
</Tab> </Tab>
</tabs> </tabs>
@ -161,13 +178,13 @@
</AnchorPane> </AnchorPane>
</children> </children>
</VBox> </VBox>
<AnchorPane prefHeight="200.0" prefWidth="200.0"> <AnchorPane prefWidth="200.0">
<children> <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> <children>
<AnchorPane prefHeight="51.0" prefWidth="676.0"> <AnchorPane prefWidth="676.0">
<children> <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> <children>
<Label text="Logs:"> <Label text="Logs:">
<HBox.margin> <HBox.margin>
@ -191,14 +208,17 @@
</HBox> </HBox>
</children> </children>
</AnchorPane> </AnchorPane>
<AnchorPane prefHeight="200.0" prefWidth="200.0"> <AnchorPane prefWidth="200.0">
<children> <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> <columns>
<TableColumn prefWidth="238.0" text="Date" /> <TableColumn prefWidth="238.0" text="Date" />
<TableColumn prefWidth="223.0" text="Duration" /> <TableColumn prefWidth="223.0" text="Duration" />
<TableColumn prefWidth="240.0" text="Distance" /> <TableColumn prefWidth="240.0" text="Distance" />
</columns> </columns>
<columnResizePolicy>
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
</columnResizePolicy>
</TableView> </TableView>
</children> </children>
</AnchorPane> </AnchorPane>

View File

@ -1,11 +1,16 @@
package tourplaner.ui; package tourplaner.ui;
import javafx.collections.ObservableList;
import javafx.event.EventHandler;
import javafx.fxml.FXML; import javafx.fxml.FXML;
import javafx.fxml.Initializable; import javafx.fxml.Initializable;
import javafx.geometry.Orientation; import javafx.geometry.Orientation;
import javafx.scene.control.ListView; import javafx.scene.control.*;
import javafx.scene.control.SelectionMode; import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.Pane;
import javafx.scene.web.WebView; import javafx.scene.web.WebView;
import tourplaner.object.Tour;
import tourplaner.viewmodels.ViewModel; import tourplaner.viewmodels.ViewModel;
import java.net.URL; import java.net.URL;
@ -15,6 +20,25 @@ public class TourplanerController implements Initializable {
public ViewModel viewModel = new ViewModel(); public ViewModel viewModel = new ViewModel();
public ListView<String> TourListView = new ListView<>(); 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;
@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"));
}
@FXML @FXML
private void addTour(){ private void addTour(){
@ -23,6 +47,8 @@ public class TourplanerController implements Initializable {
@FXML @FXML
private void delTour(){ 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(); this.viewModel.delTour();
} }
@ -39,5 +65,7 @@ public class TourplanerController implements Initializable {
TourListView.getSelectionModel().setSelectionMode(SelectionMode.SINGLE); TourListView.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
TourListView.setOrientation(Orientation.VERTICAL); TourListView.setOrientation(Orientation.VERTICAL);
TourListView.setItems(this.viewModel.getTourNamen()); TourListView.setItems(this.viewModel.getTourNamen());
this.beschreibungTableView.setPlaceholder(new Label("Keine Tour ausgewählt!"));
this.titleTextView.setText("Keine Tour ausgewählt!");
} }
} }

View File

@ -3,16 +3,83 @@ package tourplaner.viewmodels;
import javafx.collections.FXCollections; import javafx.collections.FXCollections;
import javafx.collections.ObservableList; import javafx.collections.ObservableList;
import javafx.scene.control.TextInputDialog; import javafx.scene.control.TextInputDialog;
import tourplaner.business.TourPlaner;
import tourplaner.object.Tour; import tourplaner.object.Tour;
import java.util.Optional; import java.util.Optional;
import java.util.concurrent.atomic.AtomicReference;
public class ViewModel { public class ViewModel {
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<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<String> tourNamen = FXCollections.observableArrayList("Test 1", "Test 2"); 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; public void addTour(){
TextInputDialog dialogName = new TextInputDialog("");
dialogName.setTitle("Tour Name");
dialogName.setHeaderText("Bitte geben Sie den Namen der Tour an!");
dialogName.setContentText("Name: ");
Optional<String> resultName = dialogName.showAndWait();
resultName.ifPresent(sname -> {
this.neueTourName = resultName.get();
TextInputDialog dialogStart = new TextInputDialog("");
dialogStart.setTitle("Tour Startpunkt");
dialogStart.setHeaderText("Bitte geben Sie den Startpunkt der Tour an!");
dialogStart.setContentText("Startpunkt: ");
Optional<String> resultStart = dialogStart.showAndWait();
resultStart.ifPresent(sstart -> {
this.neueTourStart = resultStart.get();
TextInputDialog dialogZiel = new TextInputDialog("");
dialogZiel.setTitle("Tour Zielpunkt");
dialogZiel.setHeaderText("Bitte geben Sie den Zielpunkt der Tour an!");
dialogZiel.setContentText("Zielpunkt: ");
Optional<String> resultZiel = dialogZiel.showAndWait();
resultZiel.ifPresent(sziel -> {
this.neueTourZiel = resultZiel.get();
if (getTour(this.neueTourName) == null) {
tourData.add(new Tour(this.neueTourName, "120", new TourPlaner().getMapJson(this.neueTourStart, this.neueTourZiel), 22.3, this.neueTourStart, this.neueTourZiel));
tourNamen.add(this.neueTourName);
}else{
// TODO: 17.03.2021 Warning das dieser Tourname bereits vergeben ist
}
});
});
});
}
/**
* 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() { public ObservableList<String> getTourNamen() {
return tourNamen; return tourNamen;
@ -38,34 +105,13 @@ public class ViewModel {
return tourData; return tourData;
} }
public void addTour(){ /**
TextInputDialog dialog = new TextInputDialog(""); * Entfernt eine Tour anhand der ausgewählten Tour
dialog.setTitle("Tour Name"); */
dialog.setHeaderText("Bitte geben Sie den Namen der Tour an!"); public void delTour(){
dialog.setContentText("Name: "); String tourname = this.selectedTour.getName();
tourData.removeIf(s -> s.getName().equals(tourname));
// Traditional way to get the response value. tourNamen.removeIf(s -> s.equals(tourname));
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");
});
});
}
public void delTour() {
} }
public void suche(){ public void suche(){