jdk/src/java.desktop/share/classes/sun/awt/image/BufferedImageGraphicsConfig.java
changeset 33254 2ce30cca1503
parent 25859 3317bb8137f4
child 34394 259d6e4e0978
equal deleted inserted replaced
33253:78e735319356 33254:2ce30cca1503
    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 }