home *** CD-ROM | disk | FTP | other *** search
- package sun.awt;
-
- import java.awt.GraphicsConfiguration;
- import java.awt.GraphicsDevice;
- import java.awt.Rectangle;
- import java.awt.geom.AffineTransform;
- import java.awt.image.BufferedImage;
- import java.awt.image.ColorModel;
- import java.awt.image.DirectColorModel;
- import java.awt.image.WritableRaster;
- import java.util.Hashtable;
-
- public class Win32GraphicsConfig extends GraphicsConfiguration {
- Win32GraphicsDevice screen;
- int visual;
- ColorModel colorModel;
-
- private static native void initIDs();
-
- public static Win32GraphicsConfig getConfig(Win32GraphicsDevice var0, int var1) {
- return new Win32GraphicsConfig(var0, var1);
- }
-
- public Win32GraphicsConfig(GraphicsDevice var1, int var2) {
- this.screen = (Win32GraphicsDevice)var1;
- this.visual = var2;
- }
-
- public GraphicsDevice getDevice() {
- return this.screen;
- }
-
- public int getVisual() {
- return this.visual;
- }
-
- public BufferedImage createCompatibleImage(int var1, int var2) {
- ColorModel var3 = this.getColorModel();
- WritableRaster var4 = var3.createCompatibleWritableRaster(var1, var2);
- return new BufferedImage(var3, var4, var3.isAlphaPremultiplied(), (Hashtable)null);
- }
-
- public BufferedImage createCompatibleImage(int var1, int var2, int var3) {
- switch (var3) {
- case 1:
- return this.createCompatibleImage(var1, var2);
- case 2:
- case 3:
- ColorModel var4 = this.getColorModel(var3);
- WritableRaster var5 = var4.createCompatibleWritableRaster(var1, var2);
- return new BufferedImage(var4, var5, var4.isAlphaPremultiplied(), (Hashtable)null);
- default:
- throw new IllegalArgumentException("Unknown transparency type " + var3);
- }
- }
-
- public synchronized ColorModel getColorModel() {
- if (this.colorModel == null) {
- this.colorModel = this.makeColorModel(this.screen.getScreen());
- }
-
- return this.colorModel;
- }
-
- private native ColorModel makeColorModel(int var1);
-
- public ColorModel getColorModel(int var1) {
- if (var1 == 1) {
- return this.getColorModel();
- } else if (var1 == 2) {
- return new DirectColorModel(25, 16711680, 65280, 255, 16777216);
- } else {
- return var1 == 3 ? ColorModel.getRGBdefault() : null;
- }
- }
-
- public AffineTransform getDefaultTransform() {
- return new AffineTransform();
- }
-
- public AffineTransform getNormalizingTransform() {
- double var1 = this.getXResolution() / (double)72.0F;
- double var3 = this.getYResolution() / (double)72.0F;
- return new AffineTransform(var1, (double)0.0F, (double)0.0F, var3, (double)0.0F, (double)0.0F);
- }
-
- private double getXResolution() {
- return (double)72.0F;
- }
-
- private double getYResolution() {
- return (double)72.0F;
- }
-
- public String toString() {
- return "Win32GraphicsConfig[dev=" + this.screen + ",pixfmt=" + this.visual + "]";
- }
-
- private native Rectangle getBounds(int var1);
-
- public Rectangle getBounds() {
- return this.getBounds(this.screen.getScreen());
- }
-
- static {
- initIDs();
- }
- }
-