org.jhotdraw.geom
Class DoubleStroke

java.lang.Object
  extended by org.jhotdraw.geom.DoubleStroke
All Implemented Interfaces:
java.awt.Stroke
Direct Known Subclasses:
GrowStroke

public class DoubleStroke
extends java.lang.Object
implements java.awt.Stroke

Draws a double stroke (an outline of an outline). The inner width of a DoubleStroke defines the distance between the two outlines being drawn. The outline width of a DoubleStroke defines the thickness of the outline.

Version:
$Id: DoubleStroke.java 717 2010-11-21 12:30:57Z rawcoder $
Author:
Werner Randelshofer

Field Summary
private  float[] dashes
           
private  float dashPhase
           
private  double innerWidth
           
private  double miterLimit
           
private  java.awt.BasicStroke outlineStroke
           
private  double outlineWidth
           
 
Constructor Summary
DoubleStroke(double innerWidth, double outlineWidth)
           
DoubleStroke(double innerWidth, double outlineWidth, int cap, int join, double miterLimit, float[] dashes, float dashPhase)
           
 
Method Summary
private  double[] computeThickLine(double[] seg, int offset, double[] corners)
           
private  double[] computeThickLine(double x1, double y1, double x2, double y2, double thickness, double[] corners)
           
 java.awt.Shape createStrokedShape(java.awt.Shape s)
           
protected  void traceStroke(BezierPath bp, java.awt.geom.Path2D.Double left, java.awt.geom.Path2D.Double right)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

outlineStroke

private java.awt.BasicStroke outlineStroke

innerWidth

private double innerWidth

outlineWidth

private double outlineWidth

miterLimit

private double miterLimit

dashes

private float[] dashes

dashPhase

private float dashPhase
Constructor Detail

DoubleStroke

public DoubleStroke(double innerWidth,
                    double outlineWidth)

DoubleStroke

public DoubleStroke(double innerWidth,
                    double outlineWidth,
                    int cap,
                    int join,
                    double miterLimit,
                    




Method Detail

createStrokedShape

public java.awt.Shape createStrokedShape(java.awt.Shape s)
Specified by:
createStrokedShape in interface java.awt.Stroke

traceStroke

protected void traceStroke(BezierPath bp,
                           java.awt.geom.Path2D.Double left,
                           java.awt.geom.Path2D.Double right)

computeThickLine

private double[] computeThickLine(double[] seg,
                                  int offset,
                                  double[] corners)

computeThickLine

private double[] computeThickLine(double x1,
                                  double y1,
                                  double x2,
                                  double y2,
                                  double thickness,
                                  double[] corners)