public class

Stroker

extends LineSink
java.lang.Object
   ↳ sun.java2d.pisces.LineSink
     ↳ sun.java2d.pisces.Stroker

Summary

Constants
int CAP_BUTT Constant value for end cap style.
int CAP_ROUND Constant value for end cap style.
int CAP_SQUARE Constant value for end cap style.
int JOIN_BEVEL Constant value for join style.
int JOIN_MITER Constant value for join style.
int JOIN_ROUND Constant value for join style.
Public Constructors
Stroker()
Empty constructor.
Stroker(LineSink output, int lineWidth, int capStyle, int joinStyle, int miterLimit, Transform4 transform)
Constructs a Stroker.
Public Methods
void close()
Closes the current path by drawing a line from the current drawing position to the point specified by the moset recent moveTo command.
void end()
Ends the current path.
void lineJoin()
Provides a hint that the current segment should be joined to the following segment using an explicit miter or round join if required.
void lineTo(int x1, int y1)
Draws a line from the current drawing position to the point (x1, y1) and sets the current drawing position to (x1, y1).
void moveTo(int x0, int y0)
Moves the current drawing position to the point (x0, y0).
void setOutput(LineSink output)
Sets the output LineSink of this Stroker.
void setParameters(int lineWidth, int capStyle, int joinStyle, int miterLimit, Transform4 transform)
Sets the parameters of this Stroker.
[Expand]
Inherited Methods
From class sun.java2d.pisces.LineSink
From class java.lang.Object

Constants

public static final int CAP_BUTT

Constant value for end cap style.

Constant Value: 0 (0x00000000)

public static final int CAP_ROUND

Constant value for end cap style.

Constant Value: 1 (0x00000001)

public static final int CAP_SQUARE

Constant value for end cap style.

Constant Value: 2 (0x00000002)

public static final int JOIN_BEVEL

Constant value for join style.

Constant Value: 2 (0x00000002)

public static final int JOIN_MITER

Constant value for join style.

Constant Value: 0 (0x00000000)

public static final int JOIN_ROUND

Constant value for join style.

Constant Value: 1 (0x00000001)

Public Constructors

public Stroker ()

Empty constructor. setOutput and setParameters must be called prior to calling any other methods.

public Stroker (LineSink output, int lineWidth, int capStyle, int joinStyle, int miterLimit, Transform4 transform)

Constructs a Stroker.

Parameters
output an output LineSink.
lineWidth the desired line width in pixels, in S15.16 format.
capStyle the desired end cap style, one of CAP_BUTT, CAP_ROUND or CAP_SQUARE.
joinStyle the desired line join style, one of JOIN_MITER, JOIN_ROUND or JOIN_BEVEL.
miterLimit the desired miter limit, in S15.16 format.
transform a Transform4 object indicating the transform that has been previously applied to all incoming coordinates. This is required in order to produce consistently shaped end caps and joins.

Public Methods

public void close ()

Closes the current path by drawing a line from the current drawing position to the point specified by the moset recent moveTo command.

public void end ()

Ends the current path. It may be necessary to end a path in order to allow end caps to be drawn.

public void lineJoin ()

Provides a hint that the current segment should be joined to the following segment using an explicit miter or round join if required.

An application-generated path will generally have no need to contain calls to this method; they are typically introduced by a Flattener to mark segment divisions that appear in its input, and consumed by a Stroker that is responsible for emitting the miter or round join segments.

Other LineSink classes should simply pass this hint to their output sink as needed.

public void lineTo (int x1, int y1)

Draws a line from the current drawing position to the point (x1, y1) and sets the current drawing position to (x1, y1).

Parameters
x1 the X coordinate in S15.16 format
y1 the Y coordinate in S15.16 format

public void moveTo (int x0, int y0)

Moves the current drawing position to the point (x0, y0).

Parameters
x0 the X coordinate in S15.16 format
y0 the Y coordinate in S15.16 format

public void setOutput (LineSink output)

Sets the output LineSink of this Stroker.

Parameters
output an output LineSink.

public void setParameters (int lineWidth, int capStyle, int joinStyle, int miterLimit, Transform4 transform)

Sets the parameters of this Stroker.

Parameters
lineWidth the desired line width in pixels, in S15.16 format.
capStyle the desired end cap style, one of CAP_BUTT, CAP_ROUND or CAP_SQUARE.
joinStyle the desired line join style, one of JOIN_MITER, JOIN_ROUND or JOIN_BEVEL.
miterLimit the desired miter limit, in S15.16 format.
transform a Transform4 object indicating the transform that has been previously applied to all incoming coordinates. This is required in order to produce consistently shaped end caps and joins.