()
| 312 | } |
| 313 | |
| 314 | public final synchronized void initialize() { |
| 315 | |
| 316 | //prevent re-initialization |
| 317 | if(initialized) { |
| 318 | return; |
| 319 | } |
| 320 | |
| 321 | fullScreenWidth = getWidth(); |
| 322 | fullScreenHeight = getHeight(); |
| 323 | |
| 324 | loadFont(); |
| 325 | loadStatusFont(); |
| 326 | |
| 327 | final int w = getWidth(); |
| 328 | |
| 329 | /* |
| 330 | * Take the min value; take into account that some screens |
| 331 | * are in landscape mode by default. |
| 332 | */ |
| 333 | centerBoxSide = Math.min(w, getHeight()) / 8; |
| 334 | |
| 335 | statusBarHeight = fontStatus.getLineHeight() + (STATUS_BAR_SPACING * 2); |
| 336 | //#debug |
| 337 | AlbiteMIDlet.LOGGER.log("status bar height: " + statusBarHeight); |
| 338 | |
| 339 | /* Clock: 00:00 = 5 chars */ |
| 340 | clockWidth = (fontStatusMaxWidth * clockChars.length) + (STATUS_BAR_SPACING * 2); |
| 341 | |
| 342 | /* |
| 343 | * We assume that there would be no more than 999 chapters |
| 344 | */ |
| 345 | chapterNoWidth = (fontStatusMaxWidth * chapterNoChars.length) + (STATUS_BAR_SPACING * 2); |
| 346 | |
| 347 | updateProgressBarSize(w); |
| 348 | |
| 349 | progressBarHeight = (statusBarHeight - (STATUS_BAR_SPACING * 2)) / 3; |
| 350 | |
| 351 | waitCursor = new ImageButton("/res/gfx/hourglass.ali", TASK_NONE); |
| 352 | |
| 353 | /* set default profiles if none selected */ |
| 354 | if (currentScheme == null) { |
| 355 | ColorScheme day = ColorScheme.DEFAULT_DAY; |
| 356 | ColorScheme night = ColorScheme.DEFAULT_NIGHT; |
| 357 | day.link(night); |
| 358 | currentScheme = day; |
| 359 | } |
| 360 | |
| 361 | /* |
| 362 | * Load menu images |
| 363 | * Images cannot be stored normally (i.e. as Image objects) as they need |
| 364 | * to be mutable: one should be able to select the color of the image |
| 365 | * without affecting the alpha channel |
| 366 | */ |
| 367 | loadButtons(); |
| 368 | |
| 369 | applyColorProfile(); |
| 370 | |
| 371 | initializePageCanvases(); |
nothing calls this directly
no test coverage detected