本文整理匯總了Java中javafx.scene.shape.ArcType.ROUND屬性的典型用法代碼示例。如果您正苦於以下問題:Java ArcType.ROUND屬性的具體用法?Java ArcType.ROUND怎麽用?Java ArcType.ROUND使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類javafx.scene.shape.ArcType
的用法示例。
在下文中一共展示了ArcType.ROUND屬性的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: intToArcType
private ArcType intToArcType(int t) {
if (t == Arc2D.CHORD) {
return ArcType.CHORD;
} else if (t == Arc2D.OPEN) {
return ArcType.OPEN;
} else if (t == Arc2D.PIE) {
return ArcType.ROUND;
}
throw new IllegalArgumentException("Unrecognised t: " + t);
}
示例2: convertArc
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();
}
示例3: updateColors
private void updateColors()
{
background = model_widget.propTransparent().getValue()
? Color.TRANSPARENT
: JFXUtil.convert(model_widget.propBackgroundColor().getValue());
arc_type = model_widget.propTransparent().getValue() ? ArcType.OPEN : ArcType.ROUND;
line_color = JFXUtil.convert(model_widget.propLineColor().getValue());
}
示例4: convertArc
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();
}