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