/** * 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; }
/** * 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; }
/** * 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; }
/** * Creates a CSSValue to manage the value at the given index. */ protected CSSValue createCSSValue(int idx) { if (idx > SVGCSSEngine.FINAL_INDEX) { if (cssEngine.getValueManagers()[idx] instanceof SVGPaintManager) { return new ComputedCSSPaintValue(idx); } if (cssEngine.getValueManagers()[idx] instanceof SVGColorManager) { return new ComputedCSSColorValue(idx); } } else { switch (idx) { case SVGCSSEngine.FILL_INDEX: case SVGCSSEngine.STROKE_INDEX: return new ComputedCSSPaintValue(idx); case SVGCSSEngine.FLOOD_COLOR_INDEX: case SVGCSSEngine.LIGHTING_COLOR_INDEX: case SVGCSSEngine.STOP_COLOR_INDEX: return new ComputedCSSColorValue(idx); } } return super.createCSSValue(idx); }
/** * Creates the CSS value associated with the given property. */ protected CSSValue createCSSValue(String name) { int idx = cssEngine.getPropertyIndex(name); if (idx > SVGCSSEngine.FINAL_INDEX) { if (cssEngine.getValueManagers()[idx] instanceof SVGPaintManager) { return new StyleDeclarationPaintValue(name); } if (cssEngine.getValueManagers()[idx] instanceof SVGColorManager) { return new StyleDeclarationColorValue(name); } } else { switch (idx) { case SVGCSSEngine.FILL_INDEX: case SVGCSSEngine.STROKE_INDEX: return new StyleDeclarationPaintValue(name); case SVGCSSEngine.FLOOD_COLOR_INDEX: case SVGCSSEngine.LIGHTING_COLOR_INDEX: case SVGCSSEngine.STOP_COLOR_INDEX: return new StyleDeclarationColorValue(name); } } return super.createCSSValue(name); }
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(); }
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(); }
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(); }
public static float getFloatProp(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.getFloatValue(); }
public static float getFloatProp(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.getFloatValue(); }
public static float getFloatProp(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.getFloatValue(); }
/** * 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 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; }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; } }
/** * 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; } }
/** * 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; } }