From f1e32ed443bafc03448f0f3b36c712b9293e71e7 Mon Sep 17 00:00:00 2001 From: Ben Burwell Date: Sun, 20 Nov 2016 01:34:08 -0500 Subject: File cleanup --- .../benburwell/planes/data/AbstractCSVReader.java | 4 +-- .../java/com/benburwell/planes/data/Aircraft.java | 7 +---- .../com/benburwell/planes/data/AircraftStore.java | 2 +- .../planes/data/AircraftStoreListener.java | 2 +- .../java/com/benburwell/planes/data/Airport.java | 2 +- .../com/benburwell/planes/data/CSVObjectStore.java | 9 +++++-- .../com/benburwell/planes/data/NavigationAid.java | 2 +- .../java/com/benburwell/planes/data/Position.java | 2 +- .../com/benburwell/planes/gui/GraphicsTheme.java | 4 +-- .../java/com/benburwell/planes/gui/Main1090.java | 21 ++++++++++----- .../com/benburwell/planes/gui/MenuBarProvider.java | 6 +++-- .../planes/gui/TCPConnectionOptionDialog.java | 7 +++-- .../java/com/benburwell/planes/gui/Tabbable.java | 4 +-- .../planes/gui/aircraftmap/AircraftMap.java | 31 +++++++++++++++------- .../gui/aircraftmap/AircraftMapComponent.java | 25 +++++++++-------- .../planes/gui/aircraftmap/Drawable.java | 4 +-- .../planes/gui/aircraftmap/GeoPoint.java | 2 +- .../gui/aircraftmap/symbols/AirportSymbol.java | 4 +-- .../planes/gui/aircraftmap/symbols/NDBSymbol.java | 4 +-- .../gui/aircraftmap/symbols/PlaneSymbol.java | 6 +++-- .../gui/aircraftmap/symbols/VORDMESymbol.java | 3 +-- .../planes/gui/aircraftmap/symbols/VORSymbol.java | 4 +-- .../gui/aircraftmap/symbols/VORTACSymbol.java | 5 ++-- .../gui/aircrafttable/AircraftTableComponent.java | 14 +++++----- .../gui/aircrafttable/AircraftTableModel.java | 18 ++++++------- .../gui/airportstable/AirportsComponent.java | 14 +++++----- .../airportstable/NavigationAidsTableModel.java | 2 +- .../gui/navigationaids/AirportsTableModel.java | 4 +-- .../gui/navigationaids/NavigationAidComponent.java | 14 +++++----- .../benburwell/planes/sbs/AggregateDataSource.java | 2 +- .../com/benburwell/planes/sbs/DataListener.java | 2 +- .../java/com/benburwell/planes/sbs/DataSource.java | 2 +- .../planes/sbs/MalformedPacketException.java | 2 +- .../com/benburwell/planes/sbs/MessageType.java | 2 +- .../java/com/benburwell/planes/sbs/SBSPacket.java | 2 +- .../com/benburwell/planes/sbs/TCPDataSource.java | 8 +++--- .../benburwell/planes/sbs/TransmissionType.java | 2 +- .../sbs/UnrecognizedMessageTypeException.java | 2 +- .../sbs/UnrecognizedTransmissionTypeException.java | 2 +- 39 files changed, 137 insertions(+), 115 deletions(-) (limited to 'src/main/java/com/benburwell') diff --git a/src/main/java/com/benburwell/planes/data/AbstractCSVReader.java b/src/main/java/com/benburwell/planes/data/AbstractCSVReader.java index 66084ed..0f88be2 100644 --- a/src/main/java/com/benburwell/planes/data/AbstractCSVReader.java +++ b/src/main/java/com/benburwell/planes/data/AbstractCSVReader.java @@ -3,8 +3,8 @@ package com.benburwell.planes.data; import org.apache.commons.csv.CSVRecord; /** - * Created by ben on 11/19/16. + * @author ben */ -public abstract class AbstractCSVReader { +abstract class AbstractCSVReader { public abstract void readRecord(CSVRecord record); } diff --git a/src/main/java/com/benburwell/planes/data/Aircraft.java b/src/main/java/com/benburwell/planes/data/Aircraft.java index 9f6b881..280c6bd 100644 --- a/src/main/java/com/benburwell/planes/data/Aircraft.java +++ b/src/main/java/com/benburwell/planes/data/Aircraft.java @@ -7,14 +7,13 @@ import java.util.List; import java.util.ArrayList; /** - * Created by ben on 11/15/16. + * @author ben */ public class Aircraft implements Comparable { private final String hexIdent; private Position currentPosition = new Position(); private List positionHistory = new ArrayList<>(); private String callsign = ""; - private String squawk = ""; private long packetCount = 0; private double track; private double groundSpeed; @@ -75,10 +74,6 @@ public class Aircraft implements Comparable { return callsign; } - public String getSquawk() { - return squawk; - } - public Long getPacketCount() { return packetCount; } diff --git a/src/main/java/com/benburwell/planes/data/AircraftStore.java b/src/main/java/com/benburwell/planes/data/AircraftStore.java index 076701d..311c20c 100644 --- a/src/main/java/com/benburwell/planes/data/AircraftStore.java +++ b/src/main/java/com/benburwell/planes/data/AircraftStore.java @@ -8,7 +8,7 @@ import java.util.List; import java.util.ArrayList; /** - * Created by ben on 11/17/16. + * @author ben */ public class AircraftStore { private Map aircraftMap = new HashMap<>(); diff --git a/src/main/java/com/benburwell/planes/data/AircraftStoreListener.java b/src/main/java/com/benburwell/planes/data/AircraftStoreListener.java index 2ef635f..0f62359 100644 --- a/src/main/java/com/benburwell/planes/data/AircraftStoreListener.java +++ b/src/main/java/com/benburwell/planes/data/AircraftStoreListener.java @@ -1,7 +1,7 @@ package com.benburwell.planes.data; /** - * Created by ben on 11/17/16. + * @author ben */ public interface AircraftStoreListener { void aircraftStoreChanged(); diff --git a/src/main/java/com/benburwell/planes/data/Airport.java b/src/main/java/com/benburwell/planes/data/Airport.java index ab16248..07cbceb 100644 --- a/src/main/java/com/benburwell/planes/data/Airport.java +++ b/src/main/java/com/benburwell/planes/data/Airport.java @@ -3,7 +3,7 @@ package com.benburwell.planes.data; import org.apache.commons.csv.CSVRecord; /** - * Created by ben on 11/19/16. + * @author ben */ public class Airport extends AbstractCSVReader { private int id; diff --git a/src/main/java/com/benburwell/planes/data/CSVObjectStore.java b/src/main/java/com/benburwell/planes/data/CSVObjectStore.java index a92e0a2..d04cfe8 100644 --- a/src/main/java/com/benburwell/planes/data/CSVObjectStore.java +++ b/src/main/java/com/benburwell/planes/data/CSVObjectStore.java @@ -4,13 +4,18 @@ import org.apache.commons.csv.CSVFormat; import org.apache.commons.csv.CSVParser; import org.apache.commons.csv.CSVRecord; -import java.io.*; +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.List; /** - * Created by ben on 11/19/16. + * @author ben */ public class CSVObjectStore { private List objects = new ArrayList<>(); diff --git a/src/main/java/com/benburwell/planes/data/NavigationAid.java b/src/main/java/com/benburwell/planes/data/NavigationAid.java index d730e7e..35a25ad 100644 --- a/src/main/java/com/benburwell/planes/data/NavigationAid.java +++ b/src/main/java/com/benburwell/planes/data/NavigationAid.java @@ -5,7 +5,7 @@ import org.apache.commons.csv.CSVRecord; /** * Frequencies in kHz, elevations in ft * - * Created by ben on 11/19/16. + * @author ben */ public class NavigationAid extends AbstractCSVReader { private int id; diff --git a/src/main/java/com/benburwell/planes/data/Position.java b/src/main/java/com/benburwell/planes/data/Position.java index 4b37235..7705150 100644 --- a/src/main/java/com/benburwell/planes/data/Position.java +++ b/src/main/java/com/benburwell/planes/data/Position.java @@ -3,7 +3,7 @@ package com.benburwell.planes.data; import java.util.Date; /** - * Created by ben on 11/15/16. + * @author ben */ public class Position { private Date timestamp = new Date(System.currentTimeMillis()); 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 getRangeRadii() { + private List getRangeRadii() { int rangeRadius = this.getRangeRadius(); List 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 navaids; - private CSVObjectStore airportStore; private AircraftMap mapPanel; private AircraftStoreListener aircraftStoreListener; public AircraftMapComponent(AircraftStore store, CSVObjectStore navaids, CSVObjectStore 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 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 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 airports; + private List airports; public AirportsTableModel(List 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 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); } diff --git a/src/main/java/com/benburwell/planes/sbs/AggregateDataSource.java b/src/main/java/com/benburwell/planes/sbs/AggregateDataSource.java index 2850404..1886e00 100644 --- a/src/main/java/com/benburwell/planes/sbs/AggregateDataSource.java +++ b/src/main/java/com/benburwell/planes/sbs/AggregateDataSource.java @@ -6,7 +6,7 @@ import java.util.Map; import java.util.HashMap; /** - * Created by ben on 11/15/16. + * @author ben */ public class AggregateDataSource implements DataSource { private List subscribers = new ArrayList<>(); diff --git a/src/main/java/com/benburwell/planes/sbs/DataListener.java b/src/main/java/com/benburwell/planes/sbs/DataListener.java index b0da2ef..9258310 100644 --- a/src/main/java/com/benburwell/planes/sbs/DataListener.java +++ b/src/main/java/com/benburwell/planes/sbs/DataListener.java @@ -1,7 +1,7 @@ package com.benburwell.planes.sbs; /** - * Created by ben on 11/15/16. + * @author ben */ public interface DataListener { void handleMessage(SBSPacket packet); diff --git a/src/main/java/com/benburwell/planes/sbs/DataSource.java b/src/main/java/com/benburwell/planes/sbs/DataSource.java index 961c6e2..c8bba6b 100644 --- a/src/main/java/com/benburwell/planes/sbs/DataSource.java +++ b/src/main/java/com/benburwell/planes/sbs/DataSource.java @@ -1,7 +1,7 @@ package com.benburwell.planes.sbs; /** - * Created by ben on 11/15/16. + * @author ben */ public interface DataSource { void subscribe(DataListener listener); diff --git a/src/main/java/com/benburwell/planes/sbs/MalformedPacketException.java b/src/main/java/com/benburwell/planes/sbs/MalformedPacketException.java index 6cbd1a3..1ab8ca9 100644 --- a/src/main/java/com/benburwell/planes/sbs/MalformedPacketException.java +++ b/src/main/java/com/benburwell/planes/sbs/MalformedPacketException.java @@ -1,7 +1,7 @@ package com.benburwell.planes.sbs; /** - * Created by ben on 11/15/16. + * @author ben */ public class MalformedPacketException extends Exception { private String message; diff --git a/src/main/java/com/benburwell/planes/sbs/MessageType.java b/src/main/java/com/benburwell/planes/sbs/MessageType.java index a2ecc66..96958ed 100644 --- a/src/main/java/com/benburwell/planes/sbs/MessageType.java +++ b/src/main/java/com/benburwell/planes/sbs/MessageType.java @@ -1,7 +1,7 @@ package com.benburwell.planes.sbs; /** - * Created by ben on 11/15/16. + * @author ben */ public enum MessageType { SELECTION_CHANGE("SEL"), diff --git a/src/main/java/com/benburwell/planes/sbs/SBSPacket.java b/src/main/java/com/benburwell/planes/sbs/SBSPacket.java index 5684803..86e6eaf 100644 --- a/src/main/java/com/benburwell/planes/sbs/SBSPacket.java +++ b/src/main/java/com/benburwell/planes/sbs/SBSPacket.java @@ -6,7 +6,7 @@ import java.util.Calendar; import java.util.Date; /** - * Created by ben on 11/15/16. + * @author ben */ public class SBSPacket { private MessageType messageType; diff --git a/src/main/java/com/benburwell/planes/sbs/TCPDataSource.java b/src/main/java/com/benburwell/planes/sbs/TCPDataSource.java index 2224d36..5cbe7f7 100644 --- a/src/main/java/com/benburwell/planes/sbs/TCPDataSource.java +++ b/src/main/java/com/benburwell/planes/sbs/TCPDataSource.java @@ -1,12 +1,14 @@ package com.benburwell.planes.sbs; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.Socket; import java.util.List; import java.util.ArrayList; -import java.io.*; -import java.net.*; /** - * Created by ben on 11/15/16. + * @author ben */ public class TCPDataSource implements DataSource { private List subscribers = new ArrayList<>(); diff --git a/src/main/java/com/benburwell/planes/sbs/TransmissionType.java b/src/main/java/com/benburwell/planes/sbs/TransmissionType.java index fb1761e..d2f799c 100644 --- a/src/main/java/com/benburwell/planes/sbs/TransmissionType.java +++ b/src/main/java/com/benburwell/planes/sbs/TransmissionType.java @@ -1,7 +1,7 @@ package com.benburwell.planes.sbs; /** - * Created by ben on 11/15/16. + * @author ben */ public enum TransmissionType { ES_IDENTIFICATION(1), diff --git a/src/main/java/com/benburwell/planes/sbs/UnrecognizedMessageTypeException.java b/src/main/java/com/benburwell/planes/sbs/UnrecognizedMessageTypeException.java index ee30a87..63d3d63 100644 --- a/src/main/java/com/benburwell/planes/sbs/UnrecognizedMessageTypeException.java +++ b/src/main/java/com/benburwell/planes/sbs/UnrecognizedMessageTypeException.java @@ -1,7 +1,7 @@ package com.benburwell.planes.sbs; /** - * Created by ben on 11/15/16. + * @author ben */ public class UnrecognizedMessageTypeException extends Exception { private String type; diff --git a/src/main/java/com/benburwell/planes/sbs/UnrecognizedTransmissionTypeException.java b/src/main/java/com/benburwell/planes/sbs/UnrecognizedTransmissionTypeException.java index abab067..8bc5c13 100644 --- a/src/main/java/com/benburwell/planes/sbs/UnrecognizedTransmissionTypeException.java +++ b/src/main/java/com/benburwell/planes/sbs/UnrecognizedTransmissionTypeException.java @@ -1,7 +1,7 @@ package com.benburwell.planes.sbs; /** - * Created by ben on 11/15/16. + * @author ben */ public class UnrecognizedTransmissionTypeException extends Exception { private int code; -- cgit v1.2.3