TransformedStroke

Inheritance: java.lang.Object

All Implemented Interfaces: java.awt.Stroke

public class TransformedStroke implements Stroke

A stroke that contains transformation.

Constructors

ConstructorDescription
TransformedStroke(Stroke base, AffineTransform at)Creates a TransformedStroke based on another Stroke and an AffineTransform.

Methods

MethodDescription
getTransform()Gets a transformation.
createStrokedShape(Shape s)Strokes the given Shape with this stroke, creating an outline.
getBaseStroke()Gets basic stroke.

TransformedStroke(Stroke base, AffineTransform at)

public TransformedStroke(Stroke base, AffineTransform at)

Creates a TransformedStroke based on another Stroke and an AffineTransform.

Parameters:

ParameterTypeDescription
basejava.awt.StrokeThe stroke base.
atjava.awt.geom.AffineTransformThe affine transformation.

getTransform()

public AffineTransform getTransform()

Gets a transformation.

Returns: java.awt.geom.AffineTransform - A transformation.

createStrokedShape(Shape s)

public Shape createStrokedShape(Shape s)

Strokes the given Shape with this stroke, creating an outline. This outline is distorted by our AffineTransform relative to the outline which would be given by the base stroke, but only in terms of scaling (i.e. thickness of the lines), as translation and rotation are undone after the stroking.

Parameters:

ParameterTypeDescription
sjava.awt.ShapeAs shape to be outlined.

Returns: java.awt.Shape - An outline of the shape.

getBaseStroke()

public Stroke getBaseStroke()

Gets basic stroke.

Returns: java.awt.Stroke - Basic stroke.