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 is a factory class for the look & feel classes.
031: */
032: class LFFactoryImpl extends LFFactory {
033:
034: // *** Displayable look & feels *****
035:
036: /**
037: * Returns an <code>Alert</code> look & feel implementation.
038: *
039: * @param a The <code>Alert</code> associated with this look&feel
040: *
041: * @return an <code>Alert</code> look & feel implementation
042: */
043: AlertLF getAlertLF(Alert a) {
044: return new AlertLFImpl(a);
045: }
046:
047: /**
048: * Returns a <code>Canvas</code> look & feel implementation.
049: *
050: * @param c The <code>Canvas</code> associated with this look&feel
051: *
052: * @return a <code>Canvas</code> look & feel implementation
053: */
054: CanvasLF getCanvasLF(Canvas c) {
055: return new CanvasLFImpl(c);
056: }
057:
058: /**
059: * Returns a <code>Form</code> look & feel implementation.
060: *
061: * @param f The <code>Form</code> associated with this look&feel
062: *
063: * @return a <code>Form</code> look & feel implementation
064: */
065: FormLF getFormLF(Form f) {
066: return new FormLFImpl(f, f.items, f.numOfItems);
067: }
068:
069: /**
070: * Returns a <code>List</code> look & feel implementation.
071: *
072: * @param list The <code>List</code> associated with this look&feel
073: *
074: * @return a <code>List</code> look & feel implementation
075: */
076: FormLF getListLF(List list) {
077: return new FormLFImpl(list, list.cg);
078: }
079:
080: /**
081: * Returns a <code>TextBox</code> look & feel implementation.
082: *
083: * @param tb The <code>TextBox</code> associated with this look&feel
084: *
085: * @return a <code>TextBox</code> look & feel implementation
086: */
087: FormLF getTextBoxFormLF(TextBox tb) {
088: return new FormLFImpl(tb, tb.textField);
089: }
090:
091: // ** Item look & feels ******** */
092:
093: /**
094: * Returns a <code>ChoiceGroup</code> look & feel implementation.
095: *
096: * @param cg The <code>ChoiceGroup</code> associated with this
097: * look&feel
098: *
099: * @return a <code>ChoiceGroup</code> look & feel implementation
100: */
101: ChoiceGroupLF getChoiceGroupLF(ChoiceGroup cg) {
102: return new ChoiceGroupLFImpl(cg);
103: }
104:
105: /**
106: * Returns a <code>CustomItem</code> look & feel implementation.
107: *
108: * @param ci The <code>CustomItem</code> associated with this
109: * look&feel
110: *
111: * @return a <code>CustomItem</code> look & feel implementation
112: */
113: CustomItemLF getCustomItemLF(CustomItem ci) {
114: return new CustomItemLFImpl(ci);
115:
116: }
117:
118: /**
119: * Returns a <code>DateField</code> look & feel implementation.
120: *
121: * @param df The <code>DateField</code> associated with this look&feel
122: *
123: * @return a <code>DateField</code> look & feel implementation
124: */
125: DateFieldLF getDateFieldLF(DateField df) {
126: return new DateFieldLFImpl(df);
127: }
128:
129: /**
130: * Returns a <code>Gauge</code> look & feel implementation.
131: *
132: * @param g The <code>Gauge</code> associated with this look&feel
133: *
134: * @return a <code>Gauge</code> look & feel implementation
135: */
136: GaugeLF getGaugeLF(Gauge g) {
137: return new GaugeLFImpl(g);
138: }
139:
140: /**
141: * Returns an <code>ImageItem</code> look & feel implementation.
142: *
143: * @param imgItem The <code>Alert</code> associated with this look&feel
144: *
145: * @return an <code>ImageItem</code> look & feel implementation
146: */
147: ImageItemLF getImageItemLF(ImageItem imgItem) {
148: return new ImageItemLFImpl(imgItem);
149: }
150:
151: /**
152: * Returns a <code>StringItem</code> look & feel implementation.
153: *
154: * @param strItem The <code>StringItem</code> associated with this
155: * look&feel
156: *
157: * @return a <code>StringItem</code> look & feel implementation
158: */
159: StringItemLF getStringItemLF(StringItem strItem) {
160: return new StringItemLFImpl(strItem);
161: }
162:
163: /**
164: * Returns a <code>Spacer</code> look & feel implementation.
165: *
166: * @param spacer The <code>Spacer</code> associated with this look&feel
167: *
168: * @return a <code>Spacer</code> look & feel implementation
169: */
170: SpacerLF getSpacerLF(Spacer spacer) {
171: return new SpacerLFImpl(spacer);
172: }
173:
174: /**
175: * Returns a <code>TextField</code> look & feel implementation.
176: *
177: * @param tf The <code>TextField</code> associated with this look&feel
178: *
179: * @return a <code>TextField</code> look & feel implementation
180: */
181: TextFieldLF getTextFieldLF(TextField tf) {
182: return new TextFieldLFImpl(tf);
183: }
184:
185: /**
186: * Returns a TextField look & feel implementation
187: * for use in a TextBox screen.
188: *
189: * @param tf - <placeholder>
190: * @return a TextField look & feel implementation
191: */
192: TextFieldLF getTextBoxLF(TextField tf) {
193: return new TextFieldLFImpl(tf);
194: }
195:
196: /**
197: * Returns a <code>Ticker</code> look & feel implementation.
198: *
199: * @param ticker The <code>Ticker</code> associated with this look&feel
200: *
201: * @return a <code>Ticker</code> look & feel implementation.
202: */
203: TickerLF getTickerLF(Ticker ticker) {
204: return new TickerLFImpl(ticker);
205: }
206: }
|