Skip to content
Snippets Groups Projects
Verified Commit 2d6e95b6 authored by Théo Pirkl's avatar Théo Pirkl :nail_care:
Browse files

Merge remote-tracking branch 'origin/devel' into devel

parents 88c5e4b1 a734ecf9
Branches
No related tags found
1 merge request!21*poof* final version
......@@ -106,7 +106,7 @@ public class Stop implements Serializable {
String[] keys = new String[10];
datas.keySet().toArray(keys);
String type = keys[4];
JSONObject locationJSON = datas.isNull("type") ? new JSONObject() : datas.getJSONObject(type);
JSONObject locationJSON = datas.isNull("location") ? new JSONObject() : datas.getJSONObject("location");
Location.LocationBuilder location = new Location.LocationBuilder(locationJSON, type);
DateFormat formatter = new SimpleDateFormat("kk:mm:ss");
......
......@@ -107,16 +107,18 @@ public class MainWindowController implements Initializable {
*/
private void drawConnection(Connection connection, int x, int y){
List<Section> sections = connection.getSections();
for (int i = 0; i < sections.size(); i++){
connectionCanvas.getGraphicsContext2D().setFill(Color.RED);
System.out.println(sections.size());
for (int i = 0; i < sections.size(); i++){
connectionCanvas.getGraphicsContext2D().strokeLine(
x + (622 / sections.size()) * i, y, 622 / sections.size(), y);
connectionCanvas.getGraphicsContext2D().fillOval(x + (622 / sections.size()) * i - 5, y - 5,
x + (622 / sections.size()) * (i), y, 622 / sections.size(), y);
connectionCanvas.getGraphicsContext2D().fillOval(x + (622 / sections.size()) * (i) - 5, y - 5,
10, 10);
connectionCanvas.getGraphicsContext2D().fillText(sections.get(i).getDeparture().getLocation().getName(),
x + (622 / sections.size()) * i, y - 20);
connectionCanvas.getGraphicsContext2D().fillText(sections.get(i).getArrival().getLocation().getName(),
x + (622 / sections.size()) * (i), y - 20);
connectionCanvas.getGraphicsContext2D().fillText(sections.get(i).getArrival().getArrivalTime().toString(),
x + (622 / sections.size()) * (i), y - 40);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment