Lines Matching refs:sg2d

52     public synchronized void drawLine(SunGraphics2D sg2d, int x1, int y1, int x2, int y2) {
56 draw(sg2d, line);
59 public synchronized void drawRect(SunGraphics2D sg2d, int x, int y, int width, int height) {
63 draw(sg2d, rectangle);
66 public synchronized void drawRoundRect(SunGraphics2D sg2d, int x, int y, int width, int height, int arcWidth, int arcHeight) {
70 draw(sg2d, roundrectangle);
73 public synchronized void drawOval(SunGraphics2D sg2d, int x, int y, int width, int height) {
77 draw(sg2d, ellipse);
80 public synchronized void drawArc(SunGraphics2D sg2d, int x, int y, int width, int height, int startAngle, int arcAngle) {
84 draw(sg2d, arc);
87 public synchronized void drawPolyline(SunGraphics2D sg2d, int xpoints[], int ypoints[], int npoints) {
88 doPolygon(sg2d, xpoints, ypoints, npoints, false, false);
91 public synchronized void drawPolygon(SunGraphics2D sg2d, int xpoints[], int ypoints[], int npoints) {
92 doPolygon(sg2d, xpoints, ypoints, npoints, true, false);
95 public synchronized void fillRect(SunGraphics2D sg2d, int x, int y, int width, int height) {
99 fill(sg2d, rectangle);
102 public synchronized void fillRoundRect(SunGraphics2D sg2d, int x, int y, int width, int height, int arcWidth, int arcHeight) {
106 fill(sg2d, roundrectangle);
109 public synchronized void fillOval(SunGraphics2D sg2d, int x, int y, int width, int height) {
113 fill(sg2d, ellipse);
116 public synchronized void fillArc(SunGraphics2D sg2d, int x, int y, int width, int height, int startAngle, int arcAngle) {
120 fill(sg2d, arc);
123 public synchronized void fillPolygon(SunGraphics2D sg2d, int xpoints[], int ypoints[], int npoints) {
124 doPolygon(sg2d, xpoints, ypoints, npoints, true, true);
127 public synchronized void doPolygon(SunGraphics2D sg2d, int xpoints[], int ypoints[], int npoints, boolean ispolygon, boolean isfill) {
140 doShape(sg2d, (OSXSurfaceData) sg2d.getSurfaceData(), (Shape) gp, isfill);
143 public synchronized void draw(SunGraphics2D sg2d, Shape shape) {
144 doShape(sg2d, (OSXSurfaceData) sg2d.getSurfaceData(), shape, false);
147 public synchronized void fill(SunGraphics2D sg2d, Shape shape) {
148 doShape(sg2d, (OSXSurfaceData) sg2d.getSurfaceData(), shape, true);
151 void doShape(SunGraphics2D sg2d, OSXSurfaceData surfaceData, Shape shape, boolean isfill) {
159 Rectangle2D compositingBounds = padBounds(sg2d, shape);
162 clipBounds(sg2d, compositingBounds);
176 ShapeTM.concatenate(sg2d.transform);
178 g.setRenderingHints(sg2d.getRenderingHints());
179 g.setPaint(sg2d.getPaint());
180 g.setStroke(sg2d.getStroke());
191 composite(sg2d, surfaceData, srcPixels, compositingBounds);
195 public synchronized void drawString(SunGraphics2D sg2d, String str, double x, double y) {
196 drawGlyphVector(sg2d, sg2d.getFont().createGlyphVector(sg2d.getFontRenderContext(), str), x, y);
199 public synchronized void drawChars(SunGraphics2D sg2d, char data[], int offset, int length, int x, int y) {
200 drawString(sg2d, new String(data, offset, length), x, y);
203 public synchronized void drawGlyphVector(SunGraphics2D sg2d, GlyphVector glyphVector, double x, double y) {
204 drawGlyphVector(sg2d, glyphVector, (float) x, (float) y);
207 public synchronized void drawGlyphVector(SunGraphics2D sg2d, GlyphVector glyphVector, float x, float y) {
208 OSXSurfaceData surfaceData = (OSXSurfaceData) sg2d.getSurfaceData();
213 Rectangle2D compositingBounds = padBounds(sg2d, shape);
216 clipBounds(sg2d, compositingBounds);
229 ShapeTM.concatenate(sg2d.transform);
231 g.setPaint(sg2d.getPaint());
232 g.setStroke(sg2d.getStroke());
233 g.setFont(sg2d.getFont());
234 g.setRenderingHints(sg2d.getRenderingHints());
241 composite(sg2d, surfaceData, srcPixels, compositingBounds);
245 protected boolean blitImage(SunGraphics2D sg2d, Image img, boolean fliph, boolean flipv, int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh, Color bgColor) {
246 OSXSurfaceData surfaceData = (OSXSurfaceData) sg2d.getSurfaceData();
253 boolean complexTransform = (sg2d.transformState >= SunGraphics2D.TRANSFORM_TRANSLATESCALE);
255 double newX = Math.floor(compositingBounds.getX() + sg2d.transX);
256 double newY = Math.floor(compositingBounds.getY() + sg2d.transY);
261 Shape transformedShape = sg2d.transform.createTransformedShape(compositingBounds);
271 clipBounds(sg2d, compositingBounds);
284 ShapeTM.concatenate(sg2d.transform);
286 g.setRenderingHints(sg2d.getRenderingHints());
296 composite(sg2d, surfaceData, srcPixels, compositingBounds);
302 Rectangle2D padBounds(SunGraphics2D sg2d, Shape shape) {
303 shape = sg2d.transformShape(shape);
307 if (sg2d.stroke != null) {
308 if (sg2d.stroke instanceof BasicStroke) {
309 int width = (int) (((BasicStroke) sg2d.stroke).getLineWidth() + 0.5f);
314 shape = sg2d.stroke.createStrokedShape(shape);
329 void clipBounds(SunGraphics2D sg2d, Rectangle2D bounds) {
331 * System.err.println("clipBounds"); System.err.println(" transform="+sg2d.transform);
332 * System.err.println(" getTransform()="+sg2d.getTransform());
333 * System.err.println(" complexTransform="+(sg2d.transformState > SunGraphics2D.TRANSFORM_TRANSLATESCALE));
334 * System.err.println(" transX="+sg2d.transX+" transY="+sg2d.transX);
335 * System.err.println(" sg2d.constrainClip="+sg2d.constrainClip); if (sg2d.constrainClip != null) {
337 * .println(" constrainClip: x="+sg2d.constrainClip.getLoX()+" y="+sg2d.constrainClip.getLoY()+" w="
338 * +sg2d.constrainClip.getWidth()+" h="+sg2d.constrainClip.getHeight());}
339 * System.err.println(" constrainX="+sg2d.constrainX+" constrainY="+sg2d.constrainY);
340 * System.err.println(" usrClip="+sg2d.usrClip);
341 * System.err.println(" devClip: x="+sg2d.devClip.getLoX()+" y="
342 * +sg2d.devClip.getLoY()+" w="+sg2d.devClip.getWidth()+" h="+sg2d.devClip.getHeight());
344 Region intersection = sg2d.clipRegion.getIntersectionXYWH((int) bounds.getX(), (int) bounds.getY(), (int) bounds.getWidth(), (int) bounds.getHeight());
348 BufferedImage getSurfacePixels(SunGraphics2D sg2d, OSXSurfaceData surfaceData, int x, int y, int w, int h) {
353 return surfaceData.copyArea(sg2d, x, y, w, h, dstInPixels);
356 void composite(SunGraphics2D sg2d, OSXSurfaceData surfaceData, BufferedImage srcPixels, Rectangle2D compositingBounds) {
367 Composite composite = sg2d.getComposite();
372 succeded = surfaceData.xorSurfacePixels(sg2d, srcPixels, x, y, w, h, ((XORComposite) composite).getXorColor().getRGB());
380 BufferedImage dstInPixels = getSurfacePixels(sg2d, surfaceData, x, y, w, h);
388 succeded = osxsd.xorSurfacePixels(sg2d, srcPixels, 0, 0, w, h, ((XORComposite) composite).getXorColor().getRGB());
406 CompositeContext compositeContext = composite.createContext(srcPixels.getColorModel(), dstOutPixels.getColorModel(), sg2d.getRenderingHints());
416 Composite savedComposite = sg2d.getComposite();
417 AffineTransform savedTM = sg2d.getTransform();
418 int savedCX = sg2d.constrainX;
419 int savedCY = sg2d.constrainY;
421 sg2d.setComposite(AlphaComposite.SrcOver);
424 // so we need to set the sg2d.transform to identity and we must set the contrainX/Y to 0 for the
426 sg2d.constrainX = 0;
427 sg2d.constrainY = 0;
428 sg2d.setTransform(sIdentityMatrix);
429 sg2d.drawImage(dstOutPixels, x, y, x + w, y + h, 0, 0, w, h, null);
431 sg2d.constrainX = savedCX;
432 sg2d.constrainY = savedCY;
433 sg2d.setTransform(savedTM);
434 sg2d.setComposite(savedComposite);