projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos
[fw/altos]
/
altosui
/
AltosDescent.java
diff --git
a/altosui/AltosDescent.java
b/altosui/AltosDescent.java
index 2a9e7eef3bf728d834d62b87021da6fd9d71b653..2e3f26bd3e13feb3bd1ca350150d32bb248a8eee 100644
(file)
--- a/
altosui/AltosDescent.java
+++ b/
altosui/AltosDescent.java
@@
-15,7
+15,7
@@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-package
altosui
;
+package
AltosUI
;
import java.awt.*;
import java.awt.event.*;
import java.awt.*;
import java.awt.event.*;
@@
-27,6
+27,7
@@
import java.util.*;
import java.text.*;
import java.util.prefs.*;
import java.util.concurrent.LinkedBlockingQueue;
import java.text.*;
import java.util.prefs.*;
import java.util.concurrent.LinkedBlockingQueue;
+import org.altusmetrum.AltosLib.*;
public class AltosDescent extends JComponent implements AltosFlightDisplay {
GridBagLayout layout;
public class AltosDescent extends JComponent implements AltosFlightDisplay {
GridBagLayout layout;
@@
-55,6
+56,11
@@
public class AltosDescent extends JComponent implements AltosFlightDisplay {
lights.set(false);
}
lights.set(false);
}
+ void set_font() {
+ label.setFont(Altos.label_font);
+ value.setFont(Altos.value_font);
+ }
+
public DescentStatus (GridBagLayout layout, int y, String text) {
GridBagConstraints c = new GridBagConstraints();
c.weighty = 1;
public DescentStatus (GridBagLayout layout, int y, String text) {
GridBagConstraints c = new GridBagConstraints();
c.weighty = 1;
@@
-113,6
+119,10
@@
public class AltosDescent extends JComponent implements AltosFlightDisplay {
value.setVisible(false);
}
value.setVisible(false);
}
+ void show(AltosUnits units, double v) {
+ value.setText(units.show(8, v));
+ }
+
void show(String format, double v) {
value.setText(String.format(format, v));
}
void show(String format, double v) {
value.setText(String.format(format, v));
}
@@
-121,6
+131,11
@@
public class AltosDescent extends JComponent implements AltosFlightDisplay {
value.setText(v);
}
value.setText(v);
}
+ void set_font() {
+ label.setFont(Altos.label_font);
+ value.setFont(Altos.value_font);
+ }
+
public DescentValue (GridBagLayout layout, int x, int y, String text) {
GridBagConstraints c = new GridBagConstraints();
c.weighty = 1;
public DescentValue (GridBagLayout layout, int x, int y, String text) {
GridBagConstraints c = new GridBagConstraints();
c.weighty = 1;
@@
-169,6
+184,12
@@
public class AltosDescent extends JComponent implements AltosFlightDisplay {
value2.setVisible(false);
}
value2.setVisible(false);
}
+ void set_font() {
+ label.setFont(Altos.label_font);
+ value1.setFont(Altos.value_font);
+ value2.setFont(Altos.value_font);
+ }
+
abstract void show(AltosState state, int crc_errors);
void show(String v1, String v2) {
abstract void show(AltosState state, int crc_errors);
void show(String v1, String v2) {
@@
-222,7
+243,7
@@
public class AltosDescent extends JComponent implements AltosFlightDisplay {
class Height extends DescentValue {
void show (AltosState state, int crc_errors) {
class Height extends DescentValue {
void show (AltosState state, int crc_errors) {
- show(
"%6.0f m"
, state.height);
+ show(
AltosConvert.height
, state.height);
}
public Height (GridBagLayout layout, int x, int y) {
super (layout, x, y, "Height");
}
public Height (GridBagLayout layout, int x, int y) {
super (layout, x, y, "Height");
@@
-236,7
+257,7
@@
public class AltosDescent extends JComponent implements AltosFlightDisplay {
double speed = state.speed;
if (!state.ascent)
speed = state.baro_speed;
double speed = state.speed;
if (!state.ascent)
speed = state.baro_speed;
- show(
"%6.0f m/s"
, speed);
+ show(
AltosConvert.speed
, speed);
}
public Speed (GridBagLayout layout, int x, int y) {
super (layout, x, y, "Speed");
}
public Speed (GridBagLayout layout, int x, int y) {
super (layout, x, y, "Speed");
@@
-329,7
+350,7
@@
public class AltosDescent extends JComponent implements AltosFlightDisplay {
class Range extends DescentValue {
void show (AltosState state, int crc_errors) {
class Range extends DescentValue {
void show (AltosState state, int crc_errors) {
- show(
"%6.0f m"
, state.range);
+ show(
AltosConvert.distance
, state.range);
}
public Range (GridBagLayout layout, int x, int y) {
super (layout, x, y, "Range");
}
public Range (GridBagLayout layout, int x, int y) {
super (layout, x, y, "Range");
@@
-361,6
+382,18
@@
public class AltosDescent extends JComponent implements AltosFlightDisplay {
apogee.reset();
}
apogee.reset();
}
+ public void set_font() {
+ lat.set_font();
+ lon.set_font();
+ height.set_font();
+ speed.set_font();
+ bearing.set_font();
+ range.set_font();
+ elevation.set_font();
+ main.set_font();
+ apogee.set_font();
+ }
+
public void show(AltosState state, int crc_errors) {
height.show(state, crc_errors);
speed.show(state, crc_errors);
public void show(AltosState state, int crc_errors) {
height.show(state, crc_errors);
speed.show(state, crc_errors);