36
37 public abstract class CGraphicsConfig extends GraphicsConfiguration
38 implements LWGraphicsConfig {
39
40 private final CGraphicsDevice device;
41 private ColorModel colorModel;
42
43 protected CGraphicsConfig(CGraphicsDevice device) {
44 this.device = device;
45 }
46
47 @Override
48 public BufferedImage createCompatibleImage(int width, int height) {
49 throw new UnsupportedOperationException("not implemented");
50 }
51
52 private static native Rectangle2D nativeGetBounds(int screen);
53
54 @Override
55 public Rectangle getBounds() {
56 final Rectangle2D nativeBounds = nativeGetBounds(device.getCoreGraphicsScreen());
57 return nativeBounds.getBounds(); // does integer rounding
58 }
59
60 @Override
61 public ColorModel getColorModel() {
62 if (colorModel == null) {
63 colorModel = getColorModel(Transparency.OPAQUE);
64 }
65 return colorModel;
66 }
67
68 @Override
69 public ColorModel getColorModel(int transparency) {
70 throw new UnsupportedOperationException("not implemented");
71 }
72
73 @Override
74 public AffineTransform getDefaultTransform() {
75 return new AffineTransform();
76 }
|
36
37 public abstract class CGraphicsConfig extends GraphicsConfiguration
38 implements LWGraphicsConfig {
39
40 private final CGraphicsDevice device;
41 private ColorModel colorModel;
42
43 protected CGraphicsConfig(CGraphicsDevice device) {
44 this.device = device;
45 }
46
47 @Override
48 public BufferedImage createCompatibleImage(int width, int height) {
49 throw new UnsupportedOperationException("not implemented");
50 }
51
52 private static native Rectangle2D nativeGetBounds(int screen);
53
54 @Override
55 public Rectangle getBounds() {
56 final Rectangle2D nativeBounds = nativeGetBounds(device.getCGDisplayID());
57 return nativeBounds.getBounds(); // does integer rounding
58 }
59
60 @Override
61 public ColorModel getColorModel() {
62 if (colorModel == null) {
63 colorModel = getColorModel(Transparency.OPAQUE);
64 }
65 return colorModel;
66 }
67
68 @Override
69 public ColorModel getColorModel(int transparency) {
70 throw new UnsupportedOperationException("not implemented");
71 }
72
73 @Override
74 public AffineTransform getDefaultTransform() {
75 return new AffineTransform();
76 }
|