strokes
Class Stroke

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.Vector<java.awt.geom.Point2D>
              extended by strokes.Stroke
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<java.awt.geom.Point2D>, java.util.Collection<java.awt.geom.Point2D>, java.util.List<java.awt.geom.Point2D>, java.util.RandomAccess

public class Stroke
extends java.util.Vector<java.awt.geom.Point2D>

A stroke, i.e., a vector of points.

Author:
Caroline Appert
See Also:
Serialized Form

Field Summary
static short HORIZONTAL_MIRROR
           
static short VERTICAL_MIRROR
           
 
Constructor Summary
Stroke()
          Builds an empty stroke.
 
Method Summary
 Stroke append(Stroke stroke)
          Builds a new stroke by concatenating another stroke to this stroke (it does not modify this stroke).
static Stroke arc(double startAngle, double extent, boolean clockwise)
           
static Stroke arche()
           
static Stroke corner()
           
static Stroke cross()
           
static Stroke freeStroke(java.awt.geom.GeneralPath gp)
          Computes a new stroke given a GeneralPath.
static Stroke helix(double nbRevolutions, double a, double b)
           
static Stroke line()
           
static Stroke loop()
           
 Stroke mirrorStroke(short axis)
          Builds a new stroke by mirroring this stroke (it does not modify this stroke).
 Stroke rotateStroke(double angleInRadians)
          Builds a new stroke by rotating this stroke (it does not modify this stroke).
static Stroke spiral(double nbRevolutions)
           
static Stroke wave()
           
static Stroke zigzag()
           
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Field Detail

VERTICAL_MIRROR

public static short VERTICAL_MIRROR

HORIZONTAL_MIRROR

public static short HORIZONTAL_MIRROR
Constructor Detail

Stroke

public Stroke()
Builds an empty stroke.

Method Detail

rotateStroke

public Stroke rotateStroke(double angleInRadians)
Builds a new stroke by rotating this stroke (it does not modify this stroke).

Parameters:
angleInRadians - The angle in radians
Returns:
A new stroke computed by rotating this stroke by angleInRadians.

append

public Stroke append(Stroke stroke)
Builds a new stroke by concatenating another stroke to this stroke (it does not modify this stroke).

Parameters:
stroke - The stroke concatenate
Returns:
A new stroke computed by concatenating stroke to this stroke.

mirrorStroke

public Stroke mirrorStroke(short axis)
Builds a new stroke by mirroring this stroke (it does not modify this stroke).

Parameters:
axis - The axis: VERTICAL_MIRROR or HORIZONTAL_MIRROR.
Returns:
A new stroke computed by mirroring this stroke.

corner

public static Stroke corner()
Returns:
A corner stroke.

spiral

public static Stroke spiral(double nbRevolutions)
Parameters:
nbRevolutions - The number of revolutions
Returns:
A spiral stroke.

helix

public static Stroke helix(double nbRevolutions,
                           double a,
                           double b)
Parameters:
nbRevolutions - The number of revolutions.
a -
b -
Returns:
An helix stroke.

wave

public static Stroke wave()
Returns:
A wave stroke.

zigzag

public static Stroke zigzag()
Returns:
A zigzag stroke.

arche

public static Stroke arche()
Returns:
An arche stroke.

line

public static Stroke line()
Returns:
A line stroke.

arc

public static Stroke arc(double startAngle,
                         double extent,
                         boolean clockwise)
Parameters:
startAngle - The starting angle
extent - The extent
clockwise - The rotation direction (clockwise or counter clockwise)
Returns:
An arc stroke.

loop

public static Stroke loop()
Returns:
A loop stroke.

cross

public static Stroke cross()
Returns:
A cross stroke.

freeStroke

public static Stroke freeStroke(java.awt.geom.GeneralPath gp)
Computes a new stroke given a GeneralPath.

Parameters:
gp - The general path
Returns:
The new stroke.