From d83a98f4ce9cfa908f5c54bbd70f03eec07e7553 Mon Sep 17 00:00:00 2001 From: The Android Open Source Project Date: Tue, 3 Mar 2009 18:28:45 -0800 Subject: auto import from //depot/cupcake/@135843 --- core/java/android/view/Display.java | 121 ------------------------------------ 1 file changed, 121 deletions(-) delete mode 100644 core/java/android/view/Display.java (limited to 'core/java/android/view/Display.java') diff --git a/core/java/android/view/Display.java b/core/java/android/view/Display.java deleted file mode 100644 index 09ebeed543e1..000000000000 --- a/core/java/android/view/Display.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (C) 2006 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.view; - -import android.util.DisplayMetrics; - -public class Display -{ - /** - * Specify the default Display - */ - public static final int DEFAULT_DISPLAY = 0; - - - /** - * Use the WindowManager interface to create a Display object. - * Display gives you access to some information about a particular display - * connected to the device. - */ - Display(int display) { - // initalize the statics when this class is first instansiated. This is - // done here instead of in the static block because Zygote - synchronized (mStaticInit) { - if (!mInitialized) { - nativeClassInit(); - mInitialized = true; - } - } - mDisplay = display; - init(display); - } - - /** - * @return index of this display. - */ - public int getDisplayId() { - return mDisplay; - } - - /** - * @return the number of displays connected to the device. - */ - native static int getDisplayCount(); - - /** - * @return width of this display in pixels. - */ - native public int getWidth(); - - /** - * @return height of this display in pixels. - */ - native public int getHeight(); - - /** - * @return orientation of this display. - */ - native public int getOrientation(); - - /** - * @return pixel format of this display. - */ - public int getPixelFormat() { - return mPixelFormat; - } - - /** - * @return refresh rate of this display in frames per second. - */ - public float getRefreshRate() { - return mRefreshRate; - } - - /** - * Initialize a DisplayMetrics object from this display's data. - * - * @param outMetrics - */ - public void getMetrics(DisplayMetrics outMetrics) { - outMetrics.widthPixels = getWidth(); - outMetrics.heightPixels = getHeight(); - outMetrics.density = mDensity; - outMetrics.scaledDensity= outMetrics.density; - outMetrics.xdpi = mDpiX; - outMetrics.ydpi = mDpiY; - } - - /* - * We use a class initializer to allow the native code to cache some - * field offsets. - */ - native private static void nativeClassInit(); - - private native void init(int display); - - private int mDisplay; - // Following fields are initialized from native code - private int mPixelFormat; - private float mRefreshRate; - private float mDensity; - private float mDpiX; - private float mDpiY; - - private static final Object mStaticInit = new Object(); - private static boolean mInitialized = false; -} - -- cgit v1.2.3