jdk/src/java.desktop/share/classes/sun/awt/image/BufferedImageGraphicsConfig.java
equal
deleted
inserted
replaced
65 } |
65 } |
66 |
66 |
67 GraphicsDevice gd; |
67 GraphicsDevice gd; |
68 ColorModel model; |
68 ColorModel model; |
69 Raster raster; |
69 Raster raster; |
70 int width, height; |
|
71 |
70 |
72 public BufferedImageGraphicsConfig(BufferedImage bufImg, Component comp) { |
71 public BufferedImageGraphicsConfig(BufferedImage bufImg, Component comp) { |
73 if (comp == null) { |
72 if (comp == null) { |
74 this.gd = new BufferedImageDevice(this); |
73 this.gd = new BufferedImageDevice(this); |
75 } else { |
74 } else { |
76 Graphics2D g2d = (Graphics2D)comp.getGraphics(); |
75 Graphics2D g2d = (Graphics2D)comp.getGraphics(); |
77 this.gd = g2d.getDeviceConfiguration().getDevice(); |
76 this.gd = g2d.getDeviceConfiguration().getDevice(); |
78 } |
77 } |
79 this.model = bufImg.getColorModel(); |
78 this.model = bufImg.getColorModel(); |
80 this.raster = bufImg.getRaster().createCompatibleWritableRaster(1, 1); |
79 this.raster = bufImg.getRaster().createCompatibleWritableRaster(1, 1); |
81 this.width = bufImg.getWidth(); |
|
82 this.height = bufImg.getHeight(); |
|
83 } |
80 } |
84 |
81 |
85 /** |
82 /** |
86 * Return the graphics device associated with this configuration. |
83 * Return the graphics device associated with this configuration. |
87 */ |
84 */ |
166 public AffineTransform getNormalizingTransform() { |
163 public AffineTransform getNormalizingTransform() { |
167 return new AffineTransform(); |
164 return new AffineTransform(); |
168 } |
165 } |
169 |
166 |
170 public Rectangle getBounds() { |
167 public Rectangle getBounds() { |
171 return new Rectangle(0, 0, width, height); |
168 return new Rectangle(0, 0, Integer.MAX_VALUE, Integer.MAX_VALUE); |
172 } |
169 } |
173 } |
170 } |