本文整理汇总了Java中javafx.scene.shape.Arc.getRadiusY方法的典型用法代码示例。如果您正苦于以下问题:Java Arc.getRadiusY方法的具体用法?Java Arc.getRadiusY怎么用?Java Arc.getRadiusY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.shape.Arc
的用法示例。
在下文中一共展示了Arc.getRadiusY方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: convertArc
import javafx.scene.shape.Arc; //导入方法依赖的package包/类
public static String convertArc(final Arc ARC) {
StringBuilder fxPath = new StringBuilder();
double centerX = ARC.getCenterX();
double centerY = ARC.getCenterY();
double radiusX = ARC.getRadiusX();
double radiusY = ARC.getRadiusY();
double startAngle = Math.toRadians(-ARC.getStartAngle());
double endAngle = Math.toRadians(-ARC.getStartAngle() - ARC.getLength());
double length = ARC.getLength();
double startX = radiusX * Math.cos(startAngle);
double startY = radiusY * Math.sin(startAngle);
double endX = centerX + radiusX * Math.cos(endAngle);
double endY = centerY + radiusY * Math.sin(endAngle);
int xAxisRot = 0;
int largeArc = (length > 180) ? 1 : 0;
int sweep = (length < 0) ? 1 : 0;
fxPath.append("M ").append(centerX).append(" ").append(centerY).append(" ");
if (ArcType.ROUND == ARC.getType()) {
fxPath.append("l ").append(startX).append(" ").append(startY).append(" ");
}
fxPath.append("A ").append(radiusX).append(" ").append(radiusY).append(" ")
.append(xAxisRot).append(" ").append(largeArc).append(" ").append(sweep).append(" ")
.append(endX).append(" ").append(endY).append(" ");
if (ArcType.CHORD == ARC.getType() || ArcType.ROUND == ARC.getType()) {
fxPath.append("Z");
}
return fxPath.toString();
}
示例2: convertArc
import javafx.scene.shape.Arc; //导入方法依赖的package包/类
public static String convertArc(final Arc ARC) {
StringBuilder fxPath = new StringBuilder();
double centerX = ARC.getCenterX();
double centerY = ARC.getCenterY();
double radiusX = ARC.getRadiusX();
double radiusY = ARC.getRadiusY();
double startAngle = Math.toRadians(-ARC.getStartAngle());
double endAngle = Math.toRadians(-ARC.getStartAngle() - ARC.getLength());
double length = ARC.getLength();
double startX = radiusX * Math.cos(startAngle);
double startY = radiusY * Math.sin(startAngle);
double endX = centerX + radiusX * Math.cos(endAngle);
double endY = centerY + radiusY * Math.sin(endAngle);
int xAxisRot = 0;
int largeArc = (length > 180) ? 1 : 0;
int sweep = (length < 0) ? 1 : 0;
fxPath.append("M ").append(centerX).append(" ").append(centerY).append(" ");
if (ArcType.ROUND == ARC.getType()) {
fxPath.append("l ").append(startX).append(" ").append(startY).append(" ");
}
fxPath
.append("A ")
.append(radiusX)
.append(" ")
.append(radiusY)
.append(" ")
.append(xAxisRot)
.append(" ")
.append(largeArc)
.append(" ")
.append(sweep)
.append(" ")
.append(endX)
.append(" ")
.append(endY)
.append(" ");
if (ArcType.CHORD == ARC.getType() || ArcType.ROUND == ARC.getType()) {
fxPath.append("Z");
}
return fxPath.toString();
}