summaryrefslogtreecommitdiff
path: root/src/main/java/com/benburwell/planes/gui
diff options
context:
space:
mode:
authorBen Burwell <ben.burwell@trifecta.com>2016-11-20 01:34:08 -0500
committerBen Burwell <ben.burwell@trifecta.com>2016-11-20 01:34:08 -0500
commitf1e32ed443bafc03448f0f3b36c712b9293e71e7 (patch)
treebd4c5f6dd692bd3d1f16bdd00f57d996cecc5688 /src/main/java/com/benburwell/planes/gui
parentbe4974518d4e24f66c19ceffc1e633e3e306956b (diff)
File cleanup
Diffstat (limited to 'src/main/java/com/benburwell/planes/gui')
-rw-r--r--src/main/java/com/benburwell/planes/gui/GraphicsTheme.java4
-rw-r--r--src/main/java/com/benburwell/planes/gui/Main1090.java21
-rw-r--r--src/main/java/com/benburwell/planes/gui/MenuBarProvider.java6
-rw-r--r--src/main/java/com/benburwell/planes/gui/TCPConnectionOptionDialog.java7
-rw-r--r--src/main/java/com/benburwell/planes/gui/Tabbable.java4
-rw-r--r--src/main/java/com/benburwell/planes/gui/aircraftmap/AircraftMap.java31
-rw-r--r--src/main/java/com/benburwell/planes/gui/aircraftmap/AircraftMapComponent.java25
-rw-r--r--src/main/java/com/benburwell/planes/gui/aircraftmap/Drawable.java4
-rw-r--r--src/main/java/com/benburwell/planes/gui/aircraftmap/GeoPoint.java2
-rw-r--r--src/main/java/com/benburwell/planes/gui/aircraftmap/symbols/AirportSymbol.java4
-rw-r--r--src/main/java/com/benburwell/planes/gui/aircraftmap/symbols/NDBSymbol.java4
-rw-r--r--src/main/java/com/benburwell/planes/gui/aircraftmap/symbols/PlaneSymbol.java6
-rw-r--r--src/main/java/com/benburwell/planes/gui/aircraftmap/symbols/VORDMESymbol.java3
-rw-r--r--src/main/java/com/benburwell/planes/gui/aircraftmap/symbols/VORSymbol.java4
-rw-r--r--src/main/java/com/benburwell/planes/gui/aircraftmap/symbols/VORTACSymbol.java5
-rw-r--r--src/main/java/com/benburwell/planes/gui/aircrafttable/AircraftTableComponent.java14
-rw-r--r--src/main/java/com/benburwell/planes/gui/aircrafttable/AircraftTableModel.java18
-rw-r--r--src/main/java/com/benburwell/planes/gui/airportstable/AirportsComponent.java14
-rw-r--r--src/main/java/com/benburwell/planes/gui/airportstable/NavigationAidsTableModel.java2
-rw-r--r--src/main/java/com/benburwell/planes/gui/navigationaids/AirportsTableModel.java4
-rw-r--r--src/main/java/com/benburwell/planes/gui/navigationaids/NavigationAidComponent.java14
21 files changed, 108 insertions, 88 deletions
diff --git a/src/main/java/com/benburwell/planes/gui/GraphicsTheme.java b/src/main/java/com/benburwell/planes/gui/GraphicsTheme.java
index cece138..02d75ba 100644
--- a/src/main/java/com/benburwell/planes/gui/GraphicsTheme.java
+++ b/src/main/java/com/benburwell/planes/gui/GraphicsTheme.java
@@ -1,9 +1,9 @@
package com.benburwell.planes.gui;
-import java.awt.*;
+import java.awt.Color;
/**
- * Created by ben on 11/18/16.
+ * @author ben
*/
public class GraphicsTheme {
public static class Colors {
diff --git a/src/main/java/com/benburwell/planes/gui/Main1090.java b/src/main/java/com/benburwell/planes/gui/Main1090.java
index e3624ff..a48fb93 100644
--- a/src/main/java/com/benburwell/planes/gui/Main1090.java
+++ b/src/main/java/com/benburwell/planes/gui/Main1090.java
@@ -1,21 +1,28 @@
/**
- * Created by ben on 11/15/16.
+ * @author ben
*/
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.gui.aircraftmap.AircraftMapComponent;
import com.benburwell.planes.gui.aircrafttable.AircraftTableComponent;
import com.benburwell.planes.gui.airportstable.AirportsComponent;
import com.benburwell.planes.gui.navigationaids.NavigationAidComponent;
-import com.benburwell.planes.sbs.*;
-import com.benburwell.planes.data.*;
-import com.benburwell.planes.gui.aircraftmap.*;
-
+import com.benburwell.planes.sbs.AggregateDataSource;
+import com.benburwell.planes.sbs.SBSPacket;
+import com.benburwell.planes.sbs.TCPDataSource;
+import java.awt.EventQueue;
import java.util.List;
import java.util.ArrayList;
-import java.awt.*;
-import javax.swing.*;
+import javax.swing.JFrame;
+import javax.swing.JOptionPane;
+import javax.swing.JTabbedPane;
+import javax.swing.WindowConstants;
import java.awt.event.ActionEvent;
import java.io.IOException;
diff --git a/src/main/java/com/benburwell/planes/gui/MenuBarProvider.java b/src/main/java/com/benburwell/planes/gui/MenuBarProvider.java
index add77ce..7260fd1 100644
--- a/src/main/java/com/benburwell/planes/gui/MenuBarProvider.java
+++ b/src/main/java/com/benburwell/planes/gui/MenuBarProvider.java
@@ -1,10 +1,12 @@
package com.benburwell.planes.gui;
-import javax.swing.*;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
import java.awt.event.ActionEvent;
/**
- * Created by ben on 11/17/16.
+ * @author ben
*/
public class MenuBarProvider {
private JMenuBar menubar = new JMenuBar();
diff --git a/src/main/java/com/benburwell/planes/gui/TCPConnectionOptionDialog.java b/src/main/java/com/benburwell/planes/gui/TCPConnectionOptionDialog.java
index a8d7eea..5650069 100644
--- a/src/main/java/com/benburwell/planes/gui/TCPConnectionOptionDialog.java
+++ b/src/main/java/com/benburwell/planes/gui/TCPConnectionOptionDialog.java
@@ -1,9 +1,12 @@
package com.benburwell.planes.gui;
-import javax.swing.*;
+import javax.swing.JComponent;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
/**
- * Created by ben on 11/17/16.
+ * @author ben
*/
public class TCPConnectionOptionDialog {
public static final String DEFAULT_HOSTNAME = "10.0.0.111";
diff --git a/src/main/java/com/benburwell/planes/gui/Tabbable.java b/src/main/java/com/benburwell/planes/gui/Tabbable.java
index e7b5f3f..26c0992 100644
--- a/src/main/java/com/benburwell/planes/gui/Tabbable.java
+++ b/src/main/java/com/benburwell/planes/gui/Tabbable.java
@@ -1,9 +1,9 @@
package com.benburwell.planes.gui;
-import javax.swing.*;
+import javax.swing.JComponent;
/**
- * Created by ben on 11/17/16.
+ * @author ben
*/
public interface Tabbable {
String getName();
diff --git a/src/main/java/com/benburwell/planes/gui/aircraftmap/AircraftMap.java b/src/main/java/com/benburwell/planes/gui/aircraftmap/AircraftMap.java
index d61618a..72edaaf 100644
--- a/src/main/java/com/benburwell/planes/gui/aircraftmap/AircraftMap.java
+++ b/src/main/java/com/benburwell/planes/gui/aircraftmap/AircraftMap.java
@@ -4,15 +4,26 @@ import com.benburwell.planes.data.Airport;
import com.benburwell.planes.data.NavigationAid;
import com.benburwell.planes.data.Position;
import com.benburwell.planes.gui.GraphicsTheme;
-import com.benburwell.planes.gui.aircraftmap.symbols.*;
-
-import javax.swing.*;
-import java.awt.*;
-import java.util.*;
+import com.benburwell.planes.gui.aircraftmap.symbols.AirportSymbol;
+import com.benburwell.planes.gui.aircraftmap.symbols.NDBSymbol;
+import com.benburwell.planes.gui.aircraftmap.symbols.VORDMESymbol;
+import com.benburwell.planes.gui.aircraftmap.symbols.VORSymbol;
+import com.benburwell.planes.gui.aircraftmap.symbols.VORTACSymbol;
+
+import javax.swing.BorderFactory;
+import javax.swing.JPanel;
+import java.awt.Font;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
/**
- * Created by ben on 11/19/16.
+ * @author ben
*/
public class AircraftMap extends JPanel {
// geographic constants
@@ -131,7 +142,7 @@ public class AircraftMap extends JPanel {
this.redraw();
}
- public void drawPositionAndScale(Graphics g) {
+ private void drawPositionAndScale(Graphics g) {
Font currentFont = g.getFont();
Font newFont = currentFont.deriveFont(FONT_SIZE);
g.setFont(newFont);
@@ -141,7 +152,7 @@ public class AircraftMap extends JPanel {
g.drawString(String.format("%d nm", this.getRangeRadius()), TEXT_PADDING, (int) FONT_SIZE * 3 + TEXT_PADDING);
}
- public int getRangeRadius() {
+ private int getRangeRadius() {
double milesHigh = this.getHeight() / this.getPixelsPerNauticalMile();
double milesWide = this.getWidth() / this.getPixelsPerNauticalMile();
double screenMiles = Math.min(milesHigh, milesWide);
@@ -149,7 +160,7 @@ public class AircraftMap extends JPanel {
return milesPerRing;
}
- public List<Integer> getRangeRadii() {
+ private List<Integer> getRangeRadii() {
int rangeRadius = this.getRangeRadius();
List<Integer> radii = new ArrayList<>();
for (int ringNumber = 1; ringNumber <= NUMBER_OF_RANGE_RINGS; ringNumber++) {
@@ -158,7 +169,7 @@ public class AircraftMap extends JPanel {
return radii;
}
- public void drawRange(Graphics g) {
+ private void drawRange(Graphics g) {
int centerX = this.getWidth() / 2;
int centerY = this.getHeight() / 2;
g.setColor(GraphicsTheme.Colors.BASE_3);
diff --git a/src/main/java/com/benburwell/planes/gui/aircraftmap/AircraftMapComponent.java b/src/main/java/com/benburwell/planes/gui/aircraftmap/AircraftMapComponent.java
index ab0315d..48f8cfd 100644
--- a/src/main/java/com/benburwell/planes/gui/aircraftmap/AircraftMapComponent.java
+++ b/src/main/java/com/benburwell/planes/gui/aircraftmap/AircraftMapComponent.java
@@ -1,43 +1,42 @@
package com.benburwell.planes.gui.aircraftmap;
-import com.benburwell.planes.data.*;
+import com.benburwell.planes.data.AircraftStore;
+import com.benburwell.planes.data.AircraftStoreListener;
+import com.benburwell.planes.data.Airport;
+import com.benburwell.planes.data.CSVObjectStore;
+import com.benburwell.planes.data.NavigationAid;
import com.benburwell.planes.gui.Tabbable;
import com.benburwell.planes.gui.aircraftmap.symbols.PlaneSymbol;
-import java.util.*;
+import java.awt.KeyboardFocusManager;
+import java.util.ArrayList;
+import java.util.Date;
import java.util.List;
-import javax.swing.*;
+import javax.swing.JComponent;
import javax.swing.Timer;
-import java.awt.*;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
/**
- * Created by ben on 11/18/16.
+ * @author ben
*/
public class AircraftMapComponent implements Tabbable {
public final long PLANE_EXPIRY_MILLIS = 60 * 1000;
public final int MAX_REFRESH_MILLIS = 5 * 1000;
private AircraftStore store;
- private CSVObjectStore<NavigationAid> navaids;
- private CSVObjectStore<Airport> airportStore;
private AircraftMap mapPanel;
private AircraftStoreListener aircraftStoreListener;
public AircraftMapComponent(AircraftStore store, CSVObjectStore<NavigationAid> navaids, CSVObjectStore<Airport> airportStore) {
this.store = store;
- this.navaids = navaids;
- this.airportStore = airportStore;
this.setupMap();
this.bindKeys();
this.setupListener();
this.store.subscribe(this.aircraftStoreListener);
- this.mapPanel.addNavAids(this.navaids.getObjects());
- this.mapPanel.addAirports(this.airportStore.getObjects());
+ this.mapPanel.addNavAids(navaids.getObjects());
+ this.mapPanel.addAirports(airportStore.getObjects());
final Timer t = new Timer(MAX_REFRESH_MILLIS, e -> {
AircraftMapComponent.this.aircraftStoreListener.aircraftStoreChanged();
diff --git a/src/main/java/com/benburwell/planes/gui/aircraftmap/Drawable.java b/src/main/java/com/benburwell/planes/gui/aircraftmap/Drawable.java
index 01c16ba..4b3aa5e 100644
--- a/src/main/java/com/benburwell/planes/gui/aircraftmap/Drawable.java
+++ b/src/main/java/com/benburwell/planes/gui/aircraftmap/Drawable.java
@@ -1,9 +1,9 @@
package com.benburwell.planes.gui.aircraftmap;
-import java.awt.*;
+import java.awt.Graphics;
/**
- * Created by ben on 11/19/16.
+ * @author ben
*/
public interface Drawable {
void drawOn(Graphics graphicsContext, AircraftMap map);
diff --git a/src/main/java/com/benburwell/planes/gui/aircraftmap/GeoPoint.java b/src/main/java/com/benburwell/planes/gui/aircraftmap/GeoPoint.java
index 2ecbeda..37a3f19 100644
--- a/src/main/java/com/benburwell/planes/gui/aircraftmap/GeoPoint.java
+++ b/src/main/java/com/benburwell/planes/gui/aircraftmap/GeoPoint.java
@@ -3,7 +3,7 @@ package com.benburwell.planes.gui.aircraftmap;
import com.benburwell.planes.data.Position;
/**
- * Created by ben on 11/19/16.
+ * @author ben
*/
public class GeoPoint {
private double latitude;
diff --git a/src/main/java/com/benburwell/planes/gui/aircraftmap/symbols/AirportSymbol.java b/src/main/java/com/benburwell/planes/gui/aircraftmap/symbols/AirportSymbol.java
index 5286f6f..b97a7fa 100644
--- a/src/main/java/com/benburwell/planes/gui/aircraftmap/symbols/AirportSymbol.java
+++ b/src/main/java/com/benburwell/planes/gui/aircraftmap/symbols/AirportSymbol.java
@@ -6,10 +6,10 @@ import com.benburwell.planes.gui.aircraftmap.AircraftMap;
import com.benburwell.planes.gui.aircraftmap.Drawable;
import com.benburwell.planes.gui.aircraftmap.GeoPoint;
-import java.awt.*;
+import java.awt.Graphics;
/**
- * Created by ben on 11/19/16.
+ * @author ben
*/
public class AirportSymbol extends GeoPoint implements Drawable {
private String name;
diff --git a/src/main/java/com/benburwell/planes/gui/aircraftmap/symbols/NDBSymbol.java b/src/main/java/com/benburwell/planes/gui/aircraftmap/symbols/NDBSymbol.java
index 08793ec..74f4441 100644
--- a/src/main/java/com/benburwell/planes/gui/aircraftmap/symbols/NDBSymbol.java
+++ b/src/main/java/com/benburwell/planes/gui/aircraftmap/symbols/NDBSymbol.java
@@ -6,10 +6,10 @@ import com.benburwell.planes.gui.aircraftmap.AircraftMap;
import com.benburwell.planes.gui.aircraftmap.Drawable;
import com.benburwell.planes.gui.aircraftmap.GeoPoint;
-import java.awt.*;
+import java.awt.Graphics;
/**
- * Created by ben on 11/19/16.
+ * @author ben
*/
public class NDBSymbol extends GeoPoint implements Drawable {
public static final int INNER_RADIUS = 3;
diff --git a/src/main/java/com/benburwell/planes/gui/aircraftmap/symbols/PlaneSymbol.java b/src/main/java/com/benburwell/planes/gui/aircraftmap/symbols/PlaneSymbol.java
index 135ed4d..3e6b51c 100644
--- a/src/main/java/com/benburwell/planes/gui/aircraftmap/symbols/PlaneSymbol.java
+++ b/src/main/java/com/benburwell/planes/gui/aircraftmap/symbols/PlaneSymbol.java
@@ -7,14 +7,16 @@ import com.benburwell.planes.gui.aircraftmap.AircraftMap;
import com.benburwell.planes.gui.aircraftmap.Drawable;
import com.benburwell.planes.gui.aircraftmap.GeoPoint;
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
import java.util.Date;
import java.util.List;
import java.util.ArrayList;
-import java.awt.*;
import java.awt.geom.AffineTransform;
/**
- * Created by ben on 11/19/16.
+ * @author ben
*/
public class PlaneSymbol extends GeoPoint implements Drawable {
public final int TRIANGLE_HEIGHT = 6;
diff --git a/src/main/java/com/benburwell/planes/gui/aircraftmap/symbols/VORDMESymbol.java b/src/main/java/com/benburwell/planes/gui/aircraftmap/symbols/VORDMESymbol.java
index 0b67989..b4edc28 100644
--- a/src/main/java/com/benburwell/planes/gui/aircraftmap/symbols/VORDMESymbol.java
+++ b/src/main/java/com/benburwell/planes/gui/aircraftmap/symbols/VORDMESymbol.java
@@ -4,12 +4,11 @@ import com.benburwell.planes.data.Position;
import com.benburwell.planes.gui.GraphicsTheme;
import com.benburwell.planes.gui.aircraftmap.AircraftMap;
import com.benburwell.planes.gui.aircraftmap.Drawable;
-import com.benburwell.planes.gui.aircraftmap.symbols.VORSymbol;
import java.awt.Graphics;
/**
- * Created by ben on 11/19/16.
+ * @author ben
*/
public class VORDMESymbol extends VORSymbol implements Drawable {
public VORDMESymbol(String name, Position pos, int frequency) {
diff --git a/src/main/java/com/benburwell/planes/gui/aircraftmap/symbols/VORSymbol.java b/src/main/java/com/benburwell/planes/gui/aircraftmap/symbols/VORSymbol.java
index e854c2b..5164248 100644
--- a/src/main/java/com/benburwell/planes/gui/aircraftmap/symbols/VORSymbol.java
+++ b/src/main/java/com/benburwell/planes/gui/aircraftmap/symbols/VORSymbol.java
@@ -6,10 +6,10 @@ import com.benburwell.planes.gui.aircraftmap.AircraftMap;
import com.benburwell.planes.gui.aircraftmap.Drawable;
import com.benburwell.planes.gui.aircraftmap.GeoPoint;
-import java.awt.*;
+import java.awt.Graphics;
/**
- * Created by ben on 11/19/16.
+ * @author ben
*/
public class VORSymbol extends GeoPoint implements Drawable {
public static final int RADIUS = 11;
diff --git a/src/main/java/com/benburwell/planes/gui/aircraftmap/symbols/VORTACSymbol.java b/src/main/java/com/benburwell/planes/gui/aircraftmap/symbols/VORTACSymbol.java
index 3b0043f..a8d0bdb 100644
--- a/src/main/java/com/benburwell/planes/gui/aircraftmap/symbols/VORTACSymbol.java
+++ b/src/main/java/com/benburwell/planes/gui/aircraftmap/symbols/VORTACSymbol.java
@@ -4,12 +4,11 @@ import com.benburwell.planes.data.Position;
import com.benburwell.planes.gui.GraphicsTheme;
import com.benburwell.planes.gui.aircraftmap.AircraftMap;
import com.benburwell.planes.gui.aircraftmap.Drawable;
-import com.benburwell.planes.gui.aircraftmap.symbols.VORSymbol;
-import java.awt.*;
+import java.awt.Graphics;
/**
- * Created by ben on 11/19/16.
+ * @author ben
*/
public class VORTACSymbol extends VORSymbol implements Drawable {
public VORTACSymbol(String name, Position pos, int frequency) {
diff --git a/src/main/java/com/benburwell/planes/gui/aircrafttable/AircraftTableComponent.java b/src/main/java/com/benburwell/planes/gui/aircrafttable/AircraftTableComponent.java
index 2bd6586..2ea4972 100644
--- a/src/main/java/com/benburwell/planes/gui/aircrafttable/AircraftTableComponent.java
+++ b/src/main/java/com/benburwell/planes/gui/aircrafttable/AircraftTableComponent.java
@@ -3,20 +3,20 @@ package com.benburwell.planes.gui.aircrafttable;
import com.benburwell.planes.data.AircraftStore;
import com.benburwell.planes.gui.Tabbable;
-import javax.swing.*;
+import javax.swing.JComponent;
+import javax.swing.JScrollPane;
+import javax.swing.JTable;
/**
- * Created by ben on 11/17/16.
+ * @author ben
*/
public class AircraftTableComponent implements Tabbable {
- private JTable table;
- private AircraftTableModel tableModel;
private JScrollPane scrollPane;
public AircraftTableComponent(AircraftStore store) {
- this.tableModel = new AircraftTableModel(store);
- this.table = new JTable(this.tableModel);
- this.table.setFillsViewportHeight(true);
+ AircraftTableModel tableModel = new AircraftTableModel(store);
+ JTable table = new JTable(tableModel);
+ table.setFillsViewportHeight(true);
this.scrollPane = new JScrollPane(table);
}
diff --git a/src/main/java/com/benburwell/planes/gui/aircrafttable/AircraftTableModel.java b/src/main/java/com/benburwell/planes/gui/aircrafttable/AircraftTableModel.java
index 66dc798..ad5f7af 100644
--- a/src/main/java/com/benburwell/planes/gui/aircrafttable/AircraftTableModel.java
+++ b/src/main/java/com/benburwell/planes/gui/aircrafttable/AircraftTableModel.java
@@ -11,11 +11,11 @@ import java.util.ArrayList;
import java.util.Collections;
/**
- * Created by ben on 11/15/16.
+ * @author ben
*/
public class AircraftTableModel extends AbstractTableModel {
private Map<String,Aircraft> aircraftMap;
- private String[] columnNames = { "Hex", "Callsign", "Squawk", "Latitude", "Longitude", "Altitude", "Vertical Rate", "Track", "Ground Speed", "Packets" };
+ private String[] columnNames = { "Hex", "Callsign", "Latitude", "Longitude", "Altitude", "Vertical Rate", "Track", "Ground Speed", "Packets" };
public AircraftTableModel(AircraftStore store) {
this.aircraftMap = store.getAircraft();
@@ -58,20 +58,18 @@ public class AircraftTableModel extends AbstractTableModel {
case 1:
return aircraft.getCallsign();
case 2:
- return aircraft.getSquawk();
- case 3:
return aircraft.getCurrentPosition().getLatitude();
- case 4:
+ case 3:
return aircraft.getCurrentPosition().getLongitude();
- case 5:
+ case 4:
return aircraft.getCurrentPosition().getAltitude();
- case 6:
+ case 5:
return aircraft.getVerticalRate();
- case 7:
+ case 6:
return aircraft.getTrack();
- case 8:
+ case 7:
return aircraft.getGroundSpeed();
- case 9:
+ case 8:
return aircraft.getPacketCount();
}
return "";
diff --git a/src/main/java/com/benburwell/planes/gui/airportstable/AirportsComponent.java b/src/main/java/com/benburwell/planes/gui/airportstable/AirportsComponent.java
index 8739de7..14eaca9 100644
--- a/src/main/java/com/benburwell/planes/gui/airportstable/AirportsComponent.java
+++ b/src/main/java/com/benburwell/planes/gui/airportstable/AirportsComponent.java
@@ -5,20 +5,20 @@ import com.benburwell.planes.data.CSVObjectStore;
import com.benburwell.planes.gui.Tabbable;
import com.benburwell.planes.gui.navigationaids.AirportsTableModel;
-import javax.swing.*;
+import javax.swing.JComponent;
+import javax.swing.JScrollPane;
+import javax.swing.JTable;
/**
- * Created by ben on 11/19/16.
+ * @author ben
*/
public class AirportsComponent implements Tabbable {
private JScrollPane scrollPane = new JScrollPane();
- private JTable table = new JTable();
- private AirportsTableModel tableModel;
public AirportsComponent(CSVObjectStore<Airport> airportStore) {
- this.tableModel = new AirportsTableModel(airportStore.getObjects());
- this.table = new JTable(this.tableModel);
- this.table.setFillsViewportHeight(true);
+ AirportsTableModel tableModel = new AirportsTableModel(airportStore.getObjects());
+ JTable table = new JTable(tableModel);
+ table.setFillsViewportHeight(true);
this.scrollPane = new JScrollPane(table);
}
diff --git a/src/main/java/com/benburwell/planes/gui/airportstable/NavigationAidsTableModel.java b/src/main/java/com/benburwell/planes/gui/airportstable/NavigationAidsTableModel.java
index 3ce098f..93af44c 100644
--- a/src/main/java/com/benburwell/planes/gui/airportstable/NavigationAidsTableModel.java
+++ b/src/main/java/com/benburwell/planes/gui/airportstable/NavigationAidsTableModel.java
@@ -6,7 +6,7 @@ import com.benburwell.planes.data.NavigationAid;
import javax.swing.table.AbstractTableModel;
/**
- * Created by ben on 11/19/16.
+ * @author ben
*/
public class NavigationAidsTableModel extends AbstractTableModel {
private final String[] COLUMN_NAMES = { "Ident", "Type", "Frequency", "DME Frequency", "DME Channel", "Usage Type", "Power", "Airport" };
diff --git a/src/main/java/com/benburwell/planes/gui/navigationaids/AirportsTableModel.java b/src/main/java/com/benburwell/planes/gui/navigationaids/AirportsTableModel.java
index 2850196..a742057 100644
--- a/src/main/java/com/benburwell/planes/gui/navigationaids/AirportsTableModel.java
+++ b/src/main/java/com/benburwell/planes/gui/navigationaids/AirportsTableModel.java
@@ -6,12 +6,12 @@ import javax.swing.table.AbstractTableModel;
import java.util.List;
/**
- * Created by ben on 11/19/16.
+ * @author ben
*/
public class AirportsTableModel extends AbstractTableModel {
public final String[] COLUMN_HEADERS = {"Identifier", "Name", "Country", "Municipality", "Scheduled Service", "IATA Code", "Local Code"};
- public List<Airport> airports;
+ private List<Airport> airports;
public AirportsTableModel(List<Airport> airports) {
this.airports = airports;
diff --git a/src/main/java/com/benburwell/planes/gui/navigationaids/NavigationAidComponent.java b/src/main/java/com/benburwell/planes/gui/navigationaids/NavigationAidComponent.java
index 1238873..e33f0f8 100644
--- a/src/main/java/com/benburwell/planes/gui/navigationaids/NavigationAidComponent.java
+++ b/src/main/java/com/benburwell/planes/gui/navigationaids/NavigationAidComponent.java
@@ -5,20 +5,20 @@ import com.benburwell.planes.data.NavigationAid;
import com.benburwell.planes.gui.Tabbable;
import com.benburwell.planes.gui.airportstable.NavigationAidsTableModel;
-import javax.swing.*;
+import javax.swing.JComponent;
+import javax.swing.JScrollPane;
+import javax.swing.JTable;
/**
- * Created by ben on 11/19/16.
+ * @author ben
*/
public class NavigationAidComponent implements Tabbable {
- private JTable table;
- private NavigationAidsTableModel tableModel;
private JScrollPane scrollPane;
public NavigationAidComponent(CSVObjectStore<NavigationAid> store) {
- this.tableModel = new NavigationAidsTableModel(store);
- this.table = new JTable(this.tableModel);
- this.table.setFillsViewportHeight(true);
+ NavigationAidsTableModel tableModel = new NavigationAidsTableModel(store);
+ JTable table = new JTable(tableModel);
+ table.setFillsViewportHeight(true);
this.scrollPane = new JScrollPane(table);
}