Java Code Examples for javafx.scene.shape.ArcType#ROUND

The following examples show how to use javafx.scene.shape.ArcType#ROUND . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FXGraphics2D.java    From openstock with GNU General Public License v3.0 5 votes vote down vote up
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);
}
 
Example 2
Source File: ArcRepresentation.java    From phoebus with Eclipse Public License 1.0 5 votes vote down vote up
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());
}
 
Example 3
Source File: FXGraphics2D.java    From ccu-historian with GNU General Public License v3.0 5 votes vote down vote up
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);
}
 
Example 4
Source File: FXGraphics2D.java    From SIMVA-SoS with Apache License 2.0 5 votes vote down vote up
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);
}
 
Example 5
Source File: FXGraphics2D.java    From ECG-Viewer with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example 6
Source File: ShapeConverter.java    From Enzo with Apache License 2.0 5 votes vote down vote up
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();
}
 
Example 7
Source File: FXGraphics2D.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
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);
}
 
Example 8
Source File: FXGraphics2D.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
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);
}