1. /*
  2. * @(#)Paint.java 1.23 00/02/02
  3. *
  4. * Copyright 1997-2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package java.awt;
  11. import java.awt.image.ColorModel;
  12. import java.awt.geom.AffineTransform;
  13. import java.awt.geom.Point2D;
  14. import java.awt.geom.Rectangle2D;
  15. /**
  16. * This <code>Paint</code> interface defines how color patterns
  17. * can be generated for {@link Graphics2D} operations. A class
  18. * implementing the <code>Paint</code> interface is added to the
  19. * <code>Graphics2D</code> context in order to define the color
  20. * pattern used by the <code>draw</code> and <code>fill</code> methods.
  21. * <p>
  22. * Instances of classes implementing <code>Paint</code> must be
  23. * read-only because the <code>Graphics2D</code> does not clone
  24. * these objects when they are set as an attribute with the
  25. * <code>setPaint</code> method or when the <code>Graphics2D</code>
  26. * object is itself cloned.
  27. * @see PaintContext
  28. * @see Color
  29. * @see GradientPaint
  30. * @see TexturePaint
  31. * @see Graphics2D#setPaint
  32. * @version 1.23, 02/02/00
  33. */
  34. public interface Paint extends Transparency {
  35. /**
  36. * Creates and returns a {@link PaintContext} used to
  37. * generate the color pattern.
  38. * @param cm the {@link ColorModel} that receives the
  39. * <code>Paint</code> data. This is used only as a hint.
  40. * @param deviceBounds the device space bounding box
  41. * of the graphics primitive being rendered
  42. * @param userBounds the user space bounding box
  43. * of the graphics primitive being rendered
  44. * @param xform the {@link AffineTransform} from user
  45. * space into device space
  46. * @param hints the hint that the context object uses to
  47. * choose between rendering alternatives
  48. * @return the <code>PaintContext</code> for
  49. * generating color patterns
  50. * @see PaintContext
  51. */
  52. public PaintContext createContext(ColorModel cm,
  53. Rectangle deviceBounds,
  54. Rectangle2D userBounds,
  55. AffineTransform xform,
  56. RenderingHints hints);
  57. }