Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8124014

Shape3D.setMaterial(material) seems to be required to get the color to update

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Not an Issue
    • Affects Version/s: 8
    • Fix Version/s: 8
    • Component/s: javafx
    • Labels:

      Description

      Shape3D.setMaterial(material) seems to be required to get the color to update

      If this line isn't called inside the handle method:
          pointLight2Geo.setMaterial(pointLight2Material); // <-- this is required for color to update
      then the color doesn't update.

              final private Sphere pointLight2Geo = new Sphere(0.1);
      ...
              final PhongMaterial pointLight2Material = new PhongMaterial();
              pointLight2Material.setDiffuseColor(Color.LIGHTGREY);
              pointLight2Geo.setMaterial(pointLight2Material);
      ...
              final ColorPicker light2ColorPicker = new ColorPicker(pointLight2.getColor());
              light2ColorPicker.setOnAction(new EventHandler<ActionEvent>() {
                  @Override
                  public void handle(ActionEvent t) {
                      Color c = light2ColorPicker.getValue();
                      pointLight2.setColor(c);
                      pointLight2Material.setDiffuseColor(c);
                      pointLight2Geo.setMaterial(pointLight2Material); // <-- this is required for color to update
                  }
              });

        Attachments

          Activity

            People

            Assignee:
            yaow Yao Wang (Inactive)
            Reporter:
            jyoon John Yoon (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported: