/** * Computes a CSS {@link Value} and performance inheritance if the * specified value is 'inherit'. */ protected Value computeValue(CSSStylableElement elt, String pn, Value v) { ValueManager[] vms = cssEngine.getValueManagers(); int idx = cssEngine.getPropertyIndex(pn); if (idx != -1) { if (v.getCssValueType() == CSSValue.CSS_INHERIT) { elt = CSSEngine.getParentCSSStylableElement(elt); if (elt != null) { return cssEngine.getComputedStyle(elt, null, idx); } return vms[idx].getDefaultValue(); } v = vms[idx].computeValue(elt, null, cssEngine, idx, dummyStyleMap, v); } return v; } }
/** * Returns the name of the property at the given index. */ public String getPropertyName(int idx) { return valueManagers[idx].getPropertyName(); }
/** * Returns the type of the given property. */ public int getPropertyType(String pn) { AbstractStylableDocument doc = (AbstractStylableDocument) ownerDocument; CSSEngine eng = doc.getCSSEngine(); int idx = eng.getPropertyIndex(pn); if (idx != -1) { ValueManager[] vms = eng.getValueManagers(); return vms[idx].getPropertyType(); } return SVGTypes.TYPE_UNKNOWN; }
LexicalUnit lu; lu = parser.parsePropertyValue(value); return vm.createValue(lu, this); } catch (Exception e) { String m = e.getMessage(); cssBaseURI = null; return vm.getDefaultValue();
CSSStylableElement p = getParentCSSStylableElement(elt); if (value == null) { if ((p == null) || !vm.isInheritedProperty()) result = vm.getDefaultValue(); } else if ((p != null) && (value == InheritValue.INSTANCE)) { result = null; } else { result = vm.computeValue(elt, pseudo, this, propidx, sm, result);
public void property(String pname, LexicalUnit lu, boolean important) { int idx = getPropertyIndex(pname); if (idx != -1) { ValueManager vm = valueManagers[idx]; Value v = vm.createValue(lu, CSSEngine.this); dst.setMainProperty(pname, v, important); return; } idx = getShorthandIndex(pname); if (idx == -1) return; // Unknown property... // Shorthand value shorthandManagers[idx].setValues (CSSEngine.this, this, lu, important); } };
Value deflt = vm.getDefaultValue();
for (int i=0; i<props.length; i++) { ValueManager vm = valueManagers[props[i]]; if (vm.isInheritedProperty()) count++; else props[i] = -1;
/** * Returns whether the given CSS property is animatable. */ public boolean isPropertyAnimatable(String pn) { AbstractStylableDocument doc = (AbstractStylableDocument) ownerDocument; CSSEngine eng = doc.getCSSEngine(); int idx = eng.getPropertyIndex(pn); if (idx != -1) { ValueManager[] vms = eng.getValueManagers(); return vms[idx].isAnimatableProperty(); } idx = eng.getShorthandIndex(pn); if (idx != -1) { ShorthandManager[] sms = eng.getShorthandManagers(); return sms[idx].isAnimatableProperty(); } return false; }
/** * Returns whether the given CSS property is additive. */ public boolean isPropertyAdditive(String pn) { AbstractStylableDocument doc = (AbstractStylableDocument) ownerDocument; CSSEngine eng = doc.getCSSEngine(); int idx = eng.getPropertyIndex(pn); if (idx != -1) { ValueManager[] vms = eng.getValueManagers(); return vms[idx].isAdditiveProperty(); } idx = eng.getShorthandIndex(pn); if (idx != -1) { ShorthandManager[] sms = eng.getShorthandManagers(); return sms[idx].isAdditiveProperty(); } return false; }
CSSStylableElement p = getParentCSSStylableElement(elt); if (value == null) { if ((p == null) || !vm.isInheritedProperty()) result = vm.getDefaultValue(); } else if ((p != null) && (value == InheritValue.INSTANCE)) { result = null; } else { result = vm.computeValue(elt, pseudo, this, propidx, sm, result);
LexicalUnit lu; lu = parser.parsePropertyValue(value); return vm.createValue(lu, this); } catch (Exception e) { String m = e.getMessage(); cssBaseURI = null; return vm.getDefaultValue();
public void property(String pname, LexicalUnit lu, boolean important) { int idx = getPropertyIndex(pname); if (idx != -1) { ValueManager vm = valueManagers[idx]; Value v = vm.createValue(lu, CSSEngine.this); dst.setMainProperty(pname, v, important); return; } idx = getShorthandIndex(pname); if (idx == -1) return; // Unknown property... // Shorthand value shorthandManagers[idx].setValues (CSSEngine.this, this, lu, important); } };
public static String getStringProp(StyleMap sm, CSSEngine eng, int pidx) { Value v = sm.getValue(pidx); ValueManager [] vms = eng.getValueManagers(); if (v == null) { ValueManager vm = vms[pidx]; v = vm.getDefaultValue(); } while (v.getCssValueType() == CSSValue.CSS_VALUE_LIST) { v = v.item(0); } return v.getStringValue(); }
for (int i=0; i<props.length; i++) { ValueManager vm = valueManagers[props[i]]; if (vm.isInheritedProperty()) count++; else props[i] = -1;
/** * Returns whether the given CSS property is animatable. */ public boolean isPropertyAnimatable(String pn) { AbstractStylableDocument doc = (AbstractStylableDocument) ownerDocument; CSSEngine eng = doc.getCSSEngine(); int idx = eng.getPropertyIndex(pn); if (idx != -1) { ValueManager[] vms = eng.getValueManagers(); return vms[idx].isAnimatableProperty(); } idx = eng.getShorthandIndex(pn); if (idx != -1) { ShorthandManager[] sms = eng.getShorthandManagers(); return sms[idx].isAnimatableProperty(); } return false; }
/** * Returns whether the given CSS property is additive. */ public boolean isPropertyAdditive(String pn) { AbstractStylableDocument doc = (AbstractStylableDocument) ownerDocument; CSSEngine eng = doc.getCSSEngine(); int idx = eng.getPropertyIndex(pn); if (idx != -1) { ValueManager[] vms = eng.getValueManagers(); return vms[idx].isAdditiveProperty(); } idx = eng.getShorthandIndex(pn); if (idx != -1) { ShorthandManager[] sms = eng.getShorthandManagers(); return sms[idx].isAdditiveProperty(); } return false; }
CSSStylableElement p = getParentCSSStylableElement(elt); if (value == null) { if ((p == null) || !vm.isInheritedProperty()) result = vm.getDefaultValue(); } else if ((p != null) && (value == InheritValue.INSTANCE)) { result = null; } else { result = vm.computeValue(elt, pseudo, this, propidx, sm, result);
/** * Computes a CSS {@link Value} and performance inheritance if the * specified value is 'inherit'. */ protected Value computeValue(CSSStylableElement elt, String pn, Value v) { ValueManager[] vms = cssEngine.getValueManagers(); int idx = cssEngine.getPropertyIndex(pn); if (idx != -1) { if (v.getCssValueType() == CSSValue.CSS_INHERIT) { elt = CSSEngine.getParentCSSStylableElement(elt); if (elt != null) { return cssEngine.getComputedStyle(elt, null, idx); } return vms[idx].getDefaultValue(); } v = vms[idx].computeValue(elt, null, cssEngine, idx, dummyStyleMap, v); } return v; } }
LexicalUnit lu; lu = parser.parsePropertyValue(value); return vm.createValue(lu, this); } catch (Exception e) { String m = e.getMessage(); cssBaseURI = null; return vm.getDefaultValue();