Skip to content
Snippets Groups Projects
Commit 7d496a84 authored by Alexis Durgnat's avatar Alexis Durgnat :milky_way:
Browse files

Merge

parents 84f0706a b46ab835
No related branches found
No related tags found
1 merge request!21*poof* final version
...@@ -26,11 +26,9 @@ import javafx.scene.paint.CycleMethod; ...@@ -26,11 +26,9 @@ import javafx.scene.paint.CycleMethod;
import javafx.scene.paint.LinearGradient; import javafx.scene.paint.LinearGradient;
import javafx.scene.paint.Stop; import javafx.scene.paint.Stop;
import javafx.util.Duration; import javafx.util.Duration;
import org.json.JSONArray;
import java.io.IOException; import java.io.IOException;
import java.net.URL; import java.net.URL;
import java.text.ParseException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.ResourceBundle; import java.util.ResourceBundle;
...@@ -88,11 +86,9 @@ public class MainWindowController implements Initializable { ...@@ -88,11 +86,9 @@ public class MainWindowController implements Initializable {
private void searchStops(String newValue, LinkAPI transportApi, ComboBox<String> target){ private void searchStops(String newValue, LinkAPI transportApi, ComboBox<String> target){
if (!newValue.isEmpty() && newValue.length() > 3 && !target.getItems().contains(newValue)){ if (!newValue.isEmpty() && newValue.length() > 3 && !target.getItems().contains(newValue)){
try { try {
List<Location> l = transportApi.getStations(newValue); List<Location> locations = transportApi.getStations(newValue);
ArrayList<String> results = new ArrayList<>(); ArrayList<String> results = new ArrayList<>();
for (int i = 0; i < l.size(); i++){ locations.forEach((location) -> results.add(location.getName()));
results.add(l.get(i).getName());
}
target.getItems().clear(); target.getItems().clear();
target.getItems().addAll(results); target.getItems().addAll(results);
target.show(); target.show();
...@@ -294,7 +290,6 @@ public class MainWindowController implements Initializable { ...@@ -294,7 +290,6 @@ public class MainWindowController implements Initializable {
startStopLabel.setText(originComboBox.getValue() + " - " + destinationComboBox.getValue()); startStopLabel.setText(originComboBox.getValue() + " - " + destinationComboBox.getValue());
for (int i = 0; i < connections.size(); i++){ for (int i = 0; i < connections.size(); i++){
// Now iterating over connections // Now iterating over connections
// Connection c = new Connection.ConnectionBuilder(connections.getJSONObject(i)).build();
drawConnection(connections.get(i), 30, 100 + 100 * i); drawConnection(connections.get(i), 30, 100 + 100 * i);
} }
} catch (IOException e) { } catch (IOException e) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment