本文整理汇总了Java中sun.dc.path.PathException类的典型用法代码示例。如果您正苦于以下问题:Java PathException类的具体用法?Java PathException怎么用?Java PathException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PathException类属于sun.dc.path包,在下文中一共展示了PathException类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: RPGProject
import sun.dc.path.PathException; //导入依赖的package包/类
/**
* RPGProject Constructor
*
* @param path - Path to the RPG-Maker-Project
* @param verifyRPGDir - true if the RPG-Maker-Directory should verified
* @throws PathException - Path doesn't exists/Not Valid-Dir exception
*/
RPGProject(@NotNull String path, boolean verifyRPGDir) throws PathException {
if(! File.existsDir(path))
throw new PathException("Project-Path doesn't exists!");
this.setPath(path);
// Check if Path is a Valid-RPG-Maker-Dir
if(verifyRPGDir)
if(! this.verifyDir())
throw new PathException("Directory is not a Valid RPG-Maker-MV Directory!");
this.loadFiles();
this.findSystemFile();
if(this.getSystem() != null)
this.checkIfEncrypted();
if(this.isEncrypted())
this.findEncryptedFiles();
}
示例2: strokeTo
import sun.dc.path.PathException; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void strokeTo(Shape src,
AffineTransform transform,
BasicStroke bs,
boolean thin,
boolean normalize,
boolean antialias,
PathConsumer2D sr)
{
PathStroker stroker = new PathStroker(sr);
PathConsumer consumer = stroker;
float matrix[] = null;
if (!thin) {
stroker.setPenDiameter(bs.getLineWidth());
if (transform != null) {
matrix = getTransformMatrix(transform);
}
stroker.setPenT4(matrix);
stroker.setPenFitting(PenUnits, MinPenUnits);
}
stroker.setCaps(RasterizerCaps[bs.getEndCap()]);
stroker.setCorners(RasterizerCorners[bs.getLineJoin()],
bs.getMiterLimit());
float[] dashes = bs.getDashArray();
if (dashes != null) {
PathDasher dasher = new PathDasher(stroker);
dasher.setDash(dashes, bs.getDashPhase());
if (transform != null && matrix == null) {
matrix = getTransformMatrix(transform);
}
dasher.setDashT4(matrix);
consumer = dasher;
}
try {
PathIterator pi = src.getPathIterator(transform);
feedConsumer(pi, consumer, normalize, 0.25f);
} catch (PathException e) {
throw new InternalError("Unable to Stroke shape ("+
e.getMessage()+")", e);
} finally {
while (consumer != null && consumer != sr) {
PathConsumer next = consumer.getConsumer();
consumer.dispose();
consumer = next;
}
}
}
示例3: feedConsumer
import sun.dc.path.PathException; //导入依赖的package包/类
private void feedConsumer(PathConsumer consumer, PathIterator pi) {
try {
consumer.beginPath();
boolean pathClosed = false;
float mx = 0.0f;
float my = 0.0f;
float point[] = new float[6];
while (!pi.isDone()) {
int type = pi.currentSegment(point);
if (pathClosed == true) {
pathClosed = false;
if (type != PathIterator.SEG_MOVETO) {
// Force current point back to last moveto point
consumer.beginSubpath(mx, my);
}
}
switch (type) {
case PathIterator.SEG_MOVETO:
mx = point[0];
my = point[1];
consumer.beginSubpath(point[0], point[1]);
break;
case PathIterator.SEG_LINETO:
consumer.appendLine(point[0], point[1]);
break;
case PathIterator.SEG_QUADTO:
consumer.appendQuadratic(point[0], point[1],
point[2], point[3]);
break;
case PathIterator.SEG_CUBICTO:
consumer.appendCubic(point[0], point[1],
point[2], point[3],
point[4], point[5]);
break;
case PathIterator.SEG_CLOSE:
consumer.closedSubpath();
pathClosed = true;
break;
}
pi.next();
}
consumer.endPath();
} catch (PathException e) {
throw new InternalError("Unable to Stroke shape ("+
e.getMessage()+")", e);
}
}
示例4: useProxy
import sun.dc.path.PathException; //导入依赖的package包/类
public void useProxy(FastPathProducer proxy)
throws PathException
{
proxy.sendTo(this);
}
示例5: feedConsumer
import sun.dc.path.PathException; //导入依赖的package包/类
private void feedConsumer(PathConsumer consumer, PathIterator pi) {
try {
consumer.beginPath();
boolean pathClosed = false;
float mx = 0.0f;
float my = 0.0f;
float point[] = new float[6];
while (!pi.isDone()) {
int type = pi.currentSegment(point);
if (pathClosed == true) {
pathClosed = false;
if (type != PathIterator.SEG_MOVETO) {
// Force current point back to last moveto point
consumer.beginSubpath(mx, my);
}
}
switch (type) {
case PathIterator.SEG_MOVETO:
mx = point[0];
my = point[1];
consumer.beginSubpath(point[0], point[1]);
break;
case PathIterator.SEG_LINETO:
consumer.appendLine(point[0], point[1]);
break;
case PathIterator.SEG_QUADTO:
// Quadratic curves take two points
consumer.appendQuadratic(point[0], point[1],
point[2], point[3]);
break;
case PathIterator.SEG_CUBICTO:
// Cubic curves take three points
consumer.appendCubic(point[0], point[1],
point[2], point[3],
point[4], point[5]);
break;
case PathIterator.SEG_CLOSE:
consumer.closedSubpath();
pathClosed = true;
break;
}
pi.next();
}
consumer.endPath();
} catch (PathException e) {
throw new InternalError("Unable to Stroke shape ("+
e.getMessage()+")");
}
}
示例6: strokeTo
import sun.dc.path.PathException; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void strokeTo(Shape src,
AffineTransform transform,
BasicStroke bs,
boolean thin,
boolean normalize,
boolean antialias,
PathConsumer2D sr)
{
PathStroker stroker = new PathStroker(sr);
PathConsumer consumer = stroker;
float matrix[] = null;
if (!thin) {
stroker.setPenDiameter(bs.getLineWidth());
if (transform != null) {
matrix = getTransformMatrix(transform);
}
stroker.setPenT4(matrix);
stroker.setPenFitting(PenUnits, MinPenUnits);
}
stroker.setCaps(RasterizerCaps[bs.getEndCap()]);
stroker.setCorners(RasterizerCorners[bs.getLineJoin()],
bs.getMiterLimit());
float[] dashes = bs.getDashArray();
if (dashes != null) {
PathDasher dasher = new PathDasher(stroker);
dasher.setDash(dashes, bs.getDashPhase());
if (transform != null && matrix == null) {
matrix = getTransformMatrix(transform);
}
dasher.setDashT4(matrix);
consumer = dasher;
}
try {
PathIterator pi = src.getPathIterator(transform);
feedConsumer(pi, consumer, normalize, 0.25f);
} catch (PathException e) {
throw new InternalError("Unable to Stroke shape ("+
e.getMessage()+")");
} finally {
while (consumer != null && consumer != sr) {
PathConsumer next = consumer.getConsumer();
consumer.dispose();
consumer = next;
}
}
}
示例7: feedConsumer
import sun.dc.path.PathException; //导入依赖的package包/类
private void feedConsumer(PathConsumer consumer, PathIterator pi) {
try {
consumer.beginPath();
boolean pathClosed = false;
float mx = 0.0f;
float my = 0.0f;
float point[] = new float[6];
while (!pi.isDone()) {
int type = pi.currentSegment(point);
if (pathClosed == true) {
pathClosed = false;
if (type != PathIterator.SEG_MOVETO) {
// Force current point back to last moveto point
consumer.beginSubpath(mx, my);
}
}
switch (type) {
case PathIterator.SEG_MOVETO:
mx = point[0];
my = point[1];
consumer.beginSubpath(point[0], point[1]);
break;
case PathIterator.SEG_LINETO:
consumer.appendLine(point[0], point[1]);
break;
case PathIterator.SEG_QUADTO:
consumer.appendQuadratic(point[0], point[1],
point[2], point[3]);
break;
case PathIterator.SEG_CUBICTO:
consumer.appendCubic(point[0], point[1],
point[2], point[3],
point[4], point[5]);
break;
case PathIterator.SEG_CLOSE:
consumer.closedSubpath();
pathClosed = true;
break;
}
pi.next();
}
consumer.endPath();
} catch (PathException e) {
throw new InternalError("Unable to Stroke shape ("+
e.getMessage()+")");
}
}