home *** CD-ROM | disk | FTP | other *** search
/ Java 1.2 How-To / JavaHowTo.iso / 3rdParty / jbuilder / unsupported / JDK1.2beta3 / SOURCE / SRC.ZIP / java / awt / Stroke.java < prev    next >
Encoding:
Java Source  |  1998-03-20  |  1.9 KB  |  51 lines

  1. /*
  2.  * @(#)Stroke.java    1.13 98/03/18
  3.  *
  4.  * Copyright 1996, 1997 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  *
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package java.awt;
  16.  
  17. /**
  18.  * This interface allows a Graphics2D object to get a Path representation
  19.  * of the boundaries of a stroking primitive from the path to be stroked.
  20.  * The effect of stroking a path can be compared to drawing a logical
  21.  * pen of an appropriate size and shape along the trajectory of the path.
  22.  * The area where the pen would place ink is the area enclosed by the
  23.  * stroked path.
  24.  * <p>
  25.  * The stroking primitives of the Graphics2D interface include the
  26.  * drawPath method and any other methods that are implemented in terms
  27.  * of that method such as drawLine, drawRect, drawRoundRect, drawOval,
  28.  * drawArc, drawPolyline, and drawPolygon.
  29.  * <p>
  30.  * The objects of the classes implementing Stroke must be immutable
  31.  * (i.e. read-only) because the Graphics2D will not clone these objects
  32.  * either when they are set as an attribute with the setStroke method
  33.  * or when the Graphics2D object is itself cloned.
  34.  * If a Stroke object were modified after it was set in the state of
  35.  * the Graphics2D then the behavior of subsequent rendering would be
  36.  * undefined.
  37.  * @see BasicStroke
  38.  * @see Graphics2D#setStroke
  39.  * @version 10 Feb 1997
  40.  */
  41. public interface Stroke {
  42.     /**
  43.      * Returns a path which encloses the area that should be painted
  44.      * when the path is stroked according to the rules defined by the
  45.      * object implementing the Stroke interface.
  46.      * @param p The path that should be stroked.
  47.      * @return The stroked path.
  48.      */
  49.     Shape createStrokedShape (Shape p);
  50. }
  51.