home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &… the Search for Life CD 3 / 0_CD-ROM.iso / install / jre1_3 / lib / rt.jar / sun / awt / image / BufferedImageGraphics2D.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  20.9 KB  |  1,093 lines

  1. package sun.awt.image;
  2.  
  3. import java.awt.BasicStroke;
  4. import java.awt.Color;
  5. import java.awt.Component;
  6. import java.awt.Font;
  7. import java.awt.FontMetrics;
  8. import java.awt.GraphicsConfiguration;
  9. import java.awt.Image;
  10. import java.awt.Paint;
  11. import java.awt.Rectangle;
  12. import java.awt.Shape;
  13. import java.awt.font.FontRenderContext;
  14. import java.awt.font.GlyphVector;
  15. import java.awt.geom.AffineTransform;
  16. import java.awt.geom.Arc2D;
  17. import java.awt.geom.Ellipse2D;
  18. import java.awt.geom.PathIterator;
  19. import java.awt.geom.RoundRectangle2D;
  20. import java.awt.image.BufferedImage;
  21. import java.awt.image.ColorModel;
  22. import java.awt.image.ImageObserver;
  23. import java.awt.image.IndexColorModel;
  24. import java.awt.image.WritableRaster;
  25. import sun.awt.font.NativeFontWrapper;
  26. import sun.dc.path.PathConsumer;
  27. import sun.dc.path.PathException;
  28. import sun.java2d.OutputManager;
  29. import sun.java2d.SunGraphics2D;
  30. import sun.java2d.loops.DrawBytes;
  31. import sun.java2d.loops.DrawBytesRasterContext;
  32. import sun.java2d.loops.DrawChars;
  33. import sun.java2d.loops.DrawCharsRasterContext;
  34. import sun.java2d.loops.DrawGlyphVector;
  35. import sun.java2d.loops.DrawGlyphVectorRasterContext;
  36. import sun.java2d.loops.DrawLine;
  37. import sun.java2d.loops.DrawLineRasterContext;
  38. import sun.java2d.loops.DrawPolygons;
  39. import sun.java2d.loops.DrawPolygonsRasterContext;
  40. import sun.java2d.loops.DrawRect;
  41. import sun.java2d.loops.DrawRectRasterContext;
  42. import sun.java2d.loops.DrawString;
  43. import sun.java2d.loops.DrawStringRasterContext;
  44. import sun.java2d.loops.FillPolygons;
  45. import sun.java2d.loops.FillPolygonsRasterContext;
  46. import sun.java2d.loops.FillRect;
  47. import sun.java2d.loops.FillRectRasterContext;
  48. import sun.java2d.loops.FillSpans;
  49. import sun.java2d.loops.GraphicsPrimitive;
  50. import sun.java2d.loops.GraphicsPrimitiveMgr;
  51. import sun.java2d.loops.ImageData;
  52. import sun.java2d.loops.LockableRaster;
  53. import sun.java2d.loops.RasterLockingException;
  54. import sun.java2d.loops.RasterOutputManager;
  55. import sun.java2d.pipe.DuctusRenderer;
  56. import sun.java2d.pipe.PixelDrawPipe;
  57. import sun.java2d.pipe.PixelFillPipe;
  58. import sun.java2d.pipe.ShapeDrawPipe;
  59. import sun.java2d.pipe.ShapeSpanIterator;
  60. import sun.java2d.pipe.SimpleRenderPipe;
  61. import sun.java2d.pipe.SpanIterator;
  62. import sun.java2d.pipe.TextPipe;
  63. import sun.java2d.pipe.TranslateablePipe;
  64.  
  65. public class BufferedImageGraphics2D extends SunGraphics2D implements SimpleRenderPipe, PixelDrawPipe, PixelFillPipe, ShapeDrawPipe, TranslateablePipe, TextPipe {
  66.    public BufferedImage bufImg;
  67.    Component component;
  68.    WritableRaster raster;
  69.    private ImageData cachedID;
  70.    private int primtype;
  71.    Object drawLineState;
  72.    DrawLineRasterContext dlrc;
  73.    Object fillRectState;
  74.    FillRectRasterContext frrc;
  75.    FillSpanCachedState fillSpanState;
  76.    Object drawRectState;
  77.    DrawRectRasterContext drrc;
  78.    Object drawPolysState;
  79.    Object drawPolygonState;
  80.    Object drawPolylineState;
  81.    DrawPolygonsRasterContext dprc;
  82.    Object fillPolysState;
  83.    Object fillPolygonState;
  84.    FillPolygonsRasterContext fprc;
  85.    Object drawStringState;
  86.    DrawStringRasterContext dsrc;
  87.    Object drawGlyphVectorState;
  88.    DrawGlyphVectorRasterContext gvrc;
  89.    Object drawCharsState;
  90.    DrawCharsRasterContext dcrc;
  91.    Object drawBytesState;
  92.    DrawBytesRasterContext dbrc;
  93.    Font lastGlyphVectorFont;
  94.    FillRectRasterContext crrc;
  95.    private int clipX;
  96.    private int clipY;
  97.    private int clipW;
  98.    private int clipH;
  99.    private int xOrigin;
  100.    private int yOrigin;
  101.    private Font cachedFont;
  102.    private AffineTransform cachedTextTransform;
  103.    private boolean textIsAntiAliased;
  104.    private boolean textUsesFractionalMetrics;
  105.    private boolean useFastTextClip;
  106.    private float fastClipMinY;
  107.    private float fastClipMaxY;
  108.    private int cachedFontRotate;
  109.    private int lastGlyphVectorFontRotate;
  110.    private static final int slowTextTransformMask = 120;
  111.  
  112.    public BufferedImageGraphics2D(BufferedImage var1, Component var2) {
  113.       this.bufImg = var1;
  114.       this.raster = var1.getRaster();
  115.       this.component = var2;
  116.       ((SunGraphics2D)this).setDevClip(0, 0, var1.getWidth(), var1.getHeight());
  117.       if (this.component != null) {
  118.          ((SunGraphics2D)this).setColor(this.component.getForeground());
  119.          this.setBackground(this.component.getBackground());
  120.          this.setFont(this.component.getFont());
  121.       } else {
  122.          ((SunGraphics2D)this).setColor(Color.white);
  123.          this.setBackground(Color.black);
  124.          this.setFont(new Font("Dialog", 0, 12));
  125.       }
  126.  
  127.       this.primtype = var1.getType();
  128.       if (this.primtype == 13 && var1.getColorModel() instanceof IndexColorModel) {
  129.          IndexColorModel var5 = (IndexColorModel)var1.getColorModel();
  130.          if (ImageData.isAllOpaqueGrayICM(var5) && ((ColorModel)var5).getPixelSize() == 8) {
  131.             this.primtype = -17;
  132.          }
  133.       } else if (this.primtype == 0 && var1.getColorModel() instanceof IndexColorModel && this.raster.getNumBands() == 1 && this.raster instanceof ShortComponentRaster) {
  134.          IndexColorModel var3 = (IndexColorModel)var1.getColorModel();
  135.          ShortComponentRaster var4 = (ShortComponentRaster)this.raster;
  136.          if (var4.getPixelStride() == 1 && ((ColorModel)var3).getPixelSize() == 12 && ImageData.isAllOpaqueGrayICM(var3)) {
  137.             this.primtype = -18;
  138.          }
  139.       }
  140.  
  141.       this.invalidateCachedState();
  142.    }
  143.  
  144.    protected void invalidatePipe() {
  145.       super.invalidatePipe();
  146.       this.invalidateCachedState();
  147.    }
  148.  
  149.    private void invalidateFontState() {
  150.       this.drawStringState = null;
  151.       this.dsrc = null;
  152.       this.drawGlyphVectorState = null;
  153.       this.gvrc = null;
  154.       this.drawCharsState = null;
  155.       this.dcrc = null;
  156.       this.drawBytesState = null;
  157.       this.dbrc = null;
  158.       this.lastGlyphVectorFont = null;
  159.       this.cachedFont = null;
  160.       this.useFastTextClip = false;
  161.    }
  162.  
  163.    private void invalidateCachedState() {
  164.       this.drawLineState = null;
  165.       this.dlrc = null;
  166.       this.fillRectState = null;
  167.       this.frrc = null;
  168.       this.fillSpanState = null;
  169.       this.drawRectState = null;
  170.       this.drrc = null;
  171.       this.drawPolysState = null;
  172.       this.drawPolygonState = null;
  173.       this.drawPolylineState = null;
  174.       this.dprc = null;
  175.       this.fillPolysState = null;
  176.       this.fillPolygonState = null;
  177.       this.fprc = null;
  178.       this.crrc = null;
  179.       Rectangle var1 = ((SunGraphics2D)this).getCompBounds();
  180.       if (var1 != null) {
  181.          this.clipX = var1.x;
  182.          this.clipY = var1.y;
  183.          this.clipW = var1.width;
  184.          this.clipH = var1.height;
  185.       } else if (super.devClip != null) {
  186.          this.clipX = super.devClip.x;
  187.          this.clipY = super.devClip.y;
  188.          this.clipW = super.devClip.width;
  189.          this.clipH = super.devClip.height;
  190.       }
  191.  
  192.       this.cachedID = null;
  193.       this.invalidateFontState();
  194.    }
  195.  
  196.    private void computeFontOptimizations(Font var1) {
  197.       if (this.cachedFont != var1) {
  198.          this.cachedFont = var1;
  199.          float var2 = var1.getSize2D();
  200.          FontRenderContext var3 = ((SunGraphics2D)this).getFontRenderContext();
  201.          this.cachedTextTransform = var3.getTransform();
  202.          this.cachedTextTransform.scale((double)var2, (double)var2);
  203.          this.cachedTextTransform.preConcatenate(var1.getTransform());
  204.          int var4 = this.cachedTextTransform.getType();
  205.          this.cachedTextTransform.preConcatenate(super.transform);
  206.          this.cachedFontRotate = -1;
  207.          this.textIsAntiAliased = var3.isAntiAliased();
  208.          this.textUsesFractionalMetrics = var3.usesFractionalMetrics();
  209.          this.useFastTextClip = false;
  210.          if (0 == (var4 & 120)) {
  211.             FontMetrics var5 = ((SunGraphics2D)this).getFontMetrics(var1);
  212.             int var6 = var5.getHeight();
  213.             Rectangle var7 = ((SunGraphics2D)this).getClipBounds();
  214.             if (var7 != null) {
  215.                this.fastClipMinY = (float)(var7.y - var6);
  216.                this.fastClipMaxY = (float)(var7.y + var7.height + var6);
  217.             } else {
  218.                this.fastClipMinY = (float)(super.devClip.y - this.yOrigin - var6);
  219.                this.fastClipMaxY = (float)(super.devClip.y - this.yOrigin + super.devClip.height + var6);
  220.             }
  221.  
  222.             this.useFastTextClip = true;
  223.          }
  224.       }
  225.  
  226.    }
  227.  
  228.    private boolean isRotated(AffineTransform var1, double[] var2) {
  229.       var1.getMatrix(var2);
  230.       return var2[0] != var2[3] || var2[1] != (double)0.0F || var2[2] != (double)0.0F || !(var2[0] > (double)0.0F);
  231.    }
  232.  
  233.    public void setOrigin(int var1, int var2) {
  234.       this.xOrigin = var1;
  235.       this.yOrigin = var2;
  236.    }
  237.  
  238.    public void setFont(Font var1) {
  239.       if (this.cachedFont != var1) {
  240.          super.setFont(var1);
  241.          this.invalidateFontState();
  242.       }
  243.  
  244.    }
  245.  
  246.    public ColorModel getDeviceColorModel() {
  247.       return this.bufImg.getColorModel();
  248.    }
  249.  
  250.    public GraphicsConfiguration getDeviceConfiguration() {
  251.       if (this.component != null) {
  252.          GraphicsConfiguration var1 = this.component.getGraphicsConfiguration();
  253.          if (var1 != null) {
  254.             return var1;
  255.          }
  256.       }
  257.  
  258.       return BufferedImageGraphicsConfig.getConfig(this.bufImg);
  259.    }
  260.  
  261.    public OutputManager getOutputManager() {
  262.       return BufferedImageGraphicsConfig.getOutputManager(this.bufImg);
  263.    }
  264.  
  265.    public void dispose() {
  266.    }
  267.  
  268.    public void finalize() {
  269.    }
  270.  
  271.    public boolean drawImage(Image var1, int var2, int var3, int var4, int var5, ImageObserver var6) {
  272.       if (var4 != 0 && var5 != 0) {
  273.          if (var1 instanceof BufferedImage) {
  274.             BufferedImage var9 = (BufferedImage)var1;
  275.             super.drawImage(var9, var2, var3, var4, var5, (Color)null, var6);
  276.             return true;
  277.          } else {
  278.             sun.awt.image.Image var7 = (sun.awt.image.Image)var1;
  279.             if (var7.hasError()) {
  280.                if (var6 != null) {
  281.                   var6.imageUpdate(var1, 192, -1, -1, -1, -1);
  282.                }
  283.  
  284.                return false;
  285.             } else {
  286.                ImageRepresentation var8 = var7.getImageRep();
  287.                return var8.drawToBufImage(this, var7, var2, var3, var4, var5, (Color)null, var6);
  288.             }
  289.          }
  290.       } else {
  291.          return true;
  292.       }
  293.    }
  294.  
  295.    public boolean drawImage(Image var1, int var2, int var3, Color var4, ImageObserver var5) {
  296.       if (var1 instanceof BufferedImage) {
  297.          super.drawImage((BufferedImage)var1, var2, var3, var4, var5);
  298.          return true;
  299.       } else {
  300.          sun.awt.image.Image var6 = (sun.awt.image.Image)var1;
  301.          if (var6.hasError()) {
  302.             if (var5 != null) {
  303.                var5.imageUpdate(var1, 192, -1, -1, -1, -1);
  304.             }
  305.  
  306.             return false;
  307.          } else {
  308.             ImageRepresentation var7 = var6.getImageRep();
  309.             return var7.drawToBufImage(this, var6, var2, var3, var4, var5);
  310.          }
  311.       }
  312.    }
  313.  
  314.    public boolean drawImage(Image var1, int var2, int var3, int var4, int var5, Color var6, ImageObserver var7) {
  315.       if (var4 != 0 && var5 != 0) {
  316.          if (var1 instanceof BufferedImage) {
  317.             super.drawImage((BufferedImage)var1, var2, var3, var4, var5, var6, var7);
  318.             return true;
  319.          } else {
  320.             sun.awt.image.Image var8 = (sun.awt.image.Image)var1;
  321.             if (var8.hasError()) {
  322.                if (var7 != null) {
  323.                   var7.imageUpdate(var1, 192, -1, -1, -1, -1);
  324.                }
  325.  
  326.                return false;
  327.             } else {
  328.                ImageRepresentation var9 = var8.getImageRep();
  329.                return var9.drawToBufImage(this, var8, var2, var3, var4, var5, var6, var7);
  330.             }
  331.          }
  332.       } else {
  333.          return true;
  334.       }
  335.    }
  336.  
  337.    public boolean drawImage(Image var1, int var2, int var3, int var4, int var5, int var6, int var7, int var8, int var9, ImageObserver var10) {
  338.       return this.drawImage(var1, var2, var3, var4, var5, var6, var7, var8, var9, (Color)null, var10);
  339.    }
  340.  
  341.    public boolean drawImage(Image var1, int var2, int var3, int var4, int var5, int var6, int var7, int var8, int var9, Color var10, ImageObserver var11) {
  342.       if (var2 != var4 && var3 != var5) {
  343.          if (var6 != var8 && var7 != var9) {
  344.             if (var1 instanceof BufferedImage) {
  345.                super.drawImage((BufferedImage)var1, var2, var3, var4, var5, var6, var7, var8, var9, var10, var11);
  346.                return true;
  347.             } else {
  348.                sun.awt.image.Image var12 = (sun.awt.image.Image)var1;
  349.                if (var12.hasError()) {
  350.                   if (var11 != null) {
  351.                      var11.imageUpdate(var1, 192, -1, -1, -1, -1);
  352.                   }
  353.  
  354.                   return false;
  355.                } else {
  356.                   ImageRepresentation var13 = var12.getImageRep();
  357.                   return var13.drawToBufImage(this, var12, var2, var3, var4, var5, var6, var7, var8, var9, var10, var11);
  358.                }
  359.             }
  360.          } else {
  361.             return true;
  362.          }
  363.       } else {
  364.          return true;
  365.       }
  366.    }
  367.  
  368.    public boolean drawImage(Image var1, AffineTransform var2, ImageObserver var3) {
  369.       if (var1 instanceof BufferedImage) {
  370.          super.drawImage((BufferedImage)var1, var2, 0, 0, (Color)null, var3);
  371.          return true;
  372.       } else {
  373.          sun.awt.image.Image var4 = (sun.awt.image.Image)var1;
  374.          if (var4.hasError()) {
  375.             if (var3 != null) {
  376.                var3.imageUpdate(var1, 192, -1, -1, -1, -1);
  377.             }
  378.  
  379.             return false;
  380.          } else {
  381.             ImageRepresentation var5 = var4.getImageRep();
  382.             return var5.drawToBufImage(this, var4, var2, var3);
  383.          }
  384.       }
  385.    }
  386.  
  387.    public boolean drawImage(Image var1, int var2, int var3, ImageObserver var4) {
  388.       if (var1 instanceof BufferedImage) {
  389.          return super.drawImage((BufferedImage)var1, var2, var3, (Color)null, var4);
  390.       } else {
  391.          sun.awt.image.Image var5 = (sun.awt.image.Image)var1;
  392.          if (var5.hasError()) {
  393.             if (var4 != null) {
  394.                var4.imageUpdate(var1, 192, -1, -1, -1, -1);
  395.             }
  396.  
  397.             return false;
  398.          } else {
  399.             ImageRepresentation var6 = var5.getImageRep();
  400.             return var6.drawToBufImage(this, var5, var2, var3, (Color)null, var4);
  401.          }
  402.       }
  403.    }
  404.  
  405.    protected void checkCustomComposite() {
  406.    }
  407.  
  408.    public void setPaint(Paint var1) {
  409.       super.setPaint(var1);
  410.       this.invalidateCachedState();
  411.    }
  412.  
  413.    public void setBackground(Color var1) {
  414.       if (super.backgroundColor != var1) {
  415.          this.crrc = null;
  416.          super.setBackground(var1);
  417.       }
  418.  
  419.    }
  420.  
  421.    public void setClip(int var1, int var2, int var3, int var4) {
  422.       super.setClip(var1, var2, var3, var4);
  423.       this.invalidateCachedState();
  424.    }
  425.  
  426.    public void setClip(Shape var1) {
  427.       super.setClip(var1);
  428.       this.invalidateCachedState();
  429.    }
  430.  
  431.    public void clipRect(int var1, int var2, int var3, int var4) {
  432.       super.clipRect(var1, var2, var3, var4);
  433.       this.invalidateCachedState();
  434.    }
  435.  
  436.    public void clip(Shape var1) {
  437.       super.clip(var1);
  438.       this.invalidateCachedState();
  439.    }
  440.  
  441.    public void drawLine(SunGraphics2D var1, int var2, int var3, int var4, int var5) {
  442.       var2 += this.xOrigin;
  443.       var3 += this.yOrigin;
  444.       var4 += this.xOrigin;
  445.       var5 += this.yOrigin;
  446.       if (this.dlrc == null) {
  447.          LockableRaster var6 = new LockableRaster(var1);
  448.          int[] var7 = new int[]{var6.type};
  449.          GraphicsPrimitive var8 = GraphicsPrimitiveMgr.locate(DrawLine.getMethodSignature(), var7, var6.devID);
  450.          if (var8 != null) {
  451.             DrawLine var9 = (DrawLine)var8;
  452.             this.dlrc = var9.createCachedContext(this.raster, this.bufImg.getColorModel(), ((SunGraphics2D)this).getColor(), this.clipX, this.clipY, this.clipW, this.clipH);
  453.          }
  454.       }
  455.  
  456.       if (this.dlrc != null) {
  457.          this.dlrc.invoke(var2, var3, var4, var5);
  458.       } else {
  459.          this.drawLineState = RasterOutputManager.getManager().drawLine(var1, var2, var3, var4, var5, this.drawLineState);
  460.       }
  461.  
  462.    }
  463.  
  464.    public void fillRect(SunGraphics2D var1, int var2, int var3, int var4, int var5) {
  465.       var2 += this.xOrigin;
  466.       var3 += this.yOrigin;
  467.       if (this.frrc == null) {
  468.          LockableRaster var6 = new LockableRaster(var1);
  469.          int[] var7 = new int[]{var6.type};
  470.          GraphicsPrimitive var8 = GraphicsPrimitiveMgr.locate(FillRect.getMethodSignature(), var7, var6.devID);
  471.          if (var8 != null) {
  472.             FillRect var9 = (FillRect)var8;
  473.             this.frrc = var9.createCachedContext(this.raster, this.bufImg.getColorModel(), ((SunGraphics2D)this).getColor(), this.clipX, this.clipY, this.clipW, this.clipH);
  474.          }
  475.       }
  476.  
  477.       if (this.frrc != null) {
  478.          this.frrc.invoke(var2, var3, var4, var5);
  479.       } else {
  480.          this.fillRectState = RasterOutputManager.getManager().fillRect(var1, var2, var3, var4, var5, this.fillRectState);
  481.       }
  482.  
  483.    }
  484.  
  485.    public void draw(SunGraphics2D var1, Shape var2) {
  486.       ShapeSpanIterator var3 = new ShapeSpanIterator();
  487.  
  488.       try {
  489.          var3.setOutputArea(var1.getCompBounds());
  490.          var3.setRule(1);
  491.          BasicStroke var4 = (BasicStroke)var1.stroke;
  492.          AffineTransform var5 = var1.transformState == 2 ? var1.transform : null;
  493.          PathConsumer var6 = DuctusRenderer.createStroker(var3, var4, var5);
  494.          var5 = var1.transformState == 0 ? null : var1.transform;
  495.          PathIterator var7 = var2.getPathIterator(var5);
  496.  
  497.          try {
  498.             boolean var8 = var1.strokeHint != 2;
  499.             DuctusRenderer.feedConsumer(var7, var6, var8, 0.25F);
  500.          } catch (PathException var13) {
  501.             throw new InternalError("Unable to Stroke shape (" + ((Throwable)var13).getMessage() + ")");
  502.          }
  503.  
  504.          this.fillSpans(var1, var3);
  505.       } finally {
  506.          var3.dispose();
  507.       }
  508.  
  509.    }
  510.  
  511.    public void fill(SunGraphics2D var1, Shape var2) {
  512.       ShapeSpanIterator var3 = new ShapeSpanIterator();
  513.  
  514.       try {
  515.          var3.setOutputArea(var1.getCompBounds());
  516.          AffineTransform var4 = var1.transformState == 0 ? null : var1.transform;
  517.          var3.appendPath(var2.getPathIterator(var4));
  518.          this.fillSpans(var1, var3);
  519.       } finally {
  520.          var3.dispose();
  521.       }
  522.  
  523.    }
  524.  
  525.    public void fillSpans(SunGraphics2D var1, SpanIterator var2) {
  526.       FillSpans var3 = null;
  527.       Object var4 = null;
  528.       LockableRaster var14;
  529.       if (this.fillSpanState != null) {
  530.          var3 = this.fillSpanState.fillSpanObj;
  531.          var14 = this.fillSpanState.lrDst;
  532.       } else {
  533.          var14 = new LockableRaster(var1);
  534.          int[] var5 = new int[]{var14.type};
  535.          GraphicsPrimitive var6 = GraphicsPrimitiveMgr.locate(FillSpans.getMethodSignature(), var5, var14.devID);
  536.          if (var6 != null) {
  537.             this.fillSpanState = new FillSpanCachedState((1)null);
  538.             this.fillSpanState.fillSpanObj = var3 = (FillSpans)var6;
  539.             this.fillSpanState.lrDst = var14;
  540.          } else if (this.frrc == null) {
  541.             var6 = GraphicsPrimitiveMgr.locate(FillRect.getMethodSignature(), var5, var14.devID);
  542.             if (var6 != null) {
  543.                FillRect var7 = (FillRect)var6;
  544.                this.frrc = var7.createCachedContext(this.raster, this.bufImg.getColorModel(), ((SunGraphics2D)this).getColor(), this.clipX, this.clipY, this.clipW, this.clipH);
  545.             }
  546.          }
  547.       }
  548.  
  549.       int[] var15 = new int[4];
  550.       if (var3 != null) {
  551.          var2.getPathBox(var15);
  552.  
  553.          try {
  554.             var14.lock(((GraphicsPrimitive)var3).getLockFlags()[0], var15[0], var15[1], var15[2] - var15[0], var15[3] - var15[1]);
  555.             var3.FillSpans(var14.id, var1.getColor(), var2);
  556.          } catch (RasterLockingException var12) {
  557.          } finally {
  558.             var14.unlock();
  559.          }
  560.  
  561.       } else {
  562.          RasterOutputManager var17 = RasterOutputManager.getManager();
  563.  
  564.          while(var2.nextSpan(var15)) {
  565.             if (this.frrc != null) {
  566.                this.frrc.invoke(var15[0], var15[1], var15[2] - var15[0], var15[3] - var15[1]);
  567.             } else {
  568.                this.fillRectState = var17.fillRect(var1, var15[0], var15[1], var15[2] - var15[0], var15[3] - var15[1], this.fillRectState);
  569.             }
  570.          }
  571.  
  572.       }
  573.    }
  574.  
  575.    private void translatePolys(int[][] var1, int[] var2, int var3) {
  576.       int var5 = 0;
  577.       if (var2 == null) {
  578.          var5 = var3;
  579.       } else {
  580.          for(int var4 = 0; var4 < var3; ++var4) {
  581.             var5 += var2[var4];
  582.          }
  583.       }
  584.  
  585.       if (this.xOrigin != 0) {
  586.          int[] var7 = new int[var5];
  587.          int[] var6 = var1[0];
  588.  
  589.          for(int var8 = 0; var8 < var5; ++var8) {
  590.             var7[var8] = var6[var8] + this.xOrigin;
  591.          }
  592.  
  593.          var1[0] = var7;
  594.       }
  595.  
  596.       if (this.yOrigin != 0) {
  597.          int[] var11 = new int[var5];
  598.          int[] var10 = var1[1];
  599.  
  600.          for(int var9 = 0; var9 < var5; ++var9) {
  601.             var11[var9] = var10[var9] + this.yOrigin;
  602.          }
  603.  
  604.          var1[1] = var11;
  605.       }
  606.  
  607.    }
  608.  
  609.    public void drawPolys(SunGraphics2D var1, int[] var2, int[] var3, int[] var4, int var5, boolean var6) {
  610.       if (this.xOrigin != 0 || this.yOrigin != 0) {
  611.          int[][] var7 = new int[][]{var2, var3};
  612.          this.translatePolys(var7, var4, var5);
  613.          var2 = var7[0];
  614.          var3 = var7[1];
  615.       }
  616.  
  617.       if (this.dprc == null) {
  618.          LockableRaster var11 = new LockableRaster(var1);
  619.          int[] var8 = new int[]{var11.type};
  620.          GraphicsPrimitive var9 = GraphicsPrimitiveMgr.locate(DrawPolygons.getMethodSignature(), var8, var11.devID);
  621.          if (var9 != null) {
  622.             DrawPolygons var10 = (DrawPolygons)var9;
  623.             this.dprc = var10.createCachedContext(this.raster, this.bufImg.getColorModel(), ((SunGraphics2D)this).getColor(), this.clipX, this.clipY, this.clipW, this.clipH);
  624.          }
  625.       }
  626.  
  627.       if (this.dprc != null) {
  628.          this.dprc.invoke(var2, var3, var4, var5, var6);
  629.       } else {
  630.          this.drawPolysState = RasterOutputManager.getManager().drawPolys(var1, var2, var3, var4, var5, var6, this.drawPolysState);
  631.       }
  632.  
  633.    }
  634.  
  635.    public void fillPolys(SunGraphics2D var1, int[] var2, int[] var3, int[] var4, int var5, boolean var6) {
  636.       if (this.xOrigin != 0 || this.yOrigin != 0) {
  637.          int[][] var7 = new int[][]{var2, var3};
  638.          this.translatePolys(var7, var4, var5);
  639.          var2 = var7[0];
  640.          var3 = var7[1];
  641.       }
  642.  
  643.       if (this.fprc == null) {
  644.          LockableRaster var11 = new LockableRaster(var1);
  645.          int[] var8 = new int[]{var11.type};
  646.          GraphicsPrimitive var9 = GraphicsPrimitiveMgr.locate(FillPolygons.getMethodSignature(), var8, var11.devID);
  647.          if (var9 != null) {
  648.             FillPolygons var10 = (FillPolygons)var9;
  649.             this.fprc = var10.createCachedContext(this.raster, this.bufImg.getColorModel(), ((SunGraphics2D)this).getColor(), this.clipX, this.clipY, this.clipW, this.clipH);
  650.          }
  651.       }
  652.  
  653.       if (this.fprc != null) {
  654.          this.fprc.invoke(var2, var3, var4, var5, var6);
  655.       } else {
  656.          this.fillPolysState = RasterOutputManager.getManager().fillPolys(var1, var2, var3, var4, var5, var6, this.fillPolysState);
  657.       }
  658.  
  659.    }
  660.  
  661.    public void drawRect(SunGraphics2D var1, int var2, int var3, int var4, int var5) {
  662.       var2 += this.xOrigin;
  663.       var3 += this.yOrigin;
  664.       if (this.drrc == null) {
  665.          LockableRaster var6 = new LockableRaster(var1);
  666.          int[] var7 = new int[]{var6.type};
  667.          GraphicsPrimitive var8 = GraphicsPrimitiveMgr.locate(DrawRect.getMethodSignature(), var7, var6.devID);
  668.          if (var8 != null) {
  669.             DrawRect var9 = (DrawRect)var8;
  670.             this.drrc = var9.createCachedContext(this.raster, this.bufImg.getColorModel(), ((SunGraphics2D)this).getColor(), this.clipX, this.clipY, this.clipW, this.clipH);
  671.          }
  672.       }
  673.  
  674.       if (this.drrc != null) {
  675.          this.drrc.invoke(var2, var3, var4, var5);
  676.       } else {
  677.          this.drawRectState = RasterOutputManager.getManager().drawRect(var1, var2, var3, var4, var5, this.drawRectState);
  678.       }
  679.  
  680.    }
  681.  
  682.    public void drawRoundRect(SunGraphics2D var1, int var2, int var3, int var4, int var5, int var6, int var7) {
  683.       var1.shapepipe.draw(var1, new RoundRectangle2D.Float((float)var2, (float)var3, (float)var4, (float)var5, (float)var6, (float)var7));
  684.    }
  685.  
  686.    public void drawOval(SunGraphics2D var1, int var2, int var3, int var4, int var5) {
  687.       var1.shapepipe.draw(var1, new Ellipse2D.Float((float)var2, (float)var3, (float)var4, (float)var5));
  688.    }
  689.  
  690.    public void drawArc(SunGraphics2D var1, int var2, int var3, int var4, int var5, int var6, int var7) {
  691.       var1.shapepipe.draw(var1, new Arc2D.Float((float)var2, (float)var3, (float)var4, (float)var5, (float)var6, (float)var7, 0));
  692.    }
  693.  
  694.    public void drawPolyline(SunGraphics2D var1, int[] var2, int[] var3, int var4) {
  695.       if (this.xOrigin != 0 || this.yOrigin != 0) {
  696.          int[][] var5 = new int[][]{var2, var3};
  697.          this.translatePolys(var5, (int[])null, var4);
  698.          var2 = var5[0];
  699.          var3 = var5[1];
  700.       }
  701.  
  702.       if (this.dprc == null) {
  703.          LockableRaster var9 = new LockableRaster(var1);
  704.          int[] var6 = new int[]{var9.type};
  705.          GraphicsPrimitive var7 = GraphicsPrimitiveMgr.locate(DrawPolygons.getMethodSignature(), var6, var9.devID);
  706.          if (var7 != null) {
  707.             DrawPolygons var8 = (DrawPolygons)var7;
  708.             this.dprc = var8.createCachedContext(this.raster, this.bufImg.getColorModel(), ((SunGraphics2D)this).getColor(), this.clipX, this.clipY, this.clipW, this.clipH);
  709.          }
  710.       }
  711.  
  712.       if (this.dprc != null) {
  713.          int[] var10 = new int[]{var4};
  714.          this.dprc.invoke(var2, var3, var10, 1, false);
  715.       } else {
  716.          this.drawPolylineState = RasterOutputManager.getManager().drawPolyline(var1, var2, var3, var4, this.drawPolylineState);
  717.       }
  718.  
  719.    }
  720.  
  721.    public void drawPolygon(SunGraphics2D var1, int[] var2, int[] var3, int var4) {
  722.       if (this.xOrigin != 0 || this.yOrigin != 0) {
  723.          int[][] var5 = new int[][]{var2, var3};
  724.          this.translatePolys(var5, (int[])null, var4);
  725.          var2 = var5[0];
  726.          var3 = var5[1];
  727.       }
  728.  
  729.       if (this.dprc == null) {
  730.          LockableRaster var9 = new LockableRaster(var1);
  731.          int[] var6 = new int[]{var9.type};
  732.          GraphicsPrimitive var7 = GraphicsPrimitiveMgr.locate(DrawPolygons.getMethodSignature(), var6, var9.devID);
  733.          if (var7 != null) {
  734.             DrawPolygons var8 = (DrawPolygons)var7;
  735.             this.dprc = var8.createCachedContext(this.raster, this.bufImg.getColorModel(), ((SunGraphics2D)this).getColor(), this.clipX, this.clipY, this.clipW, this.clipH);
  736.          }
  737.       }
  738.  
  739.       if (this.dprc != null) {
  740.          int[] var10 = new int[]{var4};
  741.          this.dprc.invoke(var2, var3, var10, 1, true);
  742.       } else {
  743.          this.drawPolygonState = RasterOutputManager.getManager().drawPolygon(var1, var2, var3, var4, this.drawPolygonState);
  744.       }
  745.  
  746.    }
  747.  
  748.    public void fillRoundRect(SunGraphics2D var1, int var2, int var3, int var4, int var5, int var6, int var7) {
  749.       var1.shapepipe.fill(var1, new RoundRectangle2D.Float((float)var2, (float)var3, (float)var4, (float)var5, (float)var6, (float)var7));
  750.    }
  751.  
  752.    public void fillOval(SunGraphics2D var1, int var2, int var3, int var4, int var5) {
  753.       var1.shapepipe.fill(var1, new Ellipse2D.Float((float)var2, (float)var3, (float)var4, (float)var5));
  754.    }
  755.  
  756.    public void fillArc(SunGraphics2D var1, int var2, int var3, int var4, int var5, int var6, int var7) {
  757.       var1.shapepipe.fill(var1, new Arc2D.Float((float)var2, (float)var3, (float)var4, (float)var5, (float)var6, (float)var7, 2));
  758.    }
  759.  
  760.    public void fillPolygon(SunGraphics2D var1, int[] var2, int[] var3, int var4) {
  761.       if (this.xOrigin != 0 || this.yOrigin != 0) {
  762.          int[][] var5 = new int[][]{var2, var3};
  763.          this.translatePolys(var5, (int[])null, var4);
  764.          var2 = var5[0];
  765.          var3 = var5[1];
  766.       }
  767.  
  768.       if (this.fprc == null) {
  769.          LockableRaster var9 = new LockableRaster(var1);
  770.          int[] var6 = new int[]{var9.type};
  771.          GraphicsPrimitive var7 = GraphicsPrimitiveMgr.locate(FillPolygons.getMethodSignature(), var6, var9.devID);
  772.          if (var7 != null) {
  773.             FillPolygons var8 = (FillPolygons)var7;
  774.             this.fprc = var8.createCachedContext(this.raster, this.bufImg.getColorModel(), ((SunGraphics2D)this).getColor(), this.clipX, this.clipY, this.clipW, this.clipH);
  775.          }
  776.       }
  777.  
  778.       if (this.fprc != null) {
  779.          int[] var10 = new int[]{var4};
  780.          this.fprc.invoke(var2, var3, var10, 1, true);
  781.       } else {
  782.          this.fillPolygonState = RasterOutputManager.getManager().fillPolygon(var1, var2, var3, var4, this.fillPolygonState);
  783.       }
  784.  
  785.    }
  786.  
  787.    public void clearRect(int var1, int var2, int var3, int var4) {
  788.       if (super.fillpipe != this) {
  789.          super.clearRect(var1, var2, var3, var4);
  790.       } else {
  791.          if (this.crrc == null && super.clipState != 2) {
  792.             LockableRaster var5 = new LockableRaster(this);
  793.             int[] var6 = new int[]{var5.type};
  794.             GraphicsPrimitive var7 = GraphicsPrimitiveMgr.locate(FillRect.getMethodSignature(), var6, var5.devID);
  795.             if (var7 != null) {
  796.                FillRect var8 = (FillRect)var7;
  797.                this.crrc = var8.createCachedContext(this.raster, this.bufImg.getColorModel(), ((SunGraphics2D)this).getBackground(), this.clipX, this.clipY, this.clipW, this.clipH);
  798.             }
  799.          }
  800.  
  801.          if (this.crrc != null) {
  802.             var1 += this.xOrigin;
  803.             var2 += this.yOrigin;
  804.             this.crrc.invoke(var1, var2, var3, var4);
  805.          } else {
  806.             super.clearRect(var1, var2, var3, var4);
  807.          }
  808.  
  809.       }
  810.    }
  811.  
  812.    public Object drawString(SunGraphics2D var1, String var2, float var3, float var4, Object var5) {
  813.       if (this.dsrc == null) {
  814.          LockableRaster var6 = new LockableRaster(this);
  815.          int[] var7 = new int[]{var6.type};
  816.          GraphicsPrimitive var8 = GraphicsPrimitiveMgr.locate(DrawString.getMethodSignature(), var7, var6.devID);
  817.          if (var8 != null) {
  818.             if (this.cachedFont == null) {
  819.                this.computeFontOptimizations(((SunGraphics2D)this).getFont());
  820.             }
  821.  
  822.             boolean var9 = true;
  823.             double[] var10 = new double[6];
  824.             if (this.isRotated(this.cachedTextTransform, var10)) {
  825.                if (this.cachedFontRotate == -1) {
  826.                   this.cachedFontRotate = NativeFontWrapper.fontCanRotate(this.cachedFont);
  827.                }
  828.  
  829.                if (this.cachedFontRotate != 1) {
  830.                   var9 = false;
  831.                   FontRenderContext var11 = var1.getFontRenderContext();
  832.                   if (this.cachedFontRotate == 2 && NativeFontWrapper.fontCanRotateText(var1.getFont(), var2, var10, var11.isAntiAliased(), var11.usesFractionalMetrics())) {
  833.                      var9 = true;
  834.                   }
  835.                }
  836.             }
  837.  
  838.             if (var9) {
  839.                DrawString var13 = (DrawString)var8;
  840.                this.dsrc = var13.createCachedContext(this.raster, this.bufImg.getColorModel(), ((SunGraphics2D)this).getColor(), this.cachedFont, this.cachedTextTransform, this.textIsAntiAliased, this.textUsesFractionalMetrics, this.clipX, this.clipY, this.clipW, this.clipH);
  841.             }
  842.          }
  843.       }
  844.  
  845.       if (!this.useFastTextClip || !(var4 < this.fastClipMinY) && !(var4 > this.fastClipMaxY)) {
  846.          if (this.dsrc != null) {
  847.             if (var1.transformState == 2) {
  848.                double[] var12 = new double[]{(double)var3, (double)var4};
  849.                var1.transform.deltaTransform(var12, 0, var12, 0, 1);
  850.                var3 = (float)var12[0];
  851.                var4 = (float)var12[1];
  852.             }
  853.  
  854.             this.dsrc.invoke(var2, var3, var4);
  855.          } else {
  856.             this.drawStringState = RasterOutputManager.getManager().drawString(var1, var2, var3, var4, this.drawStringState);
  857.          }
  858.  
  859.          return null;
  860.       } else {
  861.          return null;
  862.       }
  863.    }
  864.  
  865.    public Object drawGlyphVector(SunGraphics2D var1, GlyphVector var2, float var3, float var4, Object var5) {
  866.       Font var6 = var2.getFont();
  867.       if (var6 != this.lastGlyphVectorFont) {
  868.          this.drawGlyphVectorState = null;
  869.          this.gvrc = null;
  870.          this.lastGlyphVectorFont = var6;
  871.          this.lastGlyphVectorFontRotate = -1;
  872.       }
  873.  
  874.       if (this.gvrc == null) {
  875.          LockableRaster var7 = new LockableRaster(this);
  876.          int[] var8 = new int[]{var7.type};
  877.          GraphicsPrimitive var9 = GraphicsPrimitiveMgr.locate(DrawGlyphVector.getMethodSignature(), var8, var7.devID);
  878.          if (var9 != null) {
  879.             float var10 = var6.getSize2D();
  880.             FontRenderContext var11 = var2.getFontRenderContext();
  881.             AffineTransform var12 = var11.getTransform();
  882.             var12.scale((double)var10, (double)var10);
  883.             var12.preConcatenate(var6.getTransform());
  884.             var12.preConcatenate(super.transform);
  885.             boolean var13 = true;
  886.             double[] var14 = new double[6];
  887.             if (this.isRotated(var12, var14)) {
  888.                if (this.lastGlyphVectorFontRotate == -1) {
  889.                   this.lastGlyphVectorFontRotate = NativeFontWrapper.fontCanRotate(var6);
  890.                }
  891.  
  892.                if (this.lastGlyphVectorFontRotate != 1) {
  893.                   var13 = false;
  894.                   if (this.lastGlyphVectorFontRotate == 2 && NativeFontWrapper.fontCanRotateGlyphVector(var6, var2.getGlyphCodes(0, var2.getNumGlyphs(), (int[])null), var14, var11.isAntiAliased(), var11.usesFractionalMetrics())) {
  895.                      var13 = true;
  896.                   }
  897.                }
  898.             }
  899.  
  900.             if (var13) {
  901.                DrawGlyphVector var15 = (DrawGlyphVector)var9;
  902.                this.gvrc = var15.createCachedContext(this.raster, this.bufImg.getColorModel(), ((SunGraphics2D)this).getColor(), var6, var12, super.transform, var11.isAntiAliased(), var11.usesFractionalMetrics(), this.clipX, this.clipY, this.clipW, this.clipH);
  903.             }
  904.          }
  905.       }
  906.  
  907.       if (this.gvrc != null) {
  908.          if (var1.transformState == 2) {
  909.             double[] var16 = new double[]{(double)var3, (double)var4};
  910.             var1.transform.deltaTransform(var16, 0, var16, 0, 1);
  911.             var3 = (float)var16[0];
  912.             var4 = (float)var16[1];
  913.          }
  914.  
  915.          this.gvrc.invoke(var2, var3, var4);
  916.       } else {
  917.          this.drawGlyphVectorState = RasterOutputManager.getManager().drawGlyphVector(var1, var2, var3, var4, this.drawGlyphVectorState);
  918.       }
  919.  
  920.       return null;
  921.    }
  922.  
  923.    public Object drawChars(SunGraphics2D var1, char[] var2, int var3, int var4, int var5, int var6, Object var7) {
  924.       if (this.dcrc == null) {
  925.          LockableRaster var8 = new LockableRaster(this);
  926.          int[] var9 = new int[]{var8.type};
  927.          GraphicsPrimitive var10 = GraphicsPrimitiveMgr.locate(DrawChars.getMethodSignature(), var9, var8.devID);
  928.          if (var10 != null) {
  929.             if (this.cachedFont == null) {
  930.                this.computeFontOptimizations(((SunGraphics2D)this).getFont());
  931.             }
  932.  
  933.             boolean var11 = true;
  934.             double[] var12 = new double[6];
  935.             if (this.isRotated(this.cachedTextTransform, var12)) {
  936.                if (this.cachedFontRotate == -1) {
  937.                   this.cachedFontRotate = NativeFontWrapper.fontCanRotate(this.cachedFont);
  938.                }
  939.  
  940.                if (this.cachedFontRotate != 1) {
  941.                   var11 = false;
  942.                   FontRenderContext var13 = var1.getFontRenderContext();
  943.                   if (this.cachedFontRotate == 2 && NativeFontWrapper.fontCanRotateText(var1.getFont(), new String(var2, var3, var4), var12, var13.isAntiAliased(), var13.usesFractionalMetrics())) {
  944.                      var11 = true;
  945.                   }
  946.                }
  947.             }
  948.  
  949.             if (var11) {
  950.                DrawChars var17 = (DrawChars)var10;
  951.                this.dcrc = var17.createCachedContext(this.raster, this.bufImg.getColorModel(), ((SunGraphics2D)this).getColor(), this.cachedFont, this.cachedTextTransform, this.textIsAntiAliased, this.textUsesFractionalMetrics, this.clipX, this.clipY, this.clipW, this.clipH);
  952.             }
  953.          }
  954.       }
  955.  
  956.       if (!this.useFastTextClip || !((float)var6 < this.fastClipMinY) && !((float)var6 > this.fastClipMaxY)) {
  957.          if (this.dcrc != null) {
  958.             float var14;
  959.             float var15;
  960.             if (var1.transformState == 2) {
  961.                double[] var16 = new double[]{(double)var5, (double)var6};
  962.                var1.transform.deltaTransform(var16, 0, var16, 0, 1);
  963.                var14 = (float)var16[0];
  964.                var15 = (float)var16[1];
  965.             } else {
  966.                var14 = (float)var5;
  967.                var15 = (float)var6;
  968.             }
  969.  
  970.             this.dcrc.invoke(var2, var3, var4, var14, var15);
  971.          } else {
  972.             this.drawCharsState = RasterOutputManager.getManager().drawChars(var1, var2, var3, var4, var5, var6, this.drawCharsState);
  973.          }
  974.  
  975.          return null;
  976.       } else {
  977.          return null;
  978.       }
  979.    }
  980.  
  981.    public Object drawBytes(SunGraphics2D var1, byte[] var2, int var3, int var4, int var5, int var6, Object var7) {
  982.       if (this.dbrc == null) {
  983.          LockableRaster var8 = new LockableRaster(this);
  984.          int[] var9 = new int[]{var8.type};
  985.          GraphicsPrimitive var10 = GraphicsPrimitiveMgr.locate(DrawBytes.getMethodSignature(), var9, var8.devID);
  986.          if (var10 != null) {
  987.             if (this.cachedFont == null) {
  988.                this.computeFontOptimizations(((SunGraphics2D)this).getFont());
  989.             }
  990.  
  991.             boolean var11 = true;
  992.             double[] var12 = new double[6];
  993.             if (this.isRotated(this.cachedTextTransform, var12)) {
  994.                if (this.cachedFontRotate == -1) {
  995.                   this.cachedFontRotate = NativeFontWrapper.fontCanRotate(this.cachedFont);
  996.                }
  997.  
  998.                if (this.cachedFontRotate != 1) {
  999.                   var11 = false;
  1000.                   FontRenderContext var13 = var1.getFontRenderContext();
  1001.                   if (this.cachedFontRotate == 2 && NativeFontWrapper.fontCanRotateText(var1.getFont(), new String(var2, 0, var3, var4), var12, var13.isAntiAliased(), var13.usesFractionalMetrics())) {
  1002.                      var11 = true;
  1003.                   }
  1004.                }
  1005.             }
  1006.  
  1007.             if (var11) {
  1008.                DrawBytes var17 = (DrawBytes)var10;
  1009.                this.dbrc = var17.createCachedContext(this.raster, this.bufImg.getColorModel(), ((SunGraphics2D)this).getColor(), this.cachedFont, this.cachedTextTransform, this.textIsAntiAliased, this.textUsesFractionalMetrics, this.clipX, this.clipY, this.clipW, this.clipH);
  1010.             }
  1011.          }
  1012.       }
  1013.  
  1014.       if (!this.useFastTextClip || !((float)var6 < this.fastClipMinY) && !((float)var6 > this.fastClipMaxY)) {
  1015.          if (this.dbrc != null) {
  1016.             float var14;
  1017.             float var15;
  1018.             if (var1.transformState == 2) {
  1019.                double[] var16 = new double[]{(double)var5, (double)var6};
  1020.                var1.transform.deltaTransform(var16, 0, var16, 0, 1);
  1021.                var14 = (float)var16[0];
  1022.                var15 = (float)var16[1];
  1023.             } else {
  1024.                var14 = (float)var5;
  1025.                var15 = (float)var6;
  1026.             }
  1027.  
  1028.             this.dbrc.invoke(var2, var3, var4, var14, var15);
  1029.          } else {
  1030.             this.drawBytesState = RasterOutputManager.getManager().drawBytes(var1, var2, var3, var4, var5, var6, this.drawBytesState);
  1031.          }
  1032.  
  1033.          return null;
  1034.       } else {
  1035.          return null;
  1036.       }
  1037.    }
  1038.  
  1039.    public ImageData lock(int var1, int var2, int var3, int var4, int var5) {
  1040.       ImageData var6 = this.cachedID;
  1041.       if (null == var6 || var6.amILocked()) {
  1042.          var6 = new ImageData();
  1043.       }
  1044.  
  1045.       var6.setViewArea(var1, var2, var3, var4);
  1046.       var6.setLockMethod(var5);
  1047.       if (1 == this.lock(var6)) {
  1048.          this.cachedID = var6;
  1049.          return var6;
  1050.       } else {
  1051.          return null;
  1052.       }
  1053.    }
  1054.  
  1055.    private int lock(ImageData var1) {
  1056.       if (null != var1) {
  1057.          if (var1.amILocked()) {
  1058.             return 7;
  1059.          }
  1060.  
  1061.          if (!var1.equals(this.cachedID) && !LockableRaster.prepareImageData(var1, this.raster, this.bufImg.getColorModel(), this.primtype)) {
  1062.             return 5;
  1063.          }
  1064.  
  1065.          if (LockableRaster.prepareRasterBounds(var1, this.clipX, this.clipY, this.clipW, this.clipH)) {
  1066.             var1.incLockCount();
  1067.             this.cachedID = var1;
  1068.             return 1;
  1069.          }
  1070.       }
  1071.  
  1072.       return 5;
  1073.    }
  1074.  
  1075.    public int unlock(ImageData var1) {
  1076.       byte var2 = 5;
  1077.       WritableRaster var3 = this.raster;
  1078.       var2 = 6;
  1079.       if (null != var1 && var1.amILocked()) {
  1080.          var1.decLockCount();
  1081.       }
  1082.  
  1083.       return var2;
  1084.    }
  1085.  
  1086.    public String toString() {
  1087.       String var1 = "BufferedImageGraphics2D[";
  1088.       var1 = var1 + "BufferedImage[" + this.bufImg + "]";
  1089.       var1 = var1 + " Component[" + this.component + "]";
  1090.       return var1;
  1091.    }
  1092. }
  1093.