home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection Student Program / ADC Tools Sampler CD Disk 3 1999.iso / Metrowerks CodeWarrior / Java Support / Java_Source / Java2 / src / java / awt / Stroke.java < prev    next >
Encoding:
Java Source  |  1999-05-28  |  2.3 KB  |  63 lines  |  [TEXT/CWIE]

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