public class

Dasher

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

Class Overview

The Dasher class takes a series of linear commands (moveTo, lineTo, close and end) and breaks them into smaller segments according to a dash pattern array and a starting dash phase.

Issues: in J2Se, a zero length dash segment as drawn as a very short dash, whereas Pisces does not draw anything. The PostScript semantics are unclear.

Summary

Public Constructors
Dasher()
Empty constructor.
Dasher(LineSink output, int[] dash, int phase, Transform4 transform)
Constructs a Dasher.
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 Dasher.
void setParameters(int[] dash, int phase, Transform4 transform)
Sets the parameters of this Dasher.
[Expand]
Inherited Methods
From class sun.java2d.pisces.LineSink
From class java.lang.Object

Public Constructors

public Dasher ()

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

public Dasher (LineSink output, int[] dash, int phase, Transform4 transform)

Constructs a Dasher.

Parameters
output an output LineSink.
dash an array of ints containing the dash pattern in S15.16 format.
phase an int containing the dash phase 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 compute dash lengths properly.

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 Dasher.

Parameters
output an output LineSink.

public void setParameters (int[] dash, int phase, Transform4 transform)

Sets the parameters of this Dasher.

Parameters
dash an array of ints containing the dash pattern in S15.16 format.
phase an int containing the dash phase 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 compute dash lengths properly.