1. /*
  2. * @(#)Stroke.java 1.19 00/02/02
  3. *
  4. * Copyright 1996-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. /**
  12. * The <code>Stroke</code> interface allows a
  13. * {@link Graphics2D} object to obtain a {@link Shape} that is the
  14. * decorated outline, or stylistic representation of the outline,
  15. * of the specified <code>Shape</code>.
  16. * Stroking a <code>Shape</code> is like tracing its outline with a
  17. * marking pen of the appropriate size and shape.
  18. * The area where the pen would place ink is the area enclosed by the
  19. * outline <code>Shape</code>.
  20. * <p>
  21. * The methods of the <code>Graphics2D</code> interface that use the
  22. * outline <code>Shape</code> returned by a <code>Stroke</code> object
  23. * include <code>draw</code> and any other methods that are
  24. * implemented in terms of that method, such as
  25. * <code>drawLine</code>, <code>drawRect</code>,
  26. * <code>drawRoundRect</code>, <code>drawOval</code>,
  27. * <code>drawArc</code>, <code>drawPolyline</code>,
  28. * and <code>drawPolygon</code>.
  29. * <p>
  30. * The objects of the classes implementing <code>Stroke</code>
  31. * must be read-only because <code>Graphics2D</code> does not
  32. * clone these objects either when they are set as an attribute
  33. * with the <code>setStroke</code> method or when the
  34. * <code>Graphics2D</code> object is itself cloned.
  35. * If a <code>Stroke</code> object is modified after it is set in
  36. * the <code>Graphics2D</code> context then the behavior
  37. * of subsequent rendering would be undefined.
  38. * @see BasicStroke
  39. * @see Graphics2D#setStroke
  40. * @version 1.19, 02/02/00
  41. */
  42. public interface Stroke {
  43. /**
  44. * Returns an outline <code>Shape</code> which encloses the area that
  45. * should be painted when the <code>Shape</code> is stroked according
  46. * to the rules defined by the
  47. * object implementing the <code>Stroke</code> interface.
  48. * @param p a <code>Shape</code> to be stroked
  49. * @return the stroked outline <code>Shape</code>.
  50. */
  51. Shape createStrokedShape (Shape p);
  52. }