Beispiel #1
0
  private void setBody() {
    body = new Rectangle(0, 0, 300, 300);

    bodyTransform.llxProperty().bind(speaker.rightHipXProperty());
    bodyTransform.llyProperty().bind(speaker.rightHipYProperty());
    bodyTransform.ulxProperty().bind(speaker.rightShoulderXProperty());
    bodyTransform.ulyProperty().bind(speaker.rightShoulderYProperty());
    bodyTransform.urxProperty().bind(speaker.leftShoulderXProperty());
    bodyTransform.uryProperty().bind(speaker.leftShoulderYProperty());
    bodyTransform.lrxProperty().bind(speaker.leftHipXProperty());
    bodyTransform.lryProperty().bind(speaker.leftHipYProperty());

    body.setEffect(bodyTransform);
    getChildren().add(body);
  }
Beispiel #2
0
  private void setJointLine() {
    setLineProperty(
        headLine,
        speaker.headXProperty(),
        speaker.headYProperty(),
        speaker.neckXProperty(),
        speaker.neckYProperty());

    setLineProperty(
        rightUpperArm,
        speaker.rightShoulderXProperty(),
        speaker.rightShoulderYProperty(),
        speaker.rightElbowXProperty(),
        speaker.rightElbowYProperty());

    setLineProperty(
        rightForearm,
        speaker.rightElbowXProperty(),
        speaker.rightElbowYProperty(),
        speaker.rightHandXProperty(),
        speaker.rightHandYProperty());

    setLineProperty(
        leftUpperArm,
        speaker.leftShoulderXProperty(),
        speaker.leftShoulderYProperty(),
        speaker.leftElbowXProperty(),
        speaker.leftElbowYProperty());

    setLineProperty(
        leftForearm,
        speaker.leftElbowXProperty(),
        speaker.leftElbowYProperty(),
        speaker.leftHandXProperty(),
        speaker.leftHandYProperty());

    setLineProperty(
        rightUpperThigh,
        speaker.rightHipXProperty(),
        speaker.rightHipYProperty(),
        speaker.rightKneeXProperty(),
        speaker.rightKneeYProperty());

    setLineProperty(
        rightLowerThigh,
        speaker.rightKneeXProperty(),
        speaker.rightKneeYProperty(),
        speaker.rightFootXProperty(),
        speaker.rightFootYProperty());

    setLineProperty(
        leftUpperThigh,
        speaker.leftHipXProperty(),
        speaker.leftHipYProperty(),
        speaker.leftKneeXProperty(),
        speaker.leftKneeYProperty());

    setLineProperty(
        leftLowerThigh,
        speaker.leftKneeXProperty(),
        speaker.leftKneeYProperty(),
        speaker.leftFootXProperty(),
        speaker.leftFootYProperty());

    getChildren()
        .addAll(
            rightUpperArm,
            rightForearm,
            leftUpperArm,
            leftForearm,
            leftUpperThigh,
            leftLowerThigh,
            rightUpperThigh,
            rightLowerThigh);
  }