home *** CD-ROM | disk | FTP | other *** search
- package java.awt;
-
- import java.awt.image.ColorModel;
- import sun.awt.AppContext;
-
- public abstract class GraphicsDevice {
- private Window fullScreenWindow;
- private AppContext fullScreenAppContext;
- private final Object fsAppContextLock = new Object();
- private Rectangle windowedModeBounds;
- public static final int TYPE_RASTER_SCREEN = 0;
- public static final int TYPE_PRINTER = 1;
- public static final int TYPE_IMAGE_BUFFER = 2;
-
- protected GraphicsDevice() {
- }
-
- public abstract int getType();
-
- public abstract String getIDstring();
-
- public abstract GraphicsConfiguration[] getConfigurations();
-
- public abstract GraphicsConfiguration getDefaultConfiguration();
-
- public GraphicsConfiguration getBestConfiguration(GraphicsConfigTemplate var1) {
- GraphicsConfiguration[] var2 = this.getConfigurations();
- return var1.getBestConfiguration(var2);
- }
-
- public boolean isFullScreenSupported() {
- return false;
- }
-
- public void setFullScreenWindow(Window var1) {
- if (this.fullScreenWindow != null && this.windowedModeBounds != null) {
- this.fullScreenWindow.setBounds(this.windowedModeBounds);
- }
-
- synchronized(this.fsAppContextLock) {
- if (var1 == null) {
- this.fullScreenAppContext = null;
- } else {
- this.fullScreenAppContext = AppContext.getAppContext();
- }
-
- this.fullScreenWindow = var1;
- }
-
- if (this.fullScreenWindow != null) {
- this.windowedModeBounds = this.fullScreenWindow.getBounds();
- Rectangle var2 = this.getDefaultConfiguration().getBounds();
- this.fullScreenWindow.setBounds(var2.x, var2.y, var2.width, var2.height);
- this.fullScreenWindow.setVisible(true);
- this.fullScreenWindow.toFront();
- }
-
- }
-
- public Window getFullScreenWindow() {
- Window var1 = null;
- synchronized(this.fsAppContextLock) {
- if (this.fullScreenAppContext == AppContext.getAppContext()) {
- var1 = this.fullScreenWindow;
- }
-
- return var1;
- }
- }
-
- public boolean isDisplayChangeSupported() {
- return false;
- }
-
- public void setDisplayMode(DisplayMode var1) {
- throw new UnsupportedOperationException("Cannot change display mode");
- }
-
- public DisplayMode getDisplayMode() {
- GraphicsConfiguration var1 = this.getDefaultConfiguration();
- Rectangle var2 = var1.getBounds();
- ColorModel var3 = var1.getColorModel();
- return new DisplayMode(var2.width, var2.height, var3.getPixelSize(), 0);
- }
-
- public DisplayMode[] getDisplayModes() {
- return new DisplayMode[]{this.getDisplayMode()};
- }
-
- public int getAvailableAcceleratedMemory() {
- return -1;
- }
- }
-