diva.sketch
Class PenStroke

java.lang.Object
  extended by java.awt.BasicStroke
      extended by diva.sketch.PenStroke
All Implemented Interfaces:
Stroke

public class PenStroke
extends BasicStroke
implements Stroke

A first cut at making pen-sketched drawings look like they were actually sketched by a pen. This class special-cases Polyline2D objects and hands everything else off to its superclass.

Version:
$Revision: 1.4 $
Author:
Michael Shilman (michaels@eecs.berkeley.edu)

Field Summary
 
Fields inherited from class java.awt.BasicStroke
CAP_BUTT, CAP_ROUND, CAP_SQUARE, JOIN_BEVEL, JOIN_MITER, JOIN_ROUND
 
Constructor Summary
PenStroke(float width)
          Constructs a solid BasicStroke with the specified line width and with default values for the cap and join styles.
 
Method Summary
 Shape createStrokedShape(Shape s)
          Returns a Shape whose interior defines the stroked outline of a specified Shape.
 
Methods inherited from class java.awt.BasicStroke
equals, getDashArray, getDashPhase, getEndCap, getLineJoin, getLineWidth, getMiterLimit, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PenStroke

public PenStroke(float width)
Constructs a solid BasicStroke with the specified line width and with default values for the cap and join styles.

Parameters:
width - the width of the BasicStroke
Throws:
IllegalArgumentException - if width is negative
Method Detail

createStrokedShape

public final Shape createStrokedShape(Shape s)
Returns a Shape whose interior defines the stroked outline of a specified Shape.

Specified by:
createStrokedShape in interface Stroke
Overrides:
createStrokedShape in class BasicStroke
Parameters:
s - the Shape boundary be stroked
Returns:
the Shape of the stroked outline.


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.