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

[CSS] CHART_COLOR_XX not found

    XMLWordPrintable

Details

    Description

      The base chart colors (aka: CHART_COLOR_1 etc) are not accessible.

      To reproduce, run the example below and click "style"
      expected: color of rectangle changes to first of the base chart colors
      actual: color remains black, with following warning at the console:

      Jan 27, 2015 2:55:27 PM javafx.scene.CssStyleHelper calculateValue
      WARNING: Could not resolve 'CHART_COLOR_1' while resolving lookups for '-fx-fill' from inline style on Rectangle[x=0.0, y=0.0, width=300.0, height=400.0, fill=0x000000ff]

      Behaviour in 8u20 was as expected, so it looks like a regression to me.
        
      Example:

      /*
       * Created on 27.01.2015
       *
       */
      package de.swingempire.fx.scene.control.cell;

      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.Button;
      import javafx.scene.layout.HBox;
      import javafx.scene.shape.Rectangle;
      import javafx.stage.Stage;

      /**
       * Regression: CHART_COLOR_XX not accessible in 8u40b20,
       * works fine in 8u20
       *
       * @author Jeanette Winzenburg, Berlin
       */
      public class ChartColorCSS extends Application {

          public static void main(String[] args) {
              launch(args);
          }

          @Override
          public void start(Stage primaryStage) throws Exception {
              Rectangle r = new Rectangle(300, 400);
              Button button = new Button("style");
              button.setOnAction(e ->
                  r.setStyle("-fx-fill:CHART_COLOR_1;"));
              HBox root = new HBox(r, button);
              Scene scene = new Scene(root);
              primaryStage.setScene(scene);
              primaryStage.setTitle(System.getProperty("java.version"));
              primaryStage.show();
          }
          
      }

      (note, I don't know which component might be the appropirate, please correct :-)

      Attachments

        Activity

          People

            jgiles Jonathan Giles
            fastegal Jeanette Winzenburg
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported: