From 382c54a0d052c8975b57c995ef83bc8934bde242 Mon Sep 17 00:00:00 2001 From: Mike Beattie Date: Fri, 14 Sep 2012 13:09:58 +1200 Subject: altosui: remove un-used imports Signed-off-by: Mike Beattie --- altosui/AltosGraphUI.java | 6 ------ 1 file changed, 6 deletions(-) (limited to 'altosui/AltosGraphUI.java') diff --git a/altosui/AltosGraphUI.java b/altosui/AltosGraphUI.java index edde1307..e0e03093 100644 --- a/altosui/AltosGraphUI.java +++ b/altosui/AltosGraphUI.java @@ -8,17 +8,11 @@ import java.io.*; import java.util.ArrayList; import java.awt.*; -import java.awt.event.*; import javax.swing.*; -import javax.swing.filechooser.FileNameExtensionFilter; -import javax.swing.table.*; import org.altusmetrum.AltosLib.*; import org.jfree.chart.ChartPanel; -import org.jfree.chart.ChartUtilities; import org.jfree.chart.JFreeChart; -import org.jfree.chart.axis.AxisLocation; -import org.jfree.ui.ApplicationFrame; import org.jfree.ui.RefineryUtilities; public class AltosGraphUI extends AltosFrame -- cgit v1.2.3 From ce1b19a012a2c1c623b03efb93b881e297736718 Mon Sep 17 00:00:00 2001 From: Mike Beattie Date: Fri, 14 Sep 2012 13:13:35 +1200 Subject: altosui: comment out un-used fields and methods Signed-off-by: Mike Beattie --- altosui/AltosBTDevice.java | 2 ++ altosui/AltosConfigUI.java | 4 ++-- altosui/AltosDisplayThread.java | 2 +- altosui/AltosEepromManage.java | 4 ++-- altosui/AltosEepromSelect.java | 2 +- altosui/AltosFlashUI.java | 2 +- altosui/AltosGraphUI.java | 8 +++++--- altosui/AltosInfoTable.java | 6 +++--- altosui/AltosSiteMap.java | 10 +++++++--- altosui/AltosSiteMapPreload.java | 2 +- altosui/AltosUI.java | 4 ++-- 11 files changed, 27 insertions(+), 19 deletions(-) (limited to 'altosui/AltosGraphUI.java') diff --git a/altosui/AltosBTDevice.java b/altosui/AltosBTDevice.java index 0866ccc8..03e7cbec 100644 --- a/altosui/AltosBTDevice.java +++ b/altosui/AltosBTDevice.java @@ -77,11 +77,13 @@ public class AltosBTDevice extends altos_bt_device implements AltosDevice { return libaltos.altos_bt_open(this); } + /* private boolean isAltusMetrum() { if (getName().startsWith(Altos.bt_product_telebt)) return true; return false; } + */ public boolean matchProduct(int want_product) { diff --git a/altosui/AltosConfigUI.java b/altosui/AltosConfigUI.java index 8a8f2c0e..dd34a9cf 100644 --- a/altosui/AltosConfigUI.java +++ b/altosui/AltosConfigUI.java @@ -741,12 +741,12 @@ public class AltosConfigUI } public void set_flight_log_max_limit(int flight_log_max_limit) { - boolean any_added = false; + //boolean any_added = false; flight_log_max_value.removeAllItems(); for (int i = 0; i < flight_log_max_values.length; i++) { if (Integer.parseInt(flight_log_max_values[i]) < flight_log_max_limit){ flight_log_max_value.addItem(flight_log_max_values[i]); - any_added = true; + //any_added = true; } } flight_log_max_value.addItem(String.format("%d", flight_log_max_limit)); diff --git a/altosui/AltosDisplayThread.java b/altosui/AltosDisplayThread.java index 299070c9..f7a1d03e 100644 --- a/altosui/AltosDisplayThread.java +++ b/altosui/AltosDisplayThread.java @@ -222,7 +222,7 @@ public class AltosDisplayThread extends Thread { public void run() { boolean interrupted = false; - String line; + //String line; AltosState state = null; AltosState old_state = null; boolean told; diff --git a/altosui/AltosEepromManage.java b/altosui/AltosEepromManage.java index e6739e77..b8de77da 100644 --- a/altosui/AltosEepromManage.java +++ b/altosui/AltosEepromManage.java @@ -153,7 +153,7 @@ public class AltosEepromManage implements ActionListener { ee.getLocalizedMessage(), JOptionPane.ERROR_MESSAGE); } else if (e instanceof TimeoutException) { - TimeoutException te = (TimeoutException) e; + //TimeoutException te = (TimeoutException) e; JOptionPane.showMessageDialog(frame, String.format("Communications failed with \"%s\"", device.toShortString()), @@ -194,7 +194,7 @@ public class AltosEepromManage implements ActionListener { public AltosEepromManage(JFrame given_frame) { - boolean running = false; + //boolean running = false; frame = given_frame; device = AltosDeviceDialog.show(frame, Altos.product_any); diff --git a/altosui/AltosEepromSelect.java b/altosui/AltosEepromSelect.java index dcdfcc3e..d8b8693d 100644 --- a/altosui/AltosEepromSelect.java +++ b/altosui/AltosEepromSelect.java @@ -51,7 +51,7 @@ class AltosEepromItem implements ActionListener { } public class AltosEepromSelect extends AltosDialog implements ActionListener { - private JList list; + //private JList list; private JFrame frame; JButton ok; JButton cancel; diff --git a/altosui/AltosFlashUI.java b/altosui/AltosFlashUI.java index 3ccfa76c..f8c24b16 100644 --- a/altosui/AltosFlashUI.java +++ b/altosui/AltosFlashUI.java @@ -286,7 +286,7 @@ public class AltosFlashUI if (!select_source_file()) return; build_dialog(); - flash_task f = new flash_task(this); + //flash_task f = new flash_task(this); } static void show(JFrame frame) { diff --git a/altosui/AltosGraphUI.java b/altosui/AltosGraphUI.java index e0e03093..7715eedd 100644 --- a/altosui/AltosGraphUI.java +++ b/altosui/AltosGraphUI.java @@ -22,9 +22,9 @@ public class AltosGraphUI extends AltosFrame static final private Color red = new Color(194,31,31); static final private Color green = new Color(31,194,31); static final private Color blue = new Color(31,31,194); - static final private Color black = new Color(31,31,31); + //static final private Color black = new Color(31,31,31); static final private Color yellow = new Color(194,194,31); - static final private Color cyan = new Color(31,194,194); + //static final private Color cyan = new Color(31,194,194); static final private Color magenta = new Color(194,31,194); static private class OverallGraphs { @@ -94,7 +94,7 @@ public class AltosGraphUI extends AltosFrame } }; - AltosGraphTime.Element e_pad = new AltosGraphTime.StateMarker(Altos.ao_flight_pad, "Pad"); + //AltosGraphTime.Element e_pad = new AltosGraphTime.StateMarker(Altos.ao_flight_pad, "Pad"); AltosGraphTime.Element e_boost = new AltosGraphTime.StateMarker(Altos.ao_flight_boost, "Boost"); AltosGraphTime.Element e_fast = new AltosGraphTime.StateMarker(Altos.ao_flight_fast, "Fast"); AltosGraphTime.Element e_coast = new AltosGraphTime.StateMarker(Altos.ao_flight_coast, "Coast"); @@ -223,11 +223,13 @@ public class AltosGraphUI extends AltosFrame return createGraphsWhich(data, which).get(0); } + /* private static ArrayList createGraphs( Iterable data) { return createGraphsWhich(data, -1); } + */ private static ArrayList createGraphsWhich( Iterable data, int which) diff --git a/altosui/AltosInfoTable.java b/altosui/AltosInfoTable.java index c4f42125..d578f2d2 100644 --- a/altosui/AltosInfoTable.java +++ b/altosui/AltosInfoTable.java @@ -85,9 +85,9 @@ public class AltosInfoTable extends JTable { } void info_add_deg(int col, String name, double v, int pos, int neg) { - int c = pos; + //int c = pos; if (v < 0) { - c = neg; + //c = neg; v = -v; } double deg = Math.floor(v); @@ -184,7 +184,7 @@ public class AltosInfoTable extends JTable { state.gps.hour, state.gps.minute, state.gps.second); - int nsat_vis = 0; + //int nsat_vis = 0; int c; if (state.gps.cc_gps_sat == null) diff --git a/altosui/AltosSiteMap.java b/altosui/AltosSiteMap.java index d928dd5c..3ea4d0fd 100644 --- a/altosui/AltosSiteMap.java +++ b/altosui/AltosSiteMap.java @@ -52,11 +52,13 @@ public class AltosSiteMap extends JScrollPane implements AltosFlightDisplay { // based on google js // http://maps.gstatic.com/intl/en_us/mapfiles/api-3/2/10/main.js // search for fromLatLngToPoint and fromPointToLatLng + /* private static Point2D.Double pt(LatLng latlng, int zoom) { double scale_x = 256/360.0 * Math.pow(2, zoom); double scale_y = 256/(2.0*Math.PI) * Math.pow(2, zoom); return pt(latlng, scale_x, scale_y); } + */ private static Point2D.Double pt(LatLng latlng, double scale_x, double scale_y) @@ -99,9 +101,11 @@ public class AltosSiteMap extends JScrollPane implements AltosFlightDisplay { private LatLng latlng(double x, double y) { return latlng(new Point2D.Double(x,y), scale_x, scale_y); } + /* private LatLng latlng(Point2D.Double pt) { return latlng(pt, scale_x, scale_y); } + */ ConcurrentHashMap mapTiles = new ConcurrentHashMap(); Point2D.Double centre; @@ -181,8 +185,8 @@ public class AltosSiteMap extends JScrollPane implements AltosFlightDisplay { AltosSiteMap asm = new AltosSiteMap(true); asm.centre = asm.getBaseLocation(lat, lng); - Point2D.Double p = new Point2D.Double(); - Point2D.Double p2; + //Point2D.Double p = new Point2D.Double(); + //Point2D.Double p2; int dx = -w/2, dy = -h/2; for (int y = dy; y < h+dy; y++) { for (int x = dx; x < w+dx; x++) { @@ -417,7 +421,7 @@ public class AltosSiteMap extends JScrollPane implements AltosFlightDisplay { public AltosSiteMap(int in_radius) { radius = in_radius; - GrabNDrag scroller = new GrabNDrag(comp); + //GrabNDrag scroller = new GrabNDrag(comp); comp.setLayout(layout); diff --git a/altosui/AltosSiteMapPreload.java b/altosui/AltosSiteMapPreload.java index 35f730e3..33849c66 100644 --- a/altosui/AltosSiteMapPreload.java +++ b/altosui/AltosSiteMapPreload.java @@ -176,7 +176,7 @@ class AltosSites extends Thread { public void run() { try { URLConnection uc = url.openConnection(); - int length = uc.getContentLength(); + //int length = uc.getContentLength(); InputStreamReader in_stream = new InputStreamReader(uc.getInputStream(), Altos.unicode_set); BufferedReader in = new BufferedReader(in_stream); diff --git a/altosui/AltosUI.java b/altosui/AltosUI.java index e4af6b3b..b5cbefe7 100644 --- a/altosui/AltosUI.java +++ b/altosui/AltosUI.java @@ -87,7 +87,7 @@ public class AltosUI extends AltosFrame { c.weighty = 1; b = new JButton(label); - Dimension ps = b.getPreferredSize(); + //Dimension ps = b.getPreferredSize(); gridbag.setConstraints(b, c); add(b, c); @@ -441,7 +441,7 @@ public class AltosUI extends AltosFrame { return null; } AltosRecordIterable recs; - AltosReplayReader reader; + //AltosReplayReader reader; if (file.getName().endsWith("eeprom")) { recs = new AltosEepromIterable(in); } else { -- cgit v1.2.3 From 38fb6c070ffaf820d524fecce540d91fc6dda57b Mon Sep 17 00:00:00 2001 From: Mike Beattie Date: Fri, 14 Sep 2012 13:14:31 +1200 Subject: altosui: comment out un-used classes and associated imports Signed-off-by: Mike Beattie --- altosui/AltosConfigureUI.java | 3 ++- altosui/AltosGraphUI.java | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'altosui/AltosGraphUI.java') diff --git a/altosui/AltosConfigureUI.java b/altosui/AltosConfigureUI.java index a364273a..c576b052 100644 --- a/altosui/AltosConfigureUI.java +++ b/altosui/AltosConfigureUI.java @@ -22,7 +22,6 @@ import java.awt.event.*; import java.beans.*; import javax.swing.*; import javax.swing.event.*; -import javax.swing.plaf.basic.*; class DelegatingRenderer implements ListCellRenderer { @@ -289,6 +288,7 @@ public class AltosConfigureUI c.anchor = GridBagConstraints.WEST; pane.add(new JLabel("Look & feel"), c); + /* class LookAndFeelRenderer extends BasicComboBoxRenderer implements ListCellRenderer { public LookAndFeelRenderer() { @@ -307,6 +307,7 @@ public class AltosConfigureUI return this; } } + */ final UIManager.LookAndFeelInfo[] look_and_feels = UIManager.getInstalledLookAndFeels(); diff --git a/altosui/AltosGraphUI.java b/altosui/AltosGraphUI.java index 7715eedd..f2addfd3 100644 --- a/altosui/AltosGraphUI.java +++ b/altosui/AltosGraphUI.java @@ -143,7 +143,8 @@ public class AltosGraphUI extends AltosFrame return graphs; } } - + + /* static private class AscentGraphs extends OverallGraphs { protected AltosGraphTime myAltosGraphTime(String suffix) { return (new AltosGraphTime("Ascent " + suffix) { @@ -158,7 +159,9 @@ public class AltosGraphUI extends AltosFrame .addElement(e_coast); } } - + */ + + /* static private class DescentGraphs extends OverallGraphs { protected AltosGraphTime myAltosGraphTime(String suffix) { return (new AltosGraphTime("Descent " + suffix) { @@ -173,6 +176,7 @@ public class AltosGraphUI extends AltosFrame // ((XYGraph)graph[8]).ymin = new Double(-50); } } + */ public AltosGraphUI(AltosRecordIterable records, String name) throws InterruptedException, IOException { super(String.format("Altos Graph %s", name)); -- cgit v1.2.3 From d3d69bdecfcb45d1e3a8c6b10c80eef1afcc2310 Mon Sep 17 00:00:00 2001 From: Mike Beattie Date: Fri, 14 Sep 2012 13:16:16 +1200 Subject: altosui: comment out/remove dead code Signed-off-by: Mike Beattie --- altosui/AltosGraphUI.java | 2 -- altosui/AltosInfoTable.java | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'altosui/AltosGraphUI.java') diff --git a/altosui/AltosGraphUI.java b/altosui/AltosGraphUI.java index f2addfd3..cb8e3d20 100644 --- a/altosui/AltosGraphUI.java +++ b/altosui/AltosGraphUI.java @@ -182,8 +182,6 @@ public class AltosGraphUI extends AltosFrame super(String.format("Altos Graph %s", name)); AltosDataPointReader reader = new AltosDataPointReader (records); - if (reader == null) - return; if (reader.has_accel) init(reader, records, 0); diff --git a/altosui/AltosInfoTable.java b/altosui/AltosInfoTable.java index d578f2d2..86e02ab1 100644 --- a/altosui/AltosInfoTable.java +++ b/altosui/AltosInfoTable.java @@ -145,6 +145,7 @@ public class AltosInfoTable extends JTable { info_add_row(1, "GPS height", "%6.0f", state.gps_height); /* The SkyTraq GPS doesn't report these values */ + /* if (false) { info_add_row(1, "GPS ground speed", "%8.1f m/s %3d°", state.gps.ground_speed, @@ -154,6 +155,8 @@ public class AltosInfoTable extends JTable { info_add_row(1, "GPS error", "%6d m(h)%3d m(v)", state.gps.h_error, state.gps.v_error); } + */ + info_add_row(1, "GPS hdop", "%8.1f", state.gps.hdop); if (state.npad > 0) { -- cgit v1.2.3