modules/graphics/src/test/java/javafx/css/CssMetaDataTest.java
Print this page
rev 9240 : 8076423: JEP 253: Prepare JavaFX UI Controls & CSS APIs for Modularization
*** 21,31 ****
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
! package com.sun.javafx.css;
import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
--- 21,31 ----
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
! package javafx.css;
import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
*** 34,62 ****
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import com.sun.javafx.sg.prism.NGNode;
import javafx.beans.value.WritableValue;
- import javafx.css.CssMetaData;
- import javafx.css.FontCssMetaData;
- import javafx.css.PseudoClass;
- import javafx.css.StyleConverter;
- import javafx.css.StyleOrigin;
- import javafx.css.Styleable;
- import javafx.css.StyleableProperty;
import javafx.scene.Group;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
import javafx.stage.Stage;
! import com.sun.javafx.css.converters.BooleanConverter;
! import com.sun.javafx.css.parser.CSSParser;
import com.sun.javafx.geom.BaseBounds;
import com.sun.javafx.geom.transform.BaseTransform;
import com.sun.javafx.jmx.MXNodeAlgorithm;
import com.sun.javafx.jmx.MXNodeAlgorithmContext;
import org.junit.Test;
--- 34,59 ----
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Set;
+ import com.sun.javafx.css.ParsedValueImpl;
+ import com.sun.javafx.css.PseudoClassState;
+ import com.sun.javafx.css.StyleManager;
+ import com.sun.javafx.css.TestNode;
+ import com.sun.javafx.css.TestNodeBase;
import com.sun.javafx.sg.prism.NGNode;
import javafx.beans.value.WritableValue;
import javafx.scene.Group;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
import javafx.stage.Stage;
! import javafx.css.converter.BooleanConverter;
import com.sun.javafx.geom.BaseBounds;
import com.sun.javafx.geom.transform.BaseTransform;
import com.sun.javafx.jmx.MXNodeAlgorithm;
import com.sun.javafx.jmx.MXNodeAlgorithmContext;
import org.junit.Test;
*** 269,279 ****
List<String> rootStyleClass = new ArrayList<String>();
rootStyleClass.add("root");
Selector root = new SimpleSelector("*", rootStyleClass, null, null);
! ParsedValueImpl fxBaseValue = CSSParser.getInstance().parseExpr("-fx-base", "red");
Declaration fxBase = new Declaration("-fx-base", fxBaseValue, false);
ParsedValueImpl<String,String> fxColorValue = new ParsedValueImpl<String,String>(fxBase.getProperty(), null, true);
Declaration fxColor = new Declaration("-fx-color", fxColorValue, false);
--- 266,276 ----
List<String> rootStyleClass = new ArrayList<String>();
rootStyleClass.add("root");
Selector root = new SimpleSelector("*", rootStyleClass, null, null);
! ParsedValue fxBaseValue = new CssParser().parseExpr("-fx-base", "red");
Declaration fxBase = new Declaration("-fx-base", fxBaseValue, false);
ParsedValueImpl<String,String> fxColorValue = new ParsedValueImpl<String,String>(fxBase.getProperty(), null, true);
Declaration fxColor = new Declaration("-fx-color", fxColorValue, false);
*** 292,302 ****
List<String> rectStyleClass = new ArrayList<String>();
rectStyleClass.add("rect");
Selector rect = new SimpleSelector("*", rectStyleClass, null, null);
! ParsedValueImpl fxFillValue = CSSParser.getInstance().parseExpr("-fx-fill", "-fx-color");
Declaration fxFill = new Declaration("-fx-fill", fxFillValue, false);
selectors = new ArrayList<Selector>();
Collections.addAll(selectors, rect);
--- 289,299 ----
List<String> rectStyleClass = new ArrayList<String>();
rectStyleClass.add("rect");
Selector rect = new SimpleSelector("*", rectStyleClass, null, null);
! ParsedValue fxFillValue = new CssParser().parseExpr("-fx-fill", "-fx-color");
Declaration fxFill = new Declaration("-fx-fill", fxFillValue, false);
selectors = new ArrayList<Selector>();
Collections.addAll(selectors, rect);
*** 374,384 ****
List<String> rootStyleClass = new ArrayList<String>();
rootStyleClass.add("root");
Selector root = new SimpleSelector("*", rootStyleClass, null, null);
! ParsedValueImpl fxBaseValue = CSSParser.getInstance().parseExpr("-fx-base", "red");
Declaration fxBase = new Declaration("-fx-base", fxBaseValue, false);
ParsedValueImpl<String,String> fxColorValue = new ParsedValueImpl<String,String>(fxBase.getProperty(), null, true);
Declaration fxColor = new Declaration("-fx-color", fxColorValue, false);
--- 371,381 ----
List<String> rootStyleClass = new ArrayList<String>();
rootStyleClass.add("root");
Selector root = new SimpleSelector("*", rootStyleClass, null, null);
! ParsedValue fxBaseValue = new CssParser().parseExpr("-fx-base", "red");
Declaration fxBase = new Declaration("-fx-base", fxBaseValue, false);
ParsedValueImpl<String,String> fxColorValue = new ParsedValueImpl<String,String>(fxBase.getProperty(), null, true);
Declaration fxColor = new Declaration("-fx-color", fxColorValue, false);
*** 397,407 ****
List<String> rectStyleClass = new ArrayList<String>();
rectStyleClass.add("rect");
Selector rect = new SimpleSelector("*", rectStyleClass, null, null);
! ParsedValueImpl fxFillValue = CSSParser.getInstance().parseExpr("-fx-fill", "-fx-color");
Declaration fxFill = new Declaration("-fx-fill", fxFillValue, false);
selectors = new ArrayList<Selector>();
Collections.addAll(selectors, rect);
--- 394,404 ----
List<String> rectStyleClass = new ArrayList<String>();
rectStyleClass.add("rect");
Selector rect = new SimpleSelector("*", rectStyleClass, null, null);
! ParsedValue fxFillValue = new CssParser().parseExpr("-fx-fill", "-fx-color");
Declaration fxFill = new Declaration("-fx-fill", fxFillValue, false);
selectors = new ArrayList<Selector>();
Collections.addAll(selectors, rect);
*** 497,507 ****
List<String> rootStyleClass = new ArrayList<String>();
rootStyleClass.add("root");
Selector root = new SimpleSelector("*", rootStyleClass, null, null);
! ParsedValueImpl fxBaseValue = CSSParser.getInstance().parseExpr("-fx-base", "red");
Declaration fxBase = new Declaration("-fx-base", fxBaseValue, false);
ParsedValueImpl<String,String> fxColorValue = new ParsedValueImpl<String,String>(fxBase.getProperty(), null, true);
Declaration fxColor = new Declaration("-fx-color", fxColorValue, false);
--- 494,504 ----
List<String> rootStyleClass = new ArrayList<String>();
rootStyleClass.add("root");
Selector root = new SimpleSelector("*", rootStyleClass, null, null);
! ParsedValue fxBaseValue = new CssParser().parseExpr("-fx-base", "red");
Declaration fxBase = new Declaration("-fx-base", fxBaseValue, false);
ParsedValueImpl<String,String> fxColorValue = new ParsedValueImpl<String,String>(fxBase.getProperty(), null, true);
Declaration fxColor = new Declaration("-fx-color", fxColorValue, false);
*** 520,530 ****
List<String> rectStyleClass = new ArrayList<String>();
rectStyleClass.add("rect");
Selector rect = new SimpleSelector("*", rectStyleClass, null, null);
! ParsedValueImpl fxFillValue = CSSParser.getInstance().parseExpr("-fx-fill", "-fx-color");
Declaration fxFill = new Declaration("-fx-fill", fxFillValue, false);
selectors = new ArrayList<Selector>();
Collections.addAll(selectors, rect);
--- 517,527 ----
List<String> rectStyleClass = new ArrayList<String>();
rectStyleClass.add("rect");
Selector rect = new SimpleSelector("*", rectStyleClass, null, null);
! ParsedValue fxFillValue = new CssParser().parseExpr("-fx-fill", "-fx-color");
Declaration fxFill = new Declaration("-fx-fill", fxFillValue, false);
selectors = new ArrayList<Selector>();
Collections.addAll(selectors, rect);
*** 620,630 ****
List<String> rootStyleClass = new ArrayList<String>();
rootStyleClass.add("root");
Selector root = new SimpleSelector("*", rootStyleClass, null, null);
! ParsedValueImpl fxBaseValue = CSSParser.getInstance().parseExpr("-fx-base", "red");
Declaration fxBase = new Declaration("-fx-base", fxBaseValue, false);
ParsedValueImpl<String,String> fxColorValue = new ParsedValueImpl<String,String>(fxBase.getProperty(), null, true);
Declaration fxColor = new Declaration("-fx-color", fxColorValue, false);
--- 617,627 ----
List<String> rootStyleClass = new ArrayList<String>();
rootStyleClass.add("root");
Selector root = new SimpleSelector("*", rootStyleClass, null, null);
! ParsedValue fxBaseValue = new CssParser().parseExpr("-fx-base", "red");
Declaration fxBase = new Declaration("-fx-base", fxBaseValue, false);
ParsedValueImpl<String,String> fxColorValue = new ParsedValueImpl<String,String>(fxBase.getProperty(), null, true);
Declaration fxColor = new Declaration("-fx-color", fxColorValue, false);
*** 643,653 ****
List<String> rectStyleClass = new ArrayList<String>();
rectStyleClass.add("rect");
Selector rect = new SimpleSelector("*", rectStyleClass, null, null);
! ParsedValueImpl fxFillValue = CSSParser.getInstance().parseExpr("-fx-fill", "-fx-color");
Declaration fxFill = new Declaration("-fx-fill", fxFillValue, false);
selectors = new ArrayList<Selector>();
Collections.addAll(selectors, rect);
--- 640,650 ----
List<String> rectStyleClass = new ArrayList<String>();
rectStyleClass.add("rect");
Selector rect = new SimpleSelector("*", rectStyleClass, null, null);
! ParsedValue fxFillValue = new CssParser().parseExpr("-fx-fill", "-fx-color");
Declaration fxFill = new Declaration("-fx-fill", fxFillValue, false);
selectors = new ArrayList<Selector>();
Collections.addAll(selectors, rect);
*** 747,757 ****
List<String> rootStyleClass = new ArrayList<String>();
rootStyleClass.add("root");
Selector root = new SimpleSelector("*", rootStyleClass, null, null);
! ParsedValueImpl fxBaseValue = CSSParser.getInstance().parseExpr("-fx-base", "red");
Declaration fxBase = new Declaration("-fx-base", fxBaseValue, false);
ParsedValueImpl<String,String> fxColorValue = new ParsedValueImpl<String,String>(fxBase.getProperty(), null, true);
Declaration fxColor = new Declaration("-fx-color", fxColorValue, false);
--- 744,754 ----
List<String> rootStyleClass = new ArrayList<String>();
rootStyleClass.add("root");
Selector root = new SimpleSelector("*", rootStyleClass, null, null);
! ParsedValue fxBaseValue = new CssParser().parseExpr("-fx-base", "red");
Declaration fxBase = new Declaration("-fx-base", fxBaseValue, false);
ParsedValueImpl<String,String> fxColorValue = new ParsedValueImpl<String,String>(fxBase.getProperty(), null, true);
Declaration fxColor = new Declaration("-fx-color", fxColorValue, false);
*** 773,783 ****
List<String> rectStyleClass = new ArrayList<String>();
rectStyleClass.add("rect");
Selector rect = new SimpleSelector("*", rectStyleClass, null, null);
! ParsedValueImpl fxFillValue = CSSParser.getInstance().parseExpr("-fx-fill", "-fx-color");
Declaration fxFill = new Declaration("-fx-fill", fxFillValue, false);
selectors = new ArrayList<Selector>();
Collections.addAll(selectors, rect);
--- 770,780 ----
List<String> rectStyleClass = new ArrayList<String>();
rectStyleClass.add("rect");
Selector rect = new SimpleSelector("*", rectStyleClass, null, null);
! ParsedValue fxFillValue = new CssParser().parseExpr("-fx-fill", "-fx-color");
Declaration fxFill = new Declaration("-fx-fill", fxFillValue, false);
selectors = new ArrayList<Selector>();
Collections.addAll(selectors, rect);
*** 858,868 ****
//
// .root { -fx-base: red; -fx-color: -fx-base; }
//
Selector root = new SimpleSelector("*", rootStyleClass, null, null);
! ParsedValueImpl fxBaseValue = CSSParser.getInstance().parseExpr("-fx-base", "red");
Declaration fxBase = new Declaration("-fx-base", fxBaseValue, false);
ParsedValueImpl<String,String> fxColorValue = new ParsedValueImpl<String,String>(fxBase.getProperty(), null, true);
Declaration fxColor = new Declaration("-fx-color", fxColorValue, false);
--- 855,865 ----
//
// .root { -fx-base: red; -fx-color: -fx-base; }
//
Selector root = new SimpleSelector("*", rootStyleClass, null, null);
! ParsedValue fxBaseValue = new CssParser().parseExpr("-fx-base", "red");
Declaration fxBase = new Declaration("-fx-base", fxBaseValue, false);
ParsedValueImpl<String,String> fxColorValue = new ParsedValueImpl<String,String>(fxBase.getProperty(), null, true);
Declaration fxColor = new Declaration("-fx-color", fxColorValue, false);
*** 881,891 ****
//
// .rect { -fx-fill: -fx-color; }
//
Selector rect = new SimpleSelector("*", rectStyleClass, null, null);
! ParsedValueImpl fxFillValue = CSSParser.getInstance().parseExpr("-fx-fill", "-fx-color");
Declaration fxFill = new Declaration("-fx-fill", fxFillValue, false);
selectors = new ArrayList<Selector>();
Collections.addAll(selectors, rect);
--- 878,888 ----
//
// .rect { -fx-fill: -fx-color; }
//
Selector rect = new SimpleSelector("*", rectStyleClass, null, null);
! ParsedValue fxFillValue = new CssParser().parseExpr("-fx-fill", "-fx-color");
Declaration fxFill = new Declaration("-fx-fill", fxFillValue, false);
selectors = new ArrayList<Selector>();
Collections.addAll(selectors, rect);
*** 961,971 ****
List<String> rootStyleClass = new ArrayList<String>();
rootStyleClass.add("root");
Selector root = new SimpleSelector("*", rootStyleClass, null, null);
! ParsedValueImpl<Color,Color> fxFontShouldInheritValue = CSSParser.getInstance().parseExpr("-fx-font", "12px system");
Declaration fxFontShouldInherit = new Declaration("-fx-font", fxFontShouldInheritValue, false);
List<Selector> selectors = new ArrayList<Selector>();
Collections.addAll(selectors, root);
--- 958,968 ----
List<String> rootStyleClass = new ArrayList<String>();
rootStyleClass.add("root");
Selector root = new SimpleSelector("*", rootStyleClass, null, null);
! ParsedValue<Color,Color> fxFontShouldInheritValue = new CssParser().parseExpr("-fx-font", "12px system");
Declaration fxFontShouldInherit = new Declaration("-fx-font", fxFontShouldInheritValue, false);
List<Selector> selectors = new ArrayList<Selector>();
Collections.addAll(selectors, root);
*** 981,991 ****
List<String> textStyleClass = new ArrayList<String>();
textStyleClass.add("text");
Selector textSelector = new SimpleSelector("*", textStyleClass, null, null);
! ParsedValueImpl fxFillValue = CSSParser.getInstance().parseExpr("-fx-fill", "red");
Declaration fxFill = new Declaration("-fx-fill", fxFillValue, false);
selectors = new ArrayList<Selector>();
Collections.addAll(selectors, textSelector);
--- 978,988 ----
List<String> textStyleClass = new ArrayList<String>();
textStyleClass.add("text");
Selector textSelector = new SimpleSelector("*", textStyleClass, null, null);
! ParsedValue fxFillValue = new CssParser().parseExpr("-fx-fill", "red");
Declaration fxFill = new Declaration("-fx-fill", fxFillValue, false);
selectors = new ArrayList<Selector>();
Collections.addAll(selectors, textSelector);
*** 1041,1051 ****
List<String> rootStyleClass = new ArrayList<String>();
rootStyleClass.add("root");
Selector root = new SimpleSelector("*", rootStyleClass, null, null);
! ParsedValueImpl<Color,Color> fxFontShouldInheritValue = CSSParser.getInstance().parseExpr("-fx-font", "12px system");
Declaration fxFontShouldInherit = new Declaration("-fx-font", fxFontShouldInheritValue, false);
List<Selector> selectors = new ArrayList<Selector>();
Collections.addAll(selectors, root);
--- 1038,1048 ----
List<String> rootStyleClass = new ArrayList<String>();
rootStyleClass.add("root");
Selector root = new SimpleSelector("*", rootStyleClass, null, null);
! ParsedValue<Color,Color> fxFontShouldInheritValue = new CssParser().parseExpr("-fx-font", "12px system");
Declaration fxFontShouldInherit = new Declaration("-fx-font", fxFontShouldInheritValue, false);
List<Selector> selectors = new ArrayList<Selector>();
Collections.addAll(selectors, root);
*** 1061,1074 ****
List<String> rectStyleClass = new ArrayList<String>();
rectStyleClass.add("text");
Selector textSelector = new SimpleSelector("*", rectStyleClass, null, null);
! ParsedValueImpl fxFillValue = CSSParser.getInstance().parseExpr("-fx-fill", "red");
Declaration fxFill = new Declaration("-fx-fill", fxFillValue, false);
! ParsedValueImpl fxFontFamilyValue = CSSParser.getInstance().parseExpr("-fx-font-family", "arial");
Declaration fxFontFamily = new Declaration("-fx-font-family", fxFontFamilyValue, false);
selectors = new ArrayList<Selector>();
Collections.addAll(selectors, textSelector);
--- 1058,1071 ----
List<String> rectStyleClass = new ArrayList<String>();
rectStyleClass.add("text");
Selector textSelector = new SimpleSelector("*", rectStyleClass, null, null);
! ParsedValue fxFillValue = new CssParser().parseExpr("-fx-fill", "red");
Declaration fxFill = new Declaration("-fx-fill", fxFillValue, false);
! ParsedValue fxFontFamilyValue = new CssParser().parseExpr("-fx-font-family", "arial");
Declaration fxFontFamily = new Declaration("-fx-font-family", fxFontFamilyValue, false);
selectors = new ArrayList<Selector>();
Collections.addAll(selectors, textSelector);
*** 1254,1264 ****
@Test @org.junit.Ignore
public void testRT_24606() {
! final Stylesheet stylesheet = CSSParser.getInstance().parse(
".root { -fx-base: red; }" +
".group { -fx-color: -fx-base; }" +
".text { -fx-fill: -fx-color; }"
);
stylesheet.setOrigin(StyleOrigin.USER_AGENT);
--- 1251,1261 ----
@Test @org.junit.Ignore
public void testRT_24606() {
! final Stylesheet stylesheet = new CssParser().parse(
".root { -fx-base: red; }" +
".group { -fx-color: -fx-base; }" +
".text { -fx-fill: -fx-color; }"
);
stylesheet.setOrigin(StyleOrigin.USER_AGENT);