/** * Assigns the default values to all the properties. * @param properties * @param values */ public void assignDefaults(Map<String, CSSProperty> properties, Map<String, Term<?>> values) { SupportedCSS css = CSSFactory.getSupportedCSS(); for (String name : names) { CSSProperty dp = css.getDefaultProperty(name); if (dp != null) properties.put(name, dp); Term<?> dv = css.getDefaultValue(name); if (dv != null) values.put(name, dv); } }
public NodeData concretize() { for(String key: map.keySet()) { Quadruple q = map.get(key); // replace current with inherited or defaults if(q.curProp!=null && q.curProp.equalsInherit()) { if(q.inhProp==null) q.curProp = css.getDefaultProperty(key); else { q.curProp = q.inhProp; q.curSource = q.inhSource; } if(q.inhValue==null) q.curValue = css.getDefaultValue(key); else q.curValue = q.inhValue; } map.put(key, q); } return this; }
/** * Assigns the default values to all the properties. * @param properties * @param values */ public void assignDefaults(Map<String, CSSProperty> properties, Map<String, Term<?>> values) { SupportedCSS css = CSSFactory.getSupportedCSS(); for (String name : names) { CSSProperty dp = css.getDefaultProperty(name); if (dp != null) properties.put(name, dp); Term<?> dv = css.getDefaultValue(name); if (dv != null) values.put(name, dv); } }
/** * Assigns the default values to all the properties. * @param properties * @param values */ public void assignDefaults(Map<String, CSSProperty> properties, Map<String, Term<?>> values) { SupportedCSS css = CSSFactory.getSupportedCSS(); for (String name : names) { CSSProperty dp = css.getDefaultProperty(name); if (dp != null) properties.put(name, dp); Term<?> dv = css.getDefaultValue(name); if (dv != null) values.put(name, dv); } }
/** * Assigns the default values to all the properties. * @param properties * @param values */ public void assignDefaults(Map<String, CSSProperty> properties, Map<String, Term<?>> values) { SupportedCSS css = CSSFactory.getSupportedCSS(); for (String name : names) { CSSProperty dp = css.getDefaultProperty(name); if (dp != null) properties.put(name, dp); Term<?> dv = css.getDefaultValue(name); if (dv != null) values.put(name, dv); } }
/** * Assigns the default values to all the properties. * @param properties * @param values */ public void assignDefaults(Map<String, CSSProperty> properties, Map<String, Term<?>> values) { SupportedCSS css = CSSFactory.getSupportedCSS(); for (String name : names) { CSSProperty dp = css.getDefaultProperty(name); if (dp != null) properties.put(name, dp); Term<?> dv = css.getDefaultValue(name); if (dv != null) values.put(name, dv); } }
/** * Assigns the default values to all the properties. * @param properties * @param values */ public void assignDefaults(Map<String, CSSProperty> properties, Map<String, Term<?>> values) { SupportedCSS css = CSSFactory.getSupportedCSS(); for (String name : names) { CSSProperty dp = css.getDefaultProperty(name); if (dp != null) properties.put(name, dp); Term<?> dv = css.getDefaultValue(name); if (dv != null) values.put(name, dv); } }
/** * Assigns the default values to all the properties. * @param properties * @param values */ public void assignDefaults(Map<String, CSSProperty> properties, Map<String, Term<?>> values) { SupportedCSS css = CSSFactory.getSupportedCSS(); for (String name : names) { CSSProperty dp = css.getDefaultProperty(name); if (dp != null) properties.put(name, dp); Term<?> dv = css.getDefaultValue(name); if (dv != null) values.put(name, dv); } }
/** * Assigns the default values to all the properties. * @param properties * @param values */ public void assignDefaults(Map<String, CSSProperty> properties, Map<String, Term<?>> values) { SupportedCSS css = CSSFactory.getSupportedCSS(); for (String name : names) { CSSProperty dp = css.getDefaultProperty(name); if (dp != null) properties.put(name, dp); Term<?> dv = css.getDefaultValue(name); if (dv != null) values.put(name, dv); } }
public NodeData concretize() { // inherited firstly, replace them with defaults for(String key: propertiesInh.keySet()) { CSSProperty p = propertiesInh.get(key); if(p.equalsInherit()) { propertiesInh.put(key, css.getDefaultProperty(key)); Term<?> value = css.getDefaultValue(key); if(value!=null) valuesInh.put(key, value); } } // own after, replace them with inherited or default for(String key:propertiesOwn.keySet()) { CSSProperty p = propertiesOwn.get(key); if(p.equalsInherit()) { CSSProperty rp = propertiesInh.get(key); if(rp==null) rp = css.getDefaultProperty(key); propertiesOwn.put(key, rp); Term<?> value = valuesInh.get(key); if(value==null) value = css.getDefaultValue(key); if(value!=null) valuesOwn.put(key, value); } } return this; }
public NodeData concretize() { // inherited firstly, replace them with defaults for(String key: propertiesInh.keySet()) { CSSProperty p = propertiesInh.get(key); if(p.equalsInherit()) { propertiesInh.put(key, css.getDefaultProperty(key)); Term<?> value = css.getDefaultValue(key); if(value!=null) valuesInh.put(key, value); } } // own after, replace them with inherited or default for(String key:propertiesOwn.keySet()) { CSSProperty p = propertiesOwn.get(key); if(p.equalsInherit()) { CSSProperty rp = propertiesInh.get(key); if(rp==null) rp = css.getDefaultProperty(key); propertiesOwn.put(key, rp); Term<?> value = valuesInh.get(key); if(value==null) value = css.getDefaultValue(key); if(value!=null) valuesOwn.put(key, value); } } return this; }
public NodeData concretize() { for(String key: map.keySet()) { Quadruple q = map.get(key); // replace inherited with defaults if(q.inhProp!=null && q.inhProp.equalsInherit()) { q.inhProp = css.getDefaultProperty(key); Term<?> value = css.getDefaultValue(key); if(value!=null) q.inhValue = value; } // replace current with inherited or defaults if(q.curProp!=null && q.curProp.equalsInherit()) { if(q.inhProp==null) q.curProp = css.getDefaultProperty(key); else q.curProp = q.inhProp; if(q.inhValue==null) q.curValue = css.getDefaultValue(key); else q.curValue = q.inhValue; } map.put(key, q); } return this; }
if(p.equalsInherit()) { propertiesInh.put(key, css.getDefaultProperty(key)); Term<?> value = css.getDefaultValue(key); if(value!=null) valuesInh.put(key, value); if(value==null) value = css.getDefaultValue(key); if(value!=null) valuesOwn.put(key, value); CSSProperty rp = css.getDefaultProperty(key); propertiesOwn.put(key, rp); Term<?> value = css.getDefaultValue(key); if (value != null) valuesOwn.put(key, value); if(value==null) value = css.getDefaultValue(key); if(value!=null) valuesOwn.put(key, value); } else { CSSProperty rp = css.getDefaultProperty(key); propertiesOwn.put(key, rp); Term<?> value = css.getDefaultValue(key); if (value != null) valuesOwn.put(key, value);
if(p.equalsInherit()) { propertiesInh.put(key, css.getDefaultProperty(key)); Term<?> value = css.getDefaultValue(key); if(value!=null) valuesInh.put(key, value); if(value==null) value = css.getDefaultValue(key); if(value!=null) valuesOwn.put(key, value); CSSProperty rp = css.getDefaultProperty(key); propertiesOwn.put(key, rp); Term<?> value = css.getDefaultValue(key); if (value != null) valuesOwn.put(key, value); if(value==null) value = css.getDefaultValue(key); if(value!=null) valuesOwn.put(key, value); } else { CSSProperty rp = css.getDefaultProperty(key); propertiesOwn.put(key, rp); Term<?> value = css.getDefaultValue(key); if (value != null) valuesOwn.put(key, value);
if(q.inhValue==null) q.curValue = css.getDefaultValue(key); else q.curValue = q.inhValue; } else if (q.curProp.equalsInitial()) { q.curProp = css.getDefaultProperty(key); q.curValue = css.getDefaultValue(key); map.put(key, q); } else if (q.curProp.equalsUnset()) { if(q.inhProp==null) q.curProp = css.getDefaultProperty(key); else q.curProp = q.inhProp; if(q.inhValue==null) q.curValue = css.getDefaultValue(key); else q.curValue = q.inhValue; } else { q.curProp = css.getDefaultProperty(key); q.curValue = css.getDefaultValue(key);
if(q.inhValue==null) q.curValue = css.getDefaultValue(key); else q.curValue = q.inhValue; } else if (q.curProp.equalsInitial()) { q.curProp = css.getDefaultProperty(key); q.curValue = css.getDefaultValue(key); map.put(key, q); } else if (q.curProp.equalsUnset()) { if(q.inhProp==null) q.curProp = css.getDefaultProperty(key); else q.curProp = q.inhProp; if(q.inhValue==null) q.curValue = css.getDefaultValue(key); else q.curValue = q.inhValue; } else { q.curProp = css.getDefaultProperty(key); q.curValue = css.getDefaultValue(key);
@Override public Term<?> getSpecifiedValue(String name) { Term<?> ret = getValue(name, true); if (ret == null) ret = css.getDefaultValue(name); if (ret != null) { if (ret instanceof TermColor && ((TermColor) ret).getKeyword() == Keyword.CURRENT_COLOR) { //clone the value fot setting the current color final TermFactory tf = CSSFactory.getTermFactory(); ret = tf.createColor(tf.createIdent("currentColor")); //set the current color value TermColor cvalue = getValue(TermColor.class, "color", true); if (cvalue == null) cvalue = (TermColor) css.getDefaultValue("color"); ((TermColor) ret).setValue(cvalue.getValue()); } } return ret; }
@Override public Term<?> getSpecifiedValue(String name) { Term<?> ret = getValue(name, true); if (ret == null) ret = css.getDefaultValue(name); if (ret != null) { if (ret instanceof TermColor && ((TermColor) ret).getKeyword() == Keyword.CURRENT_COLOR) { //clone the value fot setting the current color final TermFactory tf = CSSFactory.getTermFactory(); ret = tf.createColor(tf.createIdent("currentColor")); //set the current color value TermColor cvalue = getValue(TermColor.class, "color", true); if (cvalue == null) cvalue = (TermColor) css.getDefaultValue("color"); ((TermColor) ret).setValue(cvalue.getValue()); } } return ret; }