MCPcopy Create free account
hub / github.com/dumbledore/AlbiteREADER / initialize

Method initialize

src/org/albite/albite/BookCanvas.java:314–385  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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();

Callers

nothing calls this directly

Calls 14

loadFontMethod · 0.95
loadStatusFontMethod · 0.95
updateProgressBarSizeMethod · 0.95
linkMethod · 0.95
loadButtonsMethod · 0.95
applyColorProfileMethod · 0.95
applyScrollingSpeedMethod · 0.95
applyAbsScrPgOrdMethod · 0.95
applyScrollingLimitsMethod · 0.95
logMethod · 0.80
getWidthMethod · 0.45

Tested by

no test coverage detected