DirectRasterGraphics.java 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /* Copyright (C) 2000, 2003 Free Software Foundation
  2. This file is part of libgcj.
  3. This software is copyrighted work licensed under the terms of the
  4. Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
  5. details. */
  6. package gnu.awt.j2d;
  7. import java.awt.Color;
  8. import java.awt.Image;
  9. import java.awt.Shape;
  10. import java.awt.Rectangle;
  11. import java.awt.Graphics;
  12. import java.awt.Graphics2D;
  13. import java.awt.GraphicsConfiguration;
  14. import java.awt.Font;
  15. import java.awt.FontMetrics;
  16. import java.awt.image.Raster;
  17. import java.awt.image.ImageObserver;
  18. /**
  19. * Interface for a simple pixel based backend graphics object that
  20. * does not handle translation/transforms, curves, nor advanced
  21. * compositing.
  22. */
  23. public interface DirectRasterGraphics extends Cloneable
  24. {
  25. void dispose();
  26. void setColor(Color color);
  27. void setPaintMode();
  28. void setXORMode(Color altColor);
  29. void setFont(Font font);
  30. FontMetrics getFontMetrics(Font font);
  31. // supports rects, multi-rects and polygons
  32. void setClip(Shape clip);
  33. void copyArea(int x, int y, int width, int height,
  34. int dx, int dy);
  35. void drawLine(int x1, int y1, int x2, int y2);
  36. void drawRect(int x, int y, int width, int height);
  37. void fillRect(int x, int y, int width, int height);
  38. void drawArc(int x, int y, int width, int height,
  39. int startAngle, int arcAngle);
  40. void fillArc(int x, int y, int width, int height,
  41. int startAngle, int arcAngle);
  42. void drawPolyline(int[] xPoints, int[] yPoints, int nPoints);
  43. void drawPolygon(int[] xPoints, int[] yPoints, int nPoints);
  44. void fillPolygon(int[] xPoints, int[] yPoints, int nPoints,
  45. int translateX, int translateY);
  46. void drawString(String str, int x, int y);
  47. boolean drawImage(Image image, int x, int y,
  48. ImageObserver observer);
  49. /**
  50. * Map the data for screen pixels in the requested bounds to a
  51. * raster object. This gives read/write access to the screen
  52. * pixels, allowing neat alpha and composite tricks.
  53. */
  54. MappedRaster mapRaster(Rectangle bounds);
  55. /**
  56. * Detach previously mapped pixel data from a raster object.
  57. */
  58. void unmapRaster(MappedRaster mappedRaster);
  59. Object clone();
  60. }