本文整理汇总了Java中sun.awt.SunHints.INTVAL_STROKE_PURE属性的典型用法代码示例。如果您正苦于以下问题:Java SunHints.INTVAL_STROKE_PURE属性的具体用法?Java SunHints.INTVAL_STROKE_PURE怎么用?Java SunHints.INTVAL_STROKE_PURE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类sun.awt.SunHints
的用法示例。
在下文中一共展示了SunHints.INTVAL_STROKE_PURE属性的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderPath
public void renderPath(SunGraphics2D sg, Shape s, BasicStroke bs) {
boolean adjust = (bs != null &&
sg.strokeHint != SunHints.INTVAL_STROKE_PURE);
boolean thin = (sg.strokeState <= SunGraphics2D.STROKE_THINDASHED);
Region clip = sg.getCompClip();
int abox[] = new int[4];
AATileGenerator aatg =
renderengine.getAATileGenerator(s, sg.transform, clip,
bs, thin, adjust, abox);
if (aatg == null) {
// Nothing to render
return;
}
renderTiles(sg, s, aatg, abox);
}
示例2: getStrokeSpans
public static ShapeSpanIterator getStrokeSpans(SunGraphics2D sg2d,
Shape s)
{
ShapeSpanIterator sr = new ShapeSpanIterator(false);
try {
sr.setOutputArea(sg2d.getCompClip());
sr.setRule(PathIterator.WIND_NON_ZERO);
BasicStroke bs = (BasicStroke) sg2d.stroke;
boolean thin = (sg2d.strokeState <= SunGraphics2D.STROKE_THINDASHED);
boolean normalize =
(sg2d.strokeHint != SunHints.INTVAL_STROKE_PURE);
RenderEngine.strokeTo(s,
sg2d.transform, bs,
thin, normalize, false, sr);
} catch (Throwable t) {
sr.dispose();
sr = null;
throw new InternalError("Unable to Stroke shape ("+
t.getMessage()+")", t);
}
return sr;
}
示例3: renderPath
public void renderPath(SunGraphics2D sg, Shape s, BasicStroke bs) {
final boolean adjust = (bs != null &&
sg.strokeHint != SunHints.INTVAL_STROKE_PURE);
final boolean thin = (sg.strokeState <= SunGraphics2D.STROKE_THINDASHED);
final TileState ts = TILE_STATE_PROVIDER.acquire();
try {
final int[] abox = ts.abox;
final AATileGenerator aatg =
RDR_ENGINE.getAATileGenerator(s, sg.transform, sg.getCompClip(),
bs, thin, adjust, abox);
if (aatg != null) {
renderTiles(sg, s, aatg, abox, ts);
}
} finally {
TILE_STATE_PROVIDER.release(ts);
}
}
示例4: renderPath
public void renderPath(SunGraphics2D sg, Shape s, BasicStroke bs) {
final boolean adjust = (bs != null &&
sg.strokeHint != SunHints.INTVAL_STROKE_PURE);
final boolean thin = (sg.strokeState <= SunGraphics2D.STROKE_THINDASHED);
final TileState ts = tileStateProvider.acquire();
try {
final int[] abox = ts.abox;
final AATileGenerator aatg =
renderengine.getAATileGenerator(s, sg.transform, sg.getCompClip(),
bs, thin, adjust, abox);
if (aatg != null) {
renderTiles(sg, s, aatg, abox, ts);
}
} finally {
tileStateProvider.release(ts);
}
}
示例5: renderPath
public void renderPath(SunGraphics2D sg, Shape s, BasicStroke bs) {
final boolean adjust = (bs != null
&& sg.strokeHint != SunHints.INTVAL_STROKE_PURE);
final boolean thin = (sg.strokeState <= SunGraphics2D.STROKE_THINDASHED);
final TileState ts = tileStateProvider.acquire();
try {
final int[] abox = ts.abox;
final AATileGenerator aatg
= renderengine.getAATileGenerator(s, sg.transform, sg.getCompClip(),
bs, thin, adjust, abox);
if (aatg != null) {
renderTiles(sg, s, aatg, abox, ts);
}
} finally {
tileStateProvider.release(ts);
}
}
示例6: renderPath
public void renderPath(SunGraphics2D sg, Shape s, BasicStroke bs) {
boolean adjust = (bs != null &&
sg.strokeHint != SunHints.INTVAL_STROKE_PURE);
boolean thin = (sg.strokeState <= sg.STROKE_THINDASHED);
Region clip = sg.getCompClip();
int abox[] = new int[4];
AATileGenerator aatg =
renderengine.getAATileGenerator(s, sg.transform, clip,
bs, thin, adjust, abox);
if (aatg == null) {
// Nothing to render
return;
}
renderTiles(sg, s, aatg, abox);
}
示例7: getStrokeSpans
public static ShapeSpanIterator getStrokeSpans(SunGraphics2D sg2d,
Shape s)
{
ShapeSpanIterator sr = new ShapeSpanIterator(false);
try {
sr.setOutputArea(sg2d.getCompClip());
sr.setRule(PathIterator.WIND_NON_ZERO);
BasicStroke bs = (BasicStroke) sg2d.stroke;
boolean thin = (sg2d.strokeState <= sg2d.STROKE_THINDASHED);
boolean normalize =
(sg2d.strokeHint != SunHints.INTVAL_STROKE_PURE);
RenderEngine.strokeTo(s,
sg2d.transform, bs,
thin, normalize, false, sr);
} catch (Throwable t) {
sr.dispose();
sr = null;
t.printStackTrace();
throw new InternalError("Unable to Stroke shape ("+
t.getMessage()+")");
}
return sr;
}
示例8: renderPath
public void renderPath(SunGraphics2D sg, Shape s, BasicStroke bs) {
boolean adjust = (bs != null &&
sg.strokeHint != SunHints.INTVAL_STROKE_PURE);
boolean thin = (sg.strokeState <= SunGraphics2D.STROKE_THINDASHED);
Region clip = sg.getCompClip();
final TileState ts = tileStateThreadLocal.get();
final int[] abox = ts.abox;
AATileGenerator aatg =
renderengine.getAATileGenerator(s, sg.transform, clip,
bs, thin, adjust, abox);
if (aatg == null) {
// Nothing to render
return;
}
renderTiles(sg, s, aatg, abox, ts);
}
示例9: fillRectangle
public void fillRectangle(SunGraphics2D sg2d,
double rx, double ry,
double rw, double rh)
{
double px, py;
double dx1, dy1, dx2, dy2;
AffineTransform txform = sg2d.transform;
dx1 = txform.getScaleX();
dy1 = txform.getShearY();
dx2 = txform.getShearX();
dy2 = txform.getScaleY();
px = rx * dx1 + ry * dx2 + txform.getTranslateX();
py = rx * dy1 + ry * dy2 + txform.getTranslateY();
dx1 *= rw;
dy1 *= rw;
dx2 *= rh;
dy2 *= rh;
if (adjustfill &&
sg2d.strokeState < SunGraphics2D.STROKE_CUSTOM &&
sg2d.strokeHint != SunHints.INTVAL_STROKE_PURE)
{
double newx = normalize(px);
double newy = normalize(py);
dx1 = normalize(px + dx1) - newx;
dy1 = normalize(py + dy1) - newy;
dx2 = normalize(px + dx2) - newx;
dy2 = normalize(py + dy2) - newy;
px = newx;
py = newy;
}
outrenderer.fillParallelogram(sg2d, rx, ry, rx+rw, ry+rh,
px, py, dx1, dy1, dx2, dy2);
}
示例10: drawRectangle
public void drawRectangle(SunGraphics2D sg2d,
double rx, double ry,
double rw, double rh,
double lw)
{
double px, py;
double dx1, dy1, dx2, dy2;
double lw1, lw2;
AffineTransform txform = sg2d.transform;
dx1 = txform.getScaleX();
dy1 = txform.getShearY();
dx2 = txform.getShearX();
dy2 = txform.getScaleY();
px = rx * dx1 + ry * dx2 + txform.getTranslateX();
py = rx * dy1 + ry * dy2 + txform.getTranslateY();
// lw along dx1,dy1 scale by transformed length of dx2,dy2 vectors
// and vice versa
lw1 = len(dx1, dy1) * lw;
lw2 = len(dx2, dy2) * lw;
dx1 *= rw;
dy1 *= rw;
dx2 *= rh;
dy2 *= rh;
if (sg2d.strokeState < SunGraphics2D.STROKE_CUSTOM &&
sg2d.strokeHint != SunHints.INTVAL_STROKE_PURE)
{
double newx = normalize(px);
double newy = normalize(py);
dx1 = normalize(px + dx1) - newx;
dy1 = normalize(py + dy1) - newy;
dx2 = normalize(px + dx2) - newx;
dy2 = normalize(py + dy2) - newy;
px = newx;
py = newy;
}
lw1 = Math.max(lw1, minPenSize);
lw2 = Math.max(lw2, minPenSize);
double len1 = len(dx1, dy1);
double len2 = len(dx2, dy2);
if (lw1 >= len1 || lw2 >= len2) {
// The line widths are large enough to consume the
// entire hole in the middle of the parallelogram
// so we can just fill the outer parallelogram.
fillOuterParallelogram(sg2d,
rx, ry, rx+rw, ry+rh,
px, py, dx1, dy1, dx2, dy2,
len1, len2, lw1, lw2);
} else {
outrenderer.drawParallelogram(sg2d,
rx, ry, rx+rw, ry+rh,
px, py, dx1, dy1, dx2, dy2,
lw1 / len1, lw2 / len2);
}
}
示例11: getFillSSI
/**
* Return a ShapeSpanIterator instance that normalizes as
* appropriate for a fill operation as per the settings in
* the specified SunGraphics2D object.
*
* The ShapeSpanIterator will be newly constructed and ready
* to start taking in geometry.
*
* Note that the caller is responsible for calling dispose()
* on the returned ShapeSpanIterator inside a try/finally block:
* <pre>
* ShapeSpanIterator ssi = LoopPipe.getFillSSI(sg2d);
* try {
* ssi.setOutputArea(clip);
* ssi.appendPath(...); // or appendPoly
* // iterate the spans from ssi and operate on them
* } finally {
* ssi.dispose();
* }
* </pre>
*/
public static ShapeSpanIterator getFillSSI(SunGraphics2D sg2d) {
boolean adjust = ((sg2d.stroke instanceof BasicStroke) &&
sg2d.strokeHint != SunHints.INTVAL_STROKE_PURE);
return new ShapeSpanIterator(adjust);
}