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

Print journeys

parent f79ff6c1
Branches master
No related tags found
1 merge request!21*poof* final version
...@@ -100,16 +100,18 @@ public class MainWindowController implements Initializable { ...@@ -100,16 +100,18 @@ public class MainWindowController implements Initializable {
*/ */
private void drawConnection(Connection connection, int x, int y){ private void drawConnection(Connection connection, int x, int y){
List<Section> sections = connection.getSections(); List<Section> sections = connection.getSections();
for (int i = 0; i < sections.size(); i++){
connectionCanvas.getGraphicsContext2D().setFill(Color.RED); connectionCanvas.getGraphicsContext2D().setFill(Color.RED);
System.out.println(sections.size());
for (int i = 0; i < sections.size(); i++){
connectionCanvas.getGraphicsContext2D().strokeLine( connectionCanvas.getGraphicsContext2D().strokeLine(
x + (622 / sections.size()) * i, y, 622 / sections.size(), y); x + (622 / sections.size()) * (i), y, 622 / sections.size(), y);
connectionCanvas.getGraphicsContext2D().fillOval(x + (622 / sections.size()) * i - 5, y - 5, connectionCanvas.getGraphicsContext2D().fillOval(x + (622 / sections.size()) * (i) - 5, y - 5,
10, 10); 10, 10);
connectionCanvas.getGraphicsContext2D().fillText(sections.get(i).getArrival().getLocation().getName(),
connectionCanvas.getGraphicsContext2D().fillText(sections.get(i).getDeparture().getLocation().getName(), x + (622 / sections.size()) * (i), y - 20);
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