Changeset 62
- Timestamp:
- 08/08/07 03:20:42 (6 years ago)
- Location:
- bbtracker/trunk/src/org/bbtracker/mobile
- Files:
-
- 4 edited
-
Preferences.java (modified) (5 diffs)
-
gui/MainCanvas.java (modified) (1 diff)
-
gui/OptionsForm.java (modified) (5 diffs)
-
gui/StatusTile.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
bbtracker/trunk/src/org/bbtracker/mobile/Preferences.java
r61 r62 24 24 import java.io.IOException; 25 25 26 import javax.microedition.lcdui.Font; 26 27 import javax.microedition.rms.InvalidRecordIDException; 27 28 import javax.microedition.rms.RecordEnumeration; … … 85 86 86 87 private int units = UNITS_METRIC; 88 89 private int statusFontSize = Font.SIZE_MEDIUM; 87 90 88 91 private String exportDirectory; … … 164 167 } 165 168 169 public int getStatusFontSize() { 170 return statusFontSize; 171 } 172 173 public void setStatusFontSize(final int statusFontSize) { 174 this.statusFontSize = statusFontSize; 175 } 176 166 177 public int getNextTrackNumber() { 167 178 return trackNumber++; … … 199 210 exportFormats = in.readInt(); 200 211 units = in.readInt(); 212 statusFontSize = in.readInt(); 201 213 202 214 in.close(); … … 237 249 out.writeInt(exportFormats); 238 250 out.writeInt(units); 251 out.writeInt(statusFontSize); 239 252 240 253 out.close(); -
bbtracker/trunk/src/org/bbtracker/mobile/gui/MainCanvas.java
r61 r62 215 215 super.showNotify(); 216 216 manager.addPointListener(this); 217 updateTileSize(); 217 218 for (int i = 0; i < visibleTiles.length && visibleTiles[i] != null; i++) { 218 219 visibleTiles[i].showNotify(); -
bbtracker/trunk/src/org/bbtracker/mobile/gui/OptionsForm.java
r61 r62 24 24 import javax.microedition.lcdui.Display; 25 25 import javax.microedition.lcdui.Displayable; 26 import javax.microedition.lcdui.Font; 26 27 import javax.microedition.lcdui.Form; 27 28 import javax.microedition.lcdui.Item; … … 53 54 private final ChoiceGroup unitsGroup; 54 55 56 private final ChoiceGroup statusFontSizeGroup; 57 55 58 public OptionsForm(final TrackManager trackManager) { 56 59 super("Options"); … … 65 68 unitsGroup = new ChoiceGroup("Units: ", Choice.POPUP, Preferences.UNITS, null); 66 69 unitsGroup.setSelectedIndex(pref.getUnits(), true); 70 71 statusFontSizeGroup = new ChoiceGroup("Status text size: ", Choice.POPUP, new String[] { "Small", "Medium", 72 "Large" }, null); 73 int selectedFontSizeItem; 74 switch (pref.getStatusFontSize()) { 75 case Font.SIZE_SMALL: 76 selectedFontSizeItem = 0; 77 break; 78 case Font.SIZE_MEDIUM: 79 selectedFontSizeItem = 1; 80 break; 81 case Font.SIZE_LARGE: 82 selectedFontSizeItem = 2; 83 break; 84 default: 85 selectedFontSizeItem = 1; 86 } 87 statusFontSizeGroup.setSelectedIndex(selectedFontSizeItem, true); 67 88 68 89 startTypeGroup = new ChoiceGroup("Startup action: ", Choice.POPUP, Preferences.START_ACTIONS, null); … … 81 102 append(sampleField); 82 103 append(unitsGroup); 104 append(statusFontSizeGroup); 83 105 append(startTypeGroup); 84 106 append(directoryField); … … 108 130 109 131 pref.setUnits(unitsGroup.getSelectedIndex()); 132 133 final int newFontSize; 134 switch (statusFontSizeGroup.getSelectedIndex()) { 135 case 0: 136 newFontSize = Font.SIZE_SMALL; 137 break; 138 case 1: 139 newFontSize = Font.SIZE_MEDIUM; 140 break; 141 case 2: 142 newFontSize = Font.SIZE_LARGE; 143 break; 144 default: 145 throw new IllegalStateException(); 146 } 147 pref.setStatusFontSize(newFontSize); 110 148 111 149 pref.store(); -
bbtracker/trunk/src/org/bbtracker/mobile/gui/StatusTile.java
r61 r62 192 192 193 193 public int getPreferredHeight(final int width) { 194 setFontSize(Preferences.getInstance().getStatusFontSize()); 194 195 final int lineCount; 195 196 if (fitsTwoLineLayout(width)) {
Note: See TracChangeset
for help on using the changeset viewer.