OSDN Git Service

auto import from //depot/cupcake/@135843
[android-x86/frameworks-native.git] / awt / com / android / internal / awt / AndroidNativeEventQueue.java
1 /*
2  * Copyright 2007, The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License"); 
5  * you may not use this file except in compliance with the License. 
6  * You may obtain a copy of the License at 
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0 
9  *
10  * Unless required by applicable law or agreed to in writing, software 
11  * distributed under the License is distributed on an "AS IS" BASIS, 
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
13  * See the License for the specific language governing permissions and 
14  * limitations under the License.
15  */
16
17 package com.android.internal.awt;
18
19 import org.apache.harmony.awt.wtk.NativeEventQueue;
20
21 public class AndroidNativeEventQueue extends NativeEventQueue {
22     
23     private Object eventMonitor;
24     
25     public AndroidNativeEventQueue() {
26         super();
27         eventMonitor = getEventMonitor();
28     }
29
30     @Override
31     public void awake() {
32         synchronized (eventMonitor) {
33             eventMonitor.notify();
34         }
35     }
36
37     @Override
38     public void dispatchEvent() {
39         //???AWT
40         System.out.println(getClass()+": empty method called");
41     }
42
43     @Override
44     public long getJavaWindow() {
45         //???AWT
46         System.out.println(getClass()+": empty method called");
47         return 0;
48     }
49
50     @Override
51     public void performLater(Task task) {
52         //???AWT
53         System.out.println(getClass()+": empty method called");
54     }
55
56     @Override
57     public void performTask(Task task) {
58         //???AWT
59         System.out.println(getClass()+": empty method called");
60     }
61
62     @Override
63     public boolean waitEvent() {
64         while (isEmpty() ) {
65             synchronized (eventMonitor) {
66                 try {
67                     eventMonitor.wait(1000);
68                 } catch (InterruptedException ignore) {
69                 }
70             }
71         }
72         return false;
73     }
74
75 }