APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.sun.marlin

public final Class Dasher

extends Object
implements StartFlagPathConsumer2D, MarlinConst
Class Inheritance
All Implemented Interfaces
com.sun.marlin.MarlinConst, com.sun.marlin.TransformingPathConsumer2D.StartFlagPathConsumer2D, com.sun.marlin.DPathConsumer2D
Imports
java.util.Arrays, com.sun.marlin.TransformingPathConsumer2D.CurveBasicMonotonizer, .TransformingPathConsumer2D.CurveClipSplitter, .TransformingPathConsumer2D.StartFlagPathConsumer2D

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.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
private double[]
private int
private final double[]
pack-priv static final double
private final TransformingPathConsumer2D.CurveClipSplitter
private double
private double
private double
private double[]
pack-priv final ArrayCacheDouble.Reference
private int
private boolean
pack-priv static final double
private int
private double[]
pack-priv final ArrayCacheDouble.Reference
private int
private final Dasher.LengthIterator
pack-priv static final double
pack-priv static final double
private boolean
private DPathConsumer2D
private boolean
private double
pack-priv final RendererContext
pack-priv static final int
pack-priv boolean
private boolean
private int
private boolean
private double
private boolean
private double
private double
private double

Constructor Summary

AccessConstructor and Description
pack-priv
Dasher(final RendererContext
per-thread renderer context
rdrCtx
)

Constructs a Dasher.

Method Summary

Modifier and TypeMethod and Description
private void
_curveTo(final double x1, final double y1, final double x2, final double y2, final double x3, final double y3)

private void
_lineTo(final double x1, final double y1)

private void
_quadTo(final double x1, final double y1, final double x2, final double y2)

public void
public double[]
copyDashArray(final float[] dashes)

public void
curveTo(final double x1, final double y1, final double x2, final double y2, final double x3, final double y3)

Implements com.sun.marlin.DPathConsumer2D.curveTo.

pack-priv void
dispose()

Disposes this dasher: clean up before reusing this instance

private void
private void
emitSeg(double[] buf, int off, int type)

private void
goTo(final double[] pts, final int off, final int type, final boolean on)

private void
goTo_starting(final double[] pts, final int off, final int type)

public Dasher

Returns:

this instance
init
(final DPathConsumer2D
an output DPathConsumer2D.
out
,
final double[]
an array of doubles containing the dash pattern
dash
,
final int
length of the given dash array
dashLen
,
double
a double containing the dash phase
phase
,
final boolean
true to indicate to recycle the given dash array
recycleDashes
)

Initialize the Dasher.

public void
lineTo(final double x1, final double y1)

Implements com.sun.marlin.DPathConsumer2D.lineTo.

public void
moveTo(final double x0, final double y0)

Implements com.sun.marlin.DPathConsumer2D.moveTo.

public void
pathDone()

Implements com.sun.marlin.DPathConsumer2D.pathDone.

Called after the last segment of the last subpath when the iteration of the path segments is completely done.

public void
quadTo(final double x1, final double y1, final double x2, final double y2)

Implements com.sun.marlin.DPathConsumer2D.quadTo.

public void
setMonotonizerStartFlag(boolean first)

public void
private void
skipCurveTo(final double x1, final double y1, final double x2, final double y2, final double x3, final double y3)

public void
private void
skipLineTo(final double x1, final double y1)

private void
skipQuadTo(final double x1, final double y1, final double x2, final double y2)

private void
skipSomethingTo(final int type)

private void
somethingTo(final int type)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

clipRectback to summary
private double[] clipRect
cOutCodeback to summary
private int cOutCode
curCurveptsback to summary
private final double[] curCurvepts
CURVE_LEN_ERRback to summary
pack-priv static final double CURVE_LEN_ERR
curveSplitterback to summary
private final TransformingPathConsumer2D.CurveClipSplitter curveSplitter
cx0back to summary
private double cx0
cy0back to summary
private double cy0
cycleLenback to summary
private double cycleLen
dashback to summary
private double[] dash
dashes_refback to summary
pack-priv final ArrayCacheDouble.Reference dashes_ref
dashLenback to summary
private int dashLen
dashOnback to summary
private boolean dashOn
EPSback to summary
pack-priv static final double EPS
firstSegidxback to summary
private int firstSegidx
firstSegmentsBufferback to summary
private double[] firstSegmentsBuffer
firstSegmentsBuffer_refback to summary
pack-priv final ArrayCacheDouble.Reference firstSegmentsBuffer_ref
idxback to summary
private int idx
liback to summary
private final Dasher.LengthIterator li
MAX_CYCLESback to summary
pack-priv static final double MAX_CYCLES
MIN_T_INCback to summary
pack-priv static final double MIN_T_INC
needsMoveToback to summary
private boolean needsMoveTo
outback to summary
private DPathConsumer2D out
outsideback to summary
private boolean outside
phaseback to summary
private double phase
rdrCtxback to summary
pack-priv final RendererContext rdrCtx
REC_LIMITback to summary
pack-priv static final int REC_LIMIT
recycleDashesback to summary
pack-priv boolean recycleDashes
startDashOnback to summary
private boolean startDashOn
startIdxback to summary
private int startIdx
startingback to summary
private boolean starting
startPhaseback to summary
private double startPhase
subdivideback to summary
private boolean subdivide
sx0back to summary
private double sx0
sy0back to summary
private double sy0
totalSkipLenback to summary
private double totalSkipLen

Constructor Detail

Dasherback to summary
pack-priv Dasher(final RendererContext rdrCtx)

Constructs a Dasher.

Parameters
rdrCtx:RendererContext

per-thread renderer context

Method Detail

_curveToback to summary
private void _curveTo(final double x1, final double y1, final double x2, final double y2, final double x3, final double y3)
_lineToback to summary
private void _lineTo(final double x1, final double y1)
_quadToback to summary
private void _quadTo(final double x1, final double y1, final double x2, final double y2)
closePathback to summary
public void closePath()

Implements com.sun.marlin.DPathConsumer2D.closePath.

Annotations
@Override
copyDashArrayback to summary
public double[] copyDashArray(final float[] dashes)
curveToback to summary
public void curveTo(final double x1, final double y1, final double x2, final double y2, final double x3, final double y3)

Implements com.sun.marlin.DPathConsumer2D.curveTo.

Annotations
@Override
disposeback to summary
pack-priv void dispose()

Disposes this dasher: clean up before reusing this instance

emitFirstSegmentsback to summary
private void emitFirstSegments()
emitSegback to summary
private void emitSeg(double[] buf, int off, int type)
goToback to summary
private void goTo(final double[] pts, final int off, final int type, final boolean on)
goTo_startingback to summary
private void goTo_starting(final double[] pts, final int off, final int type)
initback to summary
public Dasher init(final DPathConsumer2D out, final double[] dash, final int dashLen, double phase, final boolean recycleDashes)

Initialize the Dasher.

Parameters
out:DPathConsumer2D

an output DPathConsumer2D.

dash:double[]

an array of doubles containing the dash pattern

dashLen:int

length of the given dash array

phase:double

a double containing the dash phase

recycleDashes:boolean

true to indicate to recycle the given dash array

Returns:Dasher

this instance

lineToback to summary
public void lineTo(final double x1, final double y1)

Implements com.sun.marlin.DPathConsumer2D.lineTo.

Annotations
@Override
moveToback to summary
public void moveTo(final double x0, final double y0)

Implements com.sun.marlin.DPathConsumer2D.moveTo.

Annotations
@Override
pathDoneback to summary
public void pathDone()

Implements com.sun.marlin.DPathConsumer2D.pathDone.

Doc from com.sun.marlin.DPathConsumer2D.pathDone.

Called after the last segment of the last subpath when the iteration of the path segments is completely done. This method serves to trigger the end of path processing in the consumer that would normally be triggered when a PathIterator returns true from its done method.

Annotations
@Override
quadToback to summary
public void quadTo(final double x1, final double y1, final double x2, final double y2)

Implements com.sun.marlin.DPathConsumer2D.quadTo.

Annotations
@Override
setMonotonizerStartFlagback to summary
public void setMonotonizerStartFlag(boolean first)
setStartFlagback to summary
public void setStartFlag(boolean first)

Implements com.sun.marlin.TransformingPathConsumer2D.StartFlagPathConsumer2D.setStartFlag.

Annotations
@Override
skipCurveToback to summary
private void skipCurveTo(final double x1, final double y1, final double x2, final double y2, final double x3, final double y3)
skipLenback to summary
public void skipLen()
skipLineToback to summary
private void skipLineTo(final double x1, final double y1)
skipQuadToback to summary
private void skipQuadTo(final double x1, final double y1, final double x2, final double y2)
skipSomethingToback to summary
private void skipSomethingTo(final int type)
somethingToback to summary
private void somethingTo(final int type)
com.sun.marlin back to summary

pack-priv final Class Dasher.LengthIterator

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private int
private final double[]
private int
private boolean
private final double[]
private double
private double
private double
private double
private double
private final double[]
private double
private final double[][]
private int
private final boolean[]

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private void
private void
private boolean
haveLowAcceleration(final double err)

pack-priv void
initializeIterationOnCurve(final double[] pts, final int type)

pack-priv double
pack-priv double
next(final double len)

private double
pack-priv void
reset()

Reset this LengthIterator.

pack-priv double
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cachedHaveLowAccelerationback to summary
private int cachedHaveLowAcceleration
curLeafCtrlPolyLengthsback to summary
private final double[] curLeafCtrlPolyLengths
curveTypeback to summary
private int curveType
doneback to summary
private boolean done
flatLeafCoefCacheback to summary
private final double[] flatLeafCoefCache
lastSegLenback to summary
private double lastSegLen
lastTback to summary
private double lastT
lenAtLastSplitback to summary
private double lenAtLastSplit
lenAtLastTback to summary
private double lenAtLastT
lenAtNextTback to summary
private double lenAtNextT
nextRootsback to summary
private final double[] nextRoots
nextTback to summary
private double nextT
recCurveStackback to summary
private final double[][] recCurveStack
recLevelback to summary
private int recLevel
sidesRightback to summary
private final boolean[] sidesRight

Constructor Detail

LengthIteratorback to summary
pack-priv LengthIterator()

Method Detail

goLeftback to summary
private void goLeft()
goToNextLeafback to summary
private void goToNextLeaf()
haveLowAccelerationback to summary
private boolean haveLowAcceleration(final double err)
initializeIterationOnCurveback to summary
pack-priv void initializeIterationOnCurve(final double[] pts, final int type)
lastSegLenback to summary
pack-priv double lastSegLen()
nextback to summary
pack-priv double next(final double len)
onLeafback to summary
private double onLeaf()
resetback to summary
pack-priv void reset()

Reset this LengthIterator.

totalLengthback to summary
pack-priv double totalLength()