summaryrefslogtreecommitdiff
path: root/src/main/java/com/benburwell/planes/gui/Main1090.java
diff options
context:
space:
mode:
authorBen Burwell <ben.burwell@trifecta.com>2016-11-20 02:38:23 -0500
committerBen Burwell <ben.burwell@trifecta.com>2016-11-20 02:39:13 -0500
commit7411558abf4aba7d600bb9fc713d36032e4a6df3 (patch)
tree56ccca55dc7175bf3bca88e123334ed3da878333 /src/main/java/com/benburwell/planes/gui/Main1090.java
parentf1e32ed443bafc03448f0f3b36c712b9293e71e7 (diff)
Show routes
Diffstat (limited to 'src/main/java/com/benburwell/planes/gui/Main1090.java')
-rw-r--r--src/main/java/com/benburwell/planes/gui/Main1090.java17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/main/java/com/benburwell/planes/gui/Main1090.java b/src/main/java/com/benburwell/planes/gui/Main1090.java
index a48fb93..ac75d03 100644
--- a/src/main/java/com/benburwell/planes/gui/Main1090.java
+++ b/src/main/java/com/benburwell/planes/gui/Main1090.java
@@ -4,10 +4,8 @@
package com.benburwell.planes.gui;
-import com.benburwell.planes.data.AircraftStore;
-import com.benburwell.planes.data.Airport;
-import com.benburwell.planes.data.CSVObjectStore;
-import com.benburwell.planes.data.NavigationAid;
+import com.benburwell.planes.data.*;
+import com.benburwell.planes.graph.RouteGraph;
import com.benburwell.planes.gui.aircraftmap.AircraftMapComponent;
import com.benburwell.planes.gui.aircrafttable.AircraftTableComponent;
import com.benburwell.planes.gui.airportstable.AirportsComponent;
@@ -31,6 +29,7 @@ public class Main1090 extends JFrame {
private AircraftStore aircraft = new AircraftStore();
private CSVObjectStore<NavigationAid> navaids = new CSVObjectStore<>();
private CSVObjectStore<Airport> airports = new CSVObjectStore<>();
+ private RouteGraph routeGraph = new RouteGraph();
private int currentTcpConnection = 0;
private JTabbedPane tabbedPane = new JTabbedPane();
@@ -60,12 +59,20 @@ public class Main1090 extends JFrame {
System.out.println("Could not read airport file: " + e.getMessage());
}
+ try {
+ CSVObjectStore<Intersection> intersections = new CSVObjectStore<>();
+ intersections.readFromResource("/airways_db.csv", Intersection.class);
+ intersections.getObjects().forEach(intersection -> this.routeGraph.addIntersection(intersection));
+ } catch (IOException | InstantiationException | IllegalAccessException e) {
+ System.out.println("Could not read route intersection file: " + e.getMessage());
+ }
+
this.createTabs();
}
private void createTabs() {
List<Tabbable> tabs = new ArrayList<>();
- tabs.add(new AircraftMapComponent(this.aircraft, this.navaids, this.airports));
+ tabs.add(new AircraftMapComponent(this.aircraft, this.navaids, this.airports, this.routeGraph));
tabs.add(new AircraftTableComponent(this.aircraft));
tabs.add(new NavigationAidComponent(this.navaids));
tabs.add(new AirportsComponent(this.airports));