01: /*
02: *
03: *
04: * Copyright 1990-2007 Sun Microsystems, Inc. All Rights Reserved.
05: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
06: *
07: * This program is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU General Public License version
09: * 2 only, as published by the Free Software Foundation.
10: *
11: * This program is distributed in the hope that it will be useful, but
12: * WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * General Public License version 2 for more details (a copy is
15: * included at /legal/license.txt).
16: *
17: * You should have received a copy of the GNU General Public License
18: * version 2 along with this work; if not, write to the Free Software
19: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA
21: *
22: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
23: * Clara, CA 95054 or visit www.sun.com if you need additional
24: * information or have any questions.
25: */
26:
27: package com.sun.midp.chameleon.skins.resources;
28:
29: import com.sun.midp.chameleon.skins.SkinPropertiesIDs;
30: import com.sun.midp.chameleon.skins.TickerSkin;
31:
32: import javax.microedition.lcdui.Image;
33: import javax.microedition.lcdui.Font;
34:
35: public class TickerResources {
36: private static boolean init;
37:
38: private TickerResources() {
39: }
40:
41: public static void load() {
42: load(false);
43: }
44:
45: public static void load(boolean reload) {
46: if (init && !reload) {
47: return;
48: }
49:
50: TickerSkin.HEIGHT = SkinResources
51: .getInt(SkinPropertiesIDs.TICKER_HEIGHT);
52:
53: int align = SkinResources
54: .getInt(SkinPropertiesIDs.TICKER_ALIGN);
55: TickerSkin.ALIGN = SkinResources
56: .resourceConstantsToGraphics(align);
57:
58: int direction = SkinResources
59: .getInt(SkinPropertiesIDs.TICKER_DIRECTION);
60: TickerSkin.DIRECTION = SkinResources
61: .resourceConstantsToGraphics(direction);
62:
63: TickerSkin.RATE = SkinResources
64: .getInt(SkinPropertiesIDs.TICKER_RATE);
65: TickerSkin.SPEED = SkinResources
66: .getInt(SkinPropertiesIDs.TICKER_SPEED);
67: TickerSkin.TEXT_ANCHOR_Y = SkinResources
68: .getInt(SkinPropertiesIDs.TICKER_TEXT_ANCHOR_Y);
69:
70: int shdAlign = SkinResources
71: .getInt(SkinPropertiesIDs.TICKER_TEXT_SHD_ALIGN);
72: TickerSkin.TEXT_SHD_ALIGN = SkinResources
73: .resourceConstantsToGraphics(shdAlign);
74:
75: TickerSkin.COLOR_BG = SkinResources
76: .getInt(SkinPropertiesIDs.TICKER_COLOR_BG);
77: TickerSkin.COLOR_FG = SkinResources
78: .getInt(SkinPropertiesIDs.TICKER_COLOR_FG);
79: TickerSkin.COLOR_FG_SHD = SkinResources
80: .getInt(SkinPropertiesIDs.TICKER_COLOR_FG_SHD);
81: TickerSkin.FONT = SkinResources
82: .getFont(SkinPropertiesIDs.TICKER_FONT);
83: TickerSkin.IMAGE_BG = SkinResources.getCompositeImage(
84: SkinPropertiesIDs.TICKER_IMAGE_BG, 3);
85: TickerSkin.IMAGE_AU_BG = SkinResources.getCompositeImage(
86: SkinPropertiesIDs.TICKER_IMAGE_AU_BG, 3);
87:
88: init = true;
89: }
90: }
|