View Javadoc

1   /*
2    *  MicroEmulator
3    *  Copyright (C) 2002-2006 Bartek Teodorczyk <barteo@barteo.net>
4    *
5    *  It is licensed under the following two licenses as alternatives:
6    *    1. GNU Lesser General Public License (the "LGPL") version 2.1 or any newer version
7    *    2. Apache License (the "AL") Version 2.0
8    *
9    *  You may not use this file except in compliance with at least one of
10   *  the above two licenses.
11   *
12   *  You may obtain a copy of the LGPL at
13   *      http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
14   *
15   *  You may obtain a copy of the AL at
16   *      http://www.apache.org/licenses/LICENSE-2.0
17   *
18   *  Unless required by applicable law or agreed to in writing, software
19   *  distributed under the License is distributed on an "AS IS" BASIS,
20   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21   *  See the LGPL or the AL for the specific language governing permissions and
22   *  limitations.
23   */
24  
25  package com.barteo.emulator;
26  
27  import java.io.InputStream;
28  
29  import org.microemu.DisplayComponent;
30  import org.microemu.MIDletBridge;
31  import org.microemu.app.ui.Message;
32  import org.microemu.device.DeviceDisplay;
33  import org.microemu.device.FontManager;
34  import org.microemu.device.InputMethod;
35  
36  /*
37   * @deprecated use org.microemu.EmulatorContext
38   */
39  public class EmulatorContext implements org.microemu.EmulatorContext {
40  
41  	private org.microemu.EmulatorContext context;
42  
43  	public EmulatorContext(org.microemu.EmulatorContext context) {
44  		this.context = context;
45  	}
46  
47  	public DeviceDisplay getDeviceDisplay() {
48  		return context.getDeviceDisplay();
49  	}
50  
51  	public FontManager getDeviceFontManager() {
52  		return context.getDeviceFontManager();
53  	}
54  
55  	public InputMethod getDeviceInputMethod() {
56  		return context.getDeviceInputMethod();
57  	}
58  
59  	public DisplayComponent getDisplayComponent() {
60  		return context.getDisplayComponent();
61  	}
62  
63  	public InputStream getResourceAsStream(String name) {
64  		return MIDletBridge.getCurrentMIDlet().getClass().getResourceAsStream(name);
65  	}
66  
67  	public boolean platformRequest(final String URL) {
68  		new Thread(new Runnable() {
69  			public void run() {
70  				Message.info("MIDlet requests that the device handle the following URL: " + URL);
71  			}
72  		}).start();
73  
74  		return false;
75  	}
76  }