APIdia Launch Partner
Top Fields Constructors Methods
sun.java2d.marlin

pack-priv final Class Stroker

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

Field Summary

Modifier and TypeField and Description
private static final double
C

private boolean
private int
private double
private double
private double[]
private static final int
private double
private double
private int
pack-priv final Curve
private final TransformingPathConsumer2D.CurveClipSplitter
private double
private double
private static final int
private double
private static final double
private static final int
private double
private int
private double
private final double[]
private final double[]
private double
private boolean
private static final int
private final double[]
private final double[]
private final double[]
private boolean
private DPathConsumer2D
private int
pack-priv final RendererContext
private final Helpers.PolyStack
private static final double
private final double[]
private double
private double
private double
private double
private int
private static final double
private boolean
private double
private double

Constructor Summary

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

Constructs a Stroker.

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, final int outcode0)

private void
_moveTo(final double x0, final double y0, final int outcode)

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

public void
private static void
computeMiter(final double x0, final double y0, final double x1, final double y1, final double x0p, final double y0p, final double x1p, final double y1p, final double[] m)

private static void
computeOffset(final double lx, final double ly, final double w, final double[] m)

private int
computeOffsetCubic(final double[] pts, final int off, final double[] leftOff, final double[] rightOff)

private int
computeOffsetQuad(final double[] pts, final int off, final double[] leftOff, final double[] rightOff)

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

Implements sun.java2d.marlin.DPathConsumer2D.curveTo.

pack-priv void
pack-priv void
dispose()

Disposes this stroker: clean up before reusing this instance

private void
drawBezApproxForArc(final double cx, final double cy, final double omx, final double omy, final double mx, final double my, boolean rev)

private void
drawJoin(double pdx, double pdy, double x0, double y0, double dx, double dy, double omx, double omy, double mx, double my, final int outcode)

private void
drawMiter(final double pdx, final double pdy, final double x0, final double y0, final double dx, final double dy, double omx, double omy, double mx, double my, boolean rev)

private void
drawRoundCap(double cx, double cy, double mx, double my)

private void
drawRoundJoin(double cx, double cy, double omx, double omy, double mx, double my, boolean rev)

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

private void
emitCurveTo(final double x0, final double y0, final double x1, final double y1, final double x2, final double y2, final double x3, final double y3, final boolean rev)

private void
emitCurveToRev(final double x0, final double y0, final double x1, final double y1, final double x2, final double y2)

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

private void
emitLineTo(final double x1, final double y1, final boolean rev)

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

private void
emitMoveTo(final double x0, final double y0)

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

private void
emitQuadToRev(final double x0, final double y0, final double x1, final double y1)

private void
private void
finish(final int outcode)

private int
getLineOffsets(final double x1, final double y1, final double x2, final double y2, final double[] left, final double[] right)

public long
getNativeConsumer()

Implements sun.java2d.marlin.DPathConsumer2D.getNativeConsumer.

If a given PathConsumer performs all or most of its work natively then it can return a (non-zero) pointer to a native function vector that defines C functions for all of the above methods.

pack-priv Stroker

Returns:

this instance
init
(final DPathConsumer2D
an output DPathConsumer2D.
pc2d
,
final double
the desired line width in pixels
lineWidth
,
final int
the desired end cap style, one of CAP_BUTT, CAP_ROUND or CAP_SQUARE.
capStyle
,
final int
the desired line join style, one of JOIN_MITER, JOIN_ROUND or JOIN_BEVEL.
joinStyle
,
final double
the desired miter limit
miterLimit
,
final boolean
true to indicate to subdivide curves, false if dasher does
subdivideCurves
)

Inits the Stroker.

private static boolean
isCW(final double dx1, final double dy1, final double dx2, final double dy2)

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

Implements sun.java2d.marlin.DPathConsumer2D.lineTo.

private void
mayDrawRoundJoin(double cx, double cy, double omx, double omy, double mx, double my, boolean rev)

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

Implements sun.java2d.marlin.DPathConsumer2D.moveTo.

public void
pathDone()

Implements sun.java2d.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 sun.java2d.marlin.DPathConsumer2D.quadTo.

private static void
safeComputeMiter(final double x0, final double y0, final double x1, final double y1, final double x0p, final double y0p, final double x1p, final double y1p, final double[] m)

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

Cback to summary
private static final double C
capStartback to summary
private boolean capStart
capStyleback to summary
private int capStyle
cdxback to summary
private double cdx
cdyback to summary
private double cdy
clipRectback to summary
private double[] clipRect
CLOSEback to summary
private static final int CLOSE
cmxback to summary
private double cmx
cmyback to summary
private double cmy
cOutCodeback to summary
private int cOutCode
curveback to summary
pack-priv final Curve curve
curveSplitterback to summary
private final TransformingPathConsumer2D.CurveClipSplitter curveSplitter
cx0back to summary
private double cx0
cy0back to summary
private double cy0
DRAWING_OP_TOback to summary
private static final int DRAWING_OP_TO
invHalfLineWidth2Sqback to summary
private double invHalfLineWidth2Sq
JOIN_ERRORback to summary
private static final double JOIN_ERROR
JOIN_STYLEback to summary
private static final int JOIN_STYLE
joinLimitMinSqback to summary
private double joinLimitMinSq
joinStyleback to summary
private int joinStyle
lineWidth2back to summary
private double lineWidth2
lpback to summary
private final double[] lp
miterback to summary
private final double[] miter
miterLimitSqback to summary
private double miterLimitSq
monotonizeback to summary
private boolean monotonize
MOVE_TOback to summary
private static final int MOVE_TO
offset0back to summary
private final double[] offset0
offset1back to summary
private final double[] offset1
offset2back to summary
private final double[] offset2
openedback to summary
private boolean opened
outback to summary
private DPathConsumer2D out
prevback to summary
private int prev
rdrCtxback to summary
pack-priv final RendererContext rdrCtx
reverseback to summary
private final Helpers.PolyStack reverse
ROUND_JOIN_ERRORback to summary
private static final double ROUND_JOIN_ERROR
rpback to summary
private final double[] rp
sdxback to summary
private double sdx
sdyback to summary
private double sdy
smxback to summary
private double smx
smyback to summary
private double smy
sOutCodeback to summary
private int sOutCode
SQRT_2back to summary
private static final double SQRT_2
subdivideback to summary
private boolean subdivide
sx0back to summary
private double sx0
sy0back to summary
private double sy0

Constructor Detail

Strokerback to summary
pack-priv Stroker(final RendererContext rdrCtx)

Constructs a Stroker.

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, final int outcode0)
_moveToback to summary
private void _moveTo(final double x0, final double y0, final int outcode)
_quadToback to summary
private void _quadTo(final double x1, final double y1, final double x2, final double y2, final int outcode0)
closePathback to summary
public void closePath()

Implements sun.java2d.marlin.DPathConsumer2D.closePath.

Annotations
@Override
computeMiterback to summary
private static void computeMiter(final double x0, final double y0, final double x1, final double y1, final double x0p, final double y0p, final double x1p, final double y1p, final double[] m)
computeOffsetback to summary
private static void computeOffset(final double lx, final double ly, final double w, final double[] m)
computeOffsetCubicback to summary
private int computeOffsetCubic(final double[] pts, final int off, final double[] leftOff, final double[] rightOff)
computeOffsetQuadback to summary
private int computeOffsetQuad(final double[] pts, final int off, final double[] leftOff, final double[] rightOff)
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 sun.java2d.marlin.DPathConsumer2D.curveTo.

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

Disposes this stroker: clean up before reusing this instance

drawBezApproxForArcback to summary
private void drawBezApproxForArc(final double cx, final double cy, final double omx, final double omy, final double mx, final double my, boolean rev)
drawJoinback to summary
private void drawJoin(double pdx, double pdy, double x0, double y0, double dx, double dy, double omx, double omy, double mx, double my, final int outcode)
drawMiterback to summary
private void drawMiter(final double pdx, final double pdy, final double x0, final double y0, final double dx, final double dy, double omx, double omy, double mx, double my, boolean rev)
drawRoundCapback to summary
private void drawRoundCap(double cx, double cy, double mx, double my)
drawRoundJoinback to summary
private void drawRoundJoin(double cx, double cy, double omx, double omy, double mx, double my, boolean rev)
emitCloseback to summary
private void emitClose()
emitCurveToback to summary
private void emitCurveTo(final double x1, final double y1, final double x2, final double y2, final double x3, final double y3)
emitCurveToback to summary
private void emitCurveTo(final double x0, final double y0, final double x1, final double y1, final double x2, final double y2, final double x3, final double y3, final boolean rev)
emitCurveToRevback to summary
private void emitCurveToRev(final double x0, final double y0, final double x1, final double y1, final double x2, final double y2)
emitLineToback to summary
private void emitLineTo(final double x1, final double y1)
emitLineToback to summary
private void emitLineTo(final double x1, final double y1, final boolean rev)
emitLineToRevback to summary
private void emitLineToRev(final double x1, final double y1)
emitMoveToback to summary
private void emitMoveTo(final double x0, final double y0)
emitQuadToback to summary
private void emitQuadTo(final double x1, final double y1, final double x2, final double y2)
emitQuadToRevback to summary
private void emitQuadToRev(final double x0, final double y0, final double x1, final double y1)
emitReverseback to summary
private void emitReverse()
finishback to summary
private void finish(final int outcode)
getLineOffsetsback to summary
private int getLineOffsets(final double x1, final double y1, final double x2, final double y2, final double[] left, final double[] right)
getNativeConsumerback to summary
public long getNativeConsumer()

Implements sun.java2d.marlin.DPathConsumer2D.getNativeConsumer.

Doc from sun.java2d.marlin.DPathConsumer2D.getNativeConsumer.

If a given PathConsumer performs all or most of its work natively then it can return a (non-zero) pointer to a native function vector that defines C functions for all of the above methods. The specific pointer it returns is a pointer to a PathConsumerVec structure as defined in the include file src/share/native/sun/java2d/pipe/PathConsumer2D.h

Annotations
@Override
initback to summary
pack-priv Stroker init(final DPathConsumer2D pc2d, final double lineWidth, final int capStyle, final int joinStyle, final double miterLimit, final boolean subdivideCurves)

Inits the Stroker.

Parameters
pc2d:DPathConsumer2D

an output DPathConsumer2D.

lineWidth:double

the desired line width in pixels

capStyle:int

the desired end cap style, one of CAP_BUTT, CAP_ROUND or CAP_SQUARE.

joinStyle:int

the desired line join style, one of JOIN_MITER, JOIN_ROUND or JOIN_BEVEL.

miterLimit:double

the desired miter limit

subdivideCurves:boolean

true to indicate to subdivide curves, false if dasher does

Returns:Stroker

this instance

isCWback to summary
private static boolean isCW(final double dx1, final double dy1, final double dx2, final double dy2)
lineToback to summary
public void lineTo(final double x1, final double y1)

Implements sun.java2d.marlin.DPathConsumer2D.lineTo.

Annotations
@Override
mayDrawRoundJoinback to summary
private void mayDrawRoundJoin(double cx, double cy, double omx, double omy, double mx, double my, boolean rev)
moveToback to summary
public void moveTo(final double x0, final double y0)

Implements sun.java2d.marlin.DPathConsumer2D.moveTo.

Annotations
@Override
pathDoneback to summary
public void pathDone()

Implements sun.java2d.marlin.DPathConsumer2D.pathDone.

Doc from sun.java2d.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 sun.java2d.marlin.DPathConsumer2D.quadTo.

Annotations
@Override
safeComputeMiterback to summary
private static void safeComputeMiter(final double x0, final double y0, final double x1, final double y1, final double x0p, final double y0p, final double x1p, final double y1p, final double[] m)
setStartFlagback to summary
public void setStartFlag(boolean first)

Implements sun.java2d.marlin.TransformingPathConsumer2D.StartFlagPathConsumer2D.setStartFlag.

Annotations
@Override