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 javax.microedition.lcdui;
028:
029: /**
030: * This class defines colors, fonts, and padding values that
031: * together form consistent Look & Feel.
032: * If it is desired to create a Theme of the existing Look by
033: * changing colors or font this is the class that has to be modified.
034: */
035: class Theme {
036:
037: /** Special content font, shared amongst the LCDUI package */
038: static Font curContentFont = Font.getDefaultFont();
039:
040: /** Special content height, shared amongst the LCDUI package */
041: static int CONTENT_HEIGHT = curContentFont.getHeight();
042:
043: /** this is for no border */
044: final static int BORDER_NONE = 0;
045: /** this is for a solid border */
046: final static int BORDER_SOLID = 1;
047: /** this is for a dotted border */
048: final static int BORDER_DOTTED = 2;
049:
050: /**
051: * A boolean declaring whether the viewport is capable of
052: * scrolling horizontally. FALSE by default
053: */
054: final static boolean SCROLLS_HORIZONTAL = false;
055:
056: /**
057: * A boolean declaring whether the viewport is capable of
058: * scrolling vertically. TRUE by default
059: */
060: final static boolean SCROLLS_VERTICAL = true;
061:
062: /**
063: * The preferred image width for an image as part of an element of
064: * a choice (12 pixels).
065: */
066: static final int PREFERRED_IMG_W = 12;
067:
068: /**
069: * The preferred image height for an image as part of an element of
070: * a choice (12 pixels).
071: */
072: static final int PREFERRED_IMG_H = 12;
073:
074: /**
075: */
076: static int getColor(int colorSpecifier) {
077: switch (colorSpecifier) {
078: case Display.COLOR_BACKGROUND:
079: return 0xffffff;
080: case Display.COLOR_FOREGROUND:
081: return 0;
082: case Display.COLOR_HIGHLIGHTED_BACKGROUND:
083: return 0;
084: case Display.COLOR_HIGHLIGHTED_FOREGROUND:
085: return 0xffffff;
086: case Display.COLOR_BORDER:
087: return 0;
088: case Display.COLOR_HIGHLIGHTED_BORDER:
089: return 0;
090: }
091: return 0;
092: }
093:
094: /**
095: *
096: */
097: static int getBorderStyle(boolean highlighted) {
098: return (highlighted == true ? Graphics.SOLID : Graphics.DOTTED);
099: }
100: }
|