Changeset 189
- Timestamp:
- 04/29/08 21:32:53 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
bbtracker/trunk/src/org/bbtracker/mobile/gui/DetailsTile.java
r165 r189 51 51 private static final String NAME_LABEL = "Name: "; 52 52 53 private static final String SATELLITES_LABEL = "Satellites: "; 54 53 55 private static final int MARGIN = 2; 54 56 … … 67 69 font = Font.getFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN, fontSize); 68 70 labelWidth = 0; 69 updateLabeWidth(ELEVATION_LABEL); 70 updateLabeWidth(LAT_LABEL); 71 updateLabeWidth(LON_LABEL); 72 updateLabeWidth(TIME_LABEL); 73 updateLabeWidth(DISTANCE_LABEL); 74 updateLabeWidth(SPEED_LABEL); 75 updateLabeWidth(POINT_LABEL); 76 updateLabeWidth(NAME_LABEL); 71 updateLabelWidth(ELEVATION_LABEL); 72 updateLabelWidth(LAT_LABEL); 73 updateLabelWidth(LON_LABEL); 74 updateLabelWidth(TIME_LABEL); 75 updateLabelWidth(DISTANCE_LABEL); 76 updateLabelWidth(SPEED_LABEL); 77 updateLabelWidth(POINT_LABEL); 78 updateLabelWidth(NAME_LABEL); 79 updateLabelWidth(SATELLITES_LABEL); 77 80 } 78 81 79 private void updateLabe Width(final String label) {82 private void updateLabelWidth(final String label) { 80 83 final int w = font.stringWidth(label); 81 84 if (w > labelWidth) { … … 101 104 double lengthValue = Double.NaN; 102 105 String pointTime = null; 106 byte satellitesValue = -1; 103 107 String time = "-"; 104 108 if (p != null) { … … 109 113 elevationValue = p.getElevation(); 110 114 pointTime = new Date(p.getTimestamp()).toString().substring(11, 19); 115 satellitesValue = p.getSatellites(); 111 116 } 112 117 if (track != null) { … … 145 150 final String elevation = unit.elevationToString(elevationValue); 146 151 final String length = unit.distanceToString(lengthValue); 152 final String satellites = satellitesValue > 0 ? String.valueOf(satellitesValue) : "-"; 147 153 148 154 final int fontHeight = font.getHeight(); … … 176 182 g.drawString(COURSE_LABEL, MARGIN, y, Graphics.TOP | Graphics.LEFT); 177 183 g.drawString(course, x, y, Graphics.TOP | Graphics.LEFT); 184 y += fontHeight; 185 g.drawString(SATELLITES_LABEL, MARGIN, y, Graphics.TOP | Graphics.LEFT); 186 g.drawString(satellites, x, y, Graphics.TOP | Graphics.LEFT); 178 187 } 179 188
Note: See TracChangeset
for help on using the changeset viewer.