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.InputModeSkin;
31:
32: /** Resources for the input mode indicator layer */
33: public class InputModeResources {
34: /** Flag indicated if resources have been already loaded */
35: private static boolean init;
36:
37: /** Private constructor */
38: private InputModeResources() {
39: }
40:
41: /** Load input mode indicator resources. Do nothing if they have been already loaded */
42: public static void load() {
43: load(false);
44: }
45:
46: /**
47: * Load input mode indicator resources.
48: * @param reload if true resources are being loaded even if the
49: * initialization has been already done. In case of false don't
50: * reload the resources
51: */
52: public static void load(boolean reload) {
53: if (init && !reload) {
54: return;
55: }
56:
57: InputModeSkin.MARGIN = SkinResources
58: .getInt(SkinPropertiesIDs.INPUT_MODE_MARGIN);
59: InputModeSkin.COLOR_BG = SkinResources
60: .getInt(SkinPropertiesIDs.INPUT_MODE_COLOR_BG);
61: InputModeSkin.COLOR_FG = SkinResources
62: .getInt(SkinPropertiesIDs.INPUT_MODE_COLOR_FG);
63: InputModeSkin.COLOR_BDR = SkinResources
64: .getInt(SkinPropertiesIDs.INPUT_MODE_COLOR_BDR);
65: InputModeSkin.FONT = SkinResources
66: .getFont(SkinPropertiesIDs.INPUT_MODE_FONT);
67: InputModeSkin.IMAGE_BG = SkinResources.getCompositeImage(
68: SkinPropertiesIDs.INPUT_MODE_IMAGE_BG, 3);
69: init = true;
70: }
71: }
|