本文整理汇总了Java中sun.awt.geom.PathConsumer2D类的典型用法代码示例。如果您正苦于以下问题:Java PathConsumer2D类的具体用法?Java PathConsumer2D怎么用?Java PathConsumer2D使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PathConsumer2D类属于sun.awt.geom包,在下文中一共展示了PathConsumer2D类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Stroker
import sun.awt.geom.PathConsumer2D; //导入依赖的package包/类
/**
* Constructs a <code>Stroker</code>.
*
* @param pc2d an output <code>PathConsumer2D</code>.
* @param lineWidth the desired line width in pixels
* @param capStyle the desired end cap style, one of
* <code>CAP_BUTT</code>, <code>CAP_ROUND</code> or
* <code>CAP_SQUARE</code>.
* @param joinStyle the desired line join style, one of
* <code>JOIN_MITER</code>, <code>JOIN_ROUND</code> or
* <code>JOIN_BEVEL</code>.
* @param miterLimit the desired miter limit
*/
public Stroker(PathConsumer2D pc2d,
float lineWidth,
int capStyle,
int joinStyle,
float miterLimit)
{
this.out = pc2d;
this.lineWidth2 = lineWidth / 2;
this.capStyle = capStyle;
this.joinStyle = joinStyle;
float limit = miterLimit * lineWidth2;
this.miterLimitSq = limit*limit;
this.prev = CLOSE;
}
示例2: pop
import sun.awt.geom.PathConsumer2D; //导入依赖的package包/类
public void pop(PathConsumer2D io) {
numCurves--;
int type = curveTypes[numCurves];
end -= (type - 2);
switch(type) {
case 8:
io.curveTo(curves[end+0], curves[end+1],
curves[end+2], curves[end+3],
curves[end+4], curves[end+5]);
break;
case 6:
io.quadTo(curves[end+0], curves[end+1],
curves[end+2], curves[end+3]);
break;
case 4:
io.lineTo(curves[end], curves[end+1]);
}
}
示例3: deltaTransformConsumer
import sun.awt.geom.PathConsumer2D; //导入依赖的package包/类
public static PathConsumer2D
deltaTransformConsumer(PathConsumer2D out,
AffineTransform at)
{
if (at == null) {
return out;
}
float Mxx = (float) at.getScaleX();
float Mxy = (float) at.getShearX();
float Myx = (float) at.getShearY();
float Myy = (float) at.getScaleY();
if (Mxy == 0f && Myx == 0f) {
if (Mxx == 1f && Myy == 1f) {
return out;
} else {
return new DeltaScaleFilter(out, Mxx, Myy);
}
} else {
return new DeltaTransformFilter(out, Mxx, Mxy, Myx, Myy);
}
}
示例4: inverseDeltaTransformConsumer
import sun.awt.geom.PathConsumer2D; //导入依赖的package包/类
public static PathConsumer2D
inverseDeltaTransformConsumer(PathConsumer2D out,
AffineTransform at)
{
if (at == null) {
return out;
}
float Mxx = (float) at.getScaleX();
float Mxy = (float) at.getShearX();
float Myx = (float) at.getShearY();
float Myy = (float) at.getScaleY();
if (Mxy == 0f && Myx == 0f) {
if (Mxx == 1f && Myy == 1f) {
return out;
} else {
return new DeltaScaleFilter(out, 1.0f/Mxx, 1.0f/Myy);
}
} else {
float det = Mxx * Myy - Mxy * Myx;
return new DeltaTransformFilter(out,
Myy / det,
-Mxy / det,
-Myx / det,
Mxx / det);
}
}
示例5: strokeTo
import sun.awt.geom.PathConsumer2D; //导入依赖的package包/类
public void strokeTo(Shape src,
AffineTransform at,
BasicStroke bs,
boolean thin,
boolean normalize,
boolean antialias,
PathConsumer2D consumer)
{
System.out.println(name+".strokeTo("+
src.getClass().getName()+", "+
at+", "+
bs+", "+
(thin ? "thin" : "wide")+", "+
(normalize ? "normalized" : "pure")+", "+
(antialias ? "AA" : "non-AA")+", "+
consumer.getClass().getName()+")");
target.strokeTo(src, at, bs, thin, normalize, antialias, consumer);
}
示例6: Stroker
import sun.awt.geom.PathConsumer2D; //导入依赖的package包/类
/**
* Constructs a {@code Stroker}.
*
* @param pc2d an output {@code PathConsumer2D}.
* @param lineWidth the desired line width in pixels
* @param capStyle the desired end cap style, one of
* {@code CAP_BUTT}, {@code CAP_ROUND} or
* {@code CAP_SQUARE}.
* @param joinStyle the desired line join style, one of
* {@code JOIN_MITER}, {@code JOIN_ROUND} or
* {@code JOIN_BEVEL}.
* @param miterLimit the desired miter limit
*/
public Stroker(PathConsumer2D pc2d,
float lineWidth,
int capStyle,
int joinStyle,
float miterLimit)
{
this.out = pc2d;
this.lineWidth2 = lineWidth / 2;
this.capStyle = capStyle;
this.joinStyle = joinStyle;
float limit = miterLimit * lineWidth2;
this.miterLimitSq = limit*limit;
this.prev = CLOSE;
}
示例7: init
import sun.awt.geom.PathConsumer2D; //导入依赖的package包/类
/**
* Inits the <code>Stroker</code>.
*
* @param pc2d an output <code>PathConsumer2D</code>.
* @param lineWidth the desired line width in pixels
* @param capStyle the desired end cap style, one of
* <code>CAP_BUTT</code>, <code>CAP_ROUND</code> or
* <code>CAP_SQUARE</code>.
* @param joinStyle the desired line join style, one of
* <code>JOIN_MITER</code>, <code>JOIN_ROUND</code> or
* <code>JOIN_BEVEL</code>.
* @param miterLimit the desired miter limit
* @return this instance
*/
Stroker init(PathConsumer2D pc2d,
float lineWidth,
int capStyle,
int joinStyle,
float miterLimit)
{
this.out = pc2d;
this.lineWidth2 = lineWidth / 2.0f;
this.invHalfLineWidth2Sq = 1.0f / (2.0f * lineWidth2 * lineWidth2);
this.capStyle = capStyle;
this.joinStyle = joinStyle;
float limit = miterLimit * lineWidth2;
this.miterLimitSq = limit * limit;
this.prev = CLOSE;
rdrCtx.stroking = 1;
return this; // fluent API
}
示例8: deltaTransformConsumer
import sun.awt.geom.PathConsumer2D; //导入依赖的package包/类
PathConsumer2D deltaTransformConsumer(PathConsumer2D out,
AffineTransform at)
{
if (at == null) {
return out;
}
float mxx = (float) at.getScaleX();
float mxy = (float) at.getShearX();
float myx = (float) at.getShearY();
float myy = (float) at.getScaleY();
if (mxy == 0.0f && myx == 0.0f) {
if (mxx == 1.0f && myy == 1.0f) {
return out;
} else {
return dt_DeltaScaleFilter.init(out, mxx, myy);
}
} else {
return dt_DeltaTransformFilter.init(out, mxx, mxy, myx, myy);
}
}
示例9: inverseDeltaTransformConsumer
import sun.awt.geom.PathConsumer2D; //导入依赖的package包/类
PathConsumer2D inverseDeltaTransformConsumer(PathConsumer2D out,
AffineTransform at)
{
if (at == null) {
return out;
}
float mxx = (float) at.getScaleX();
float mxy = (float) at.getShearX();
float myx = (float) at.getShearY();
float myy = (float) at.getScaleY();
if (mxy == 0.0f && myx == 0.0f) {
if (mxx == 1.0f && myy == 1.0f) {
return out;
} else {
return iv_DeltaScaleFilter.init(out, 1.0f/mxx, 1.0f/myy);
}
} else {
float det = mxx * myy - mxy * myx;
return iv_DeltaTransformFilter.init(out,
myy / det,
-mxy / det,
-myx / det,
mxx / det);
}
}
示例10: init
import sun.awt.geom.PathConsumer2D; //导入依赖的package包/类
/**
* Inits the <code>Stroker</code>.
*
* @param pc2d an output <code>PathConsumer2D</code>.
* @param lineWidth the desired line width in pixels
* @param capStyle the desired end cap style, one of
* <code>CAP_BUTT</code>, <code>CAP_ROUND</code> or
* <code>CAP_SQUARE</code>.
* @param joinStyle the desired line join style, one of
* <code>JOIN_MITER</code>, <code>JOIN_ROUND</code> or
* <code>JOIN_BEVEL</code>.
* @param miterLimit the desired miter limit
* @return this instance
*/
Stroker init(PathConsumer2D pc2d,
float lineWidth,
int capStyle,
int joinStyle,
float miterLimit)
{
this.out = pc2d;
this.lineWidth2 = lineWidth / 2f;
this.invHalfLineWidth2Sq = 1f / (2f * lineWidth2 * lineWidth2);
this.capStyle = capStyle;
this.joinStyle = joinStyle;
float limit = miterLimit * lineWidth2;
this.miterLimitSq = limit * limit;
this.prev = CLOSE;
rdrCtx.stroking = 1;
return this; // fluent API
}
示例11: deltaTransformConsumer
import sun.awt.geom.PathConsumer2D; //导入依赖的package包/类
PathConsumer2D deltaTransformConsumer(PathConsumer2D out,
AffineTransform at)
{
if (at == null) {
return out;
}
float mxx = (float) at.getScaleX();
float mxy = (float) at.getShearX();
float myx = (float) at.getShearY();
float myy = (float) at.getScaleY();
if (mxy == 0f && myx == 0f) {
if (mxx == 1f && myy == 1f) {
return out;
} else {
return dt_DeltaScaleFilter.init(out, mxx, myy);
}
} else {
return dt_DeltaTransformFilter.init(out, mxx, mxy, myx, myy);
}
}
示例12: inverseDeltaTransformConsumer
import sun.awt.geom.PathConsumer2D; //导入依赖的package包/类
PathConsumer2D inverseDeltaTransformConsumer(PathConsumer2D out,
AffineTransform at)
{
if (at == null) {
return out;
}
float mxx = (float) at.getScaleX();
float mxy = (float) at.getShearX();
float myx = (float) at.getShearY();
float myy = (float) at.getScaleY();
if (mxy == 0f && myx == 0f) {
if (mxx == 1f && myy == 1f) {
return out;
} else {
return iv_DeltaScaleFilter.init(out, 1.0f/mxx, 1.0f/myy);
}
} else {
float det = mxx * myy - mxy * myx;
return iv_DeltaTransformFilter.init(out,
myy / det,
-mxy / det,
-myx / det,
mxx / det);
}
}