001: /*
002: *
003: *
004: * Copyright 1990-2007 Sun Microsystems, Inc. All Rights Reserved.
005: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
006: *
007: * This program is free software; you can redistribute it and/or
008: * modify it under the terms of the GNU General Public License version
009: * 2 only, as published by the Free Software Foundation.
010: *
011: * This program is distributed in the hope that it will be useful, but
012: * WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * General Public License version 2 for more details (a copy is
015: * included at /legal/license.txt).
016: *
017: * You should have received a copy of the GNU General Public License
018: * version 2 along with this work; if not, write to the Free Software
019: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA
021: *
022: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
023: * Clara, CA 95054 or visit www.sun.com if you need additional
024: * information or have any questions.
025: */
026:
027: package com.sun.midp.chameleon.skins.resources;
028:
029: import com.sun.midp.chameleon.skins.SkinPropertiesIDs;
030: import com.sun.midp.chameleon.skins.ChoiceGroupSkin;
031:
032: import javax.microedition.lcdui.Image;
033: import javax.microedition.lcdui.Font;
034:
035: public class ChoiceGroupResources {
036: private static boolean init;
037:
038: // private constructor
039: private ChoiceGroupResources() {
040: }
041:
042: public static void load() {
043: load(false);
044: }
045:
046: public static void load(boolean reload) {
047: if (init && !reload) {
048: return;
049: }
050:
051: ChoiceGroupSkin.WIDTH_IMAGE = SkinResources
052: .getInt(SkinPropertiesIDs.CHOICE_WIDTH_IMAGE);
053: ChoiceGroupSkin.HEIGHT_IMAGE = SkinResources
054: .getInt(SkinPropertiesIDs.CHOICE_HEIGHT_IMAGE);
055: ChoiceGroupSkin.WIDTH_SCROLL = SkinResources
056: .getInt(SkinPropertiesIDs.CHOICE_WIDTH_SCROLL);
057: ChoiceGroupSkin.WIDTH_THUMB = SkinResources
058: .getInt(SkinPropertiesIDs.CHOICE_WIDTH_THUMB);
059: ChoiceGroupSkin.HEIGHT_THUMB = SkinResources
060: .getInt(SkinPropertiesIDs.CHOICE_HEIGHT_THUMB);
061: ChoiceGroupSkin.PAD_H = SkinResources
062: .getInt(SkinPropertiesIDs.CHOICE_PAD_H);
063: ChoiceGroupSkin.PAD_V = SkinResources
064: .getInt(SkinPropertiesIDs.CHOICE_PAD_V);
065: ChoiceGroupSkin.COLOR_FG = SkinResources
066: .getInt(SkinPropertiesIDs.CHOICE_COLOR_FG);
067: ChoiceGroupSkin.COLOR_BG = SkinResources
068: .getInt(SkinPropertiesIDs.CHOICE_COLOR_BG);
069: ChoiceGroupSkin.COLOR_BORDER = SkinResources
070: .getInt(SkinPropertiesIDs.CHOICE_COLOR_BRDR);
071: ChoiceGroupSkin.COLOR_BORDER_SHD = SkinResources
072: .getInt(SkinPropertiesIDs.CHOICE_COLOR_BRDR_SHD);
073: ChoiceGroupSkin.COLOR_SCROLL = SkinResources
074: .getInt(SkinPropertiesIDs.CHOICE_COLOR_SCROLL);
075: ChoiceGroupSkin.COLOR_THUMB = SkinResources
076: .getInt(SkinPropertiesIDs.CHOICE_COLOR_THUMB);
077: ChoiceGroupSkin.FONT = SkinResources
078: .getFont(SkinPropertiesIDs.CHOICE_FONT);
079: ChoiceGroupSkin.FONT_FOCUS = SkinResources
080: .getFont(SkinPropertiesIDs.CHOICE_FONT_FOCUS);
081: ChoiceGroupSkin.IMAGE_RADIO = SkinResources.getCompositeImage(
082: SkinPropertiesIDs.CHOICE_IMAGE_RADIO, 2);
083: ChoiceGroupSkin.IMAGE_CHKBOX = SkinResources.getCompositeImage(
084: SkinPropertiesIDs.CHOICE_IMAGE_CHKBX, 2);
085: /*
086: Uncomment if background image is used
087: ChoiceGroupSkin.IMAGE_BG = SkinResources.getCompositeImage(
088: SkinPropertiesIDs.CHOICE_IMAGE_BG, 9);
089: */
090: ChoiceGroupSkin.IMAGE_BUTTON_BG = SkinResources
091: .getCompositeImage(
092: SkinPropertiesIDs.CHOICE_IMAGE_BTN_BG, 9);
093: ChoiceGroupSkin.IMAGE_BUTTON_ICON = SkinResources
094: .getImage(SkinPropertiesIDs.CHOICE_IMAGE_BTN_ICON);
095: ChoiceGroupSkin.IMAGE_POPUP_BG = SkinResources
096: .getCompositeImage(
097: SkinPropertiesIDs.CHOICE_IMAGE_POPUP_BG, 9);
098:
099: init = true;
100: }
101: }
|