Examples of CSSStylableElement


Examples of org.apache.batik.css.engine.CSSStylableElement

                              Value value) {
        if (value.getPrimitiveType() == CSSPrimitiveValue.CSS_PERCENTAGE) {
            sm.putLineHeightRelative(idx, true);

            int fsi = engine.getLineHeightIndex();
      CSSStylableElement parent;
      parent = (CSSStylableElement)elt.getParentNode();
      if (parent == null) {
    // Hmmm somthing pretty odd - can't happen accordint to spec,
    // should always have text parent.
    // http://www.w3.org/TR/SVG11/text.html#BaselineShiftProperty
View Full Code Here

Examples of org.apache.batik.css.engine.CSSStylableElement

                              Value value) {
        if (value == ValueConstants.BOLDER_VALUE) {
            sm.putParentRelative(idx, true);

            CSSContext ctx = engine.getCSSContext();
            CSSStylableElement p = CSSEngine.getParentCSSStylableElement(elt);
            float fw;
            if (p == null) {
                fw = 400;
            } else {
                Value v = engine.getComputedStyle(p, pseudo, idx);
                fw = v.getFloatValue();
            }
            return createFontWeight(ctx.getBolderFontWeight(fw));
        } else if (value == ValueConstants.LIGHTER_VALUE) {
            sm.putParentRelative(idx, true);

            CSSContext ctx = engine.getCSSContext();
            CSSStylableElement p = CSSEngine.getParentCSSStylableElement(elt);
            float fw;
            if (p == null) {
                fw = 400;
            } else {
                Value v = engine.getComputedStyle(p, pseudo, idx);
View Full Code Here

Examples of org.apache.batik.css.engine.CSSStylableElement

                              StyleMap sm,
                              Value value) {
        if (value == ValueConstants.NARROWER_VALUE) {
            sm.putParentRelative(idx, true);

            CSSStylableElement p = CSSEngine.getParentCSSStylableElement(elt);
            if (p == null) {
                return ValueConstants.SEMI_CONDENSED_VALUE;
            }
            Value v = engine.getComputedStyle(p, pseudo, idx);
            if (v == ValueConstants.NORMAL_VALUE) {
                return ValueConstants.SEMI_CONDENSED_VALUE;
            }
            if (v == ValueConstants.CONDENSED_VALUE) {
                return ValueConstants.EXTRA_CONDENSED_VALUE;
            }
            if (v == ValueConstants.EXPANDED_VALUE) {
                return ValueConstants.SEMI_EXPANDED_VALUE;
            }
            if (v == ValueConstants.SEMI_EXPANDED_VALUE) {
                return ValueConstants.NORMAL_VALUE;
            }
            if (v == ValueConstants.SEMI_CONDENSED_VALUE) {
                return ValueConstants.CONDENSED_VALUE;
            }
            if (v == ValueConstants.EXTRA_CONDENSED_VALUE) {
                return ValueConstants.ULTRA_CONDENSED_VALUE;
            }
            if (v == ValueConstants.EXTRA_EXPANDED_VALUE) {
                return ValueConstants.EXPANDED_VALUE;
            }
            if (v == ValueConstants.ULTRA_CONDENSED_VALUE) {
                return ValueConstants.ULTRA_CONDENSED_VALUE;
            }
            return ValueConstants.EXTRA_EXPANDED_VALUE;
        } else if (value == ValueConstants.WIDER_VALUE) {
            sm.putParentRelative(idx, true);

            CSSStylableElement p = CSSEngine.getParentCSSStylableElement(elt);
            if (p == null) {
                return ValueConstants.SEMI_CONDENSED_VALUE;
            }
            Value v = engine.getComputedStyle(p, pseudo, idx);
            if (v == ValueConstants.NORMAL_VALUE) {
View Full Code Here

Examples of org.apache.batik.css.engine.CSSStylableElement

        case CSSPrimitiveValue.CSS_EMS:
            sm.putParentRelative(idx, true);

            v = value.getFloatValue();
            CSSStylableElement p;
            p = (CSSStylableElement)CSSEngine.getParentCSSStylableElement(elt);
            float fs;
            if (p == null) {
                ctx = engine.getCSSContext();
                fs = ctx.getMediumFontSize();
            } else {
                fs = engine.getComputedStyle(p, null, idx).getFloatValue();
            }
            return new FloatValue(CSSPrimitiveValue.CSS_NUMBER, v * fs);

        case CSSPrimitiveValue.CSS_EXS:
            sm.putParentRelative(idx, true);

            v = value.getFloatValue();
            p = (CSSStylableElement)CSSEngine.getParentCSSStylableElement(elt);
            if (p == null) {
                ctx = engine.getCSSContext();
                fs = ctx.getMediumFontSize();
            } else {
                fs = engine.getComputedStyle(p, null, idx).getFloatValue();
            }
            return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,
                                  v * fs * 0.5f); // !!! x-height

        case CSSPrimitiveValue.CSS_PERCENTAGE:
            sm.putParentRelative(idx, true);

            v = value.getFloatValue();
            p = (CSSStylableElement)CSSEngine.getParentCSSStylableElement(elt);
            if (p == null) {
                ctx = engine.getCSSContext();
                fs = ctx.getMediumFontSize();
            } else {
                fs = engine.getComputedStyle(p, null, idx).getFloatValue();
            }
            return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,
                                  v * fs / 100f);
        }

        if (value == ValueConstants.LARGER_VALUE) {
            sm.putParentRelative(idx, true);

            CSSStylableElement p;
            p = (CSSStylableElement)CSSEngine.getParentCSSStylableElement(elt);
            float fs;
            if (p == null) {
                CSSContext ctx = engine.getCSSContext();
                fs = ctx.getMediumFontSize();
            } else {
                fs = engine.getComputedStyle(p, null, idx).getFloatValue();
            }
            return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,
                                  fs * 1.2f);
        } else if (value == ValueConstants.SMALLER_VALUE) {
            sm.putParentRelative(idx, true);

            CSSStylableElement p;
            p = (CSSStylableElement)CSSEngine.getParentCSSStylableElement(elt);
            float fs;
            if (p == null) {
                CSSContext ctx = engine.getCSSContext();
                fs = ctx.getMediumFontSize();
View Full Code Here

Examples of org.apache.batik.css.engine.CSSStylableElement

        case CSSPrimitiveValue.CSS_EMS:
            sm.putParentRelative(idx, true);

            v = value.getFloatValue();
            CSSStylableElement p;
            p = (CSSStylableElement)CSSEngine.getParentCSSStylableElement(elt);
            float fs;
            if (p == null) {
                ctx = engine.getCSSContext();
                fs = ctx.getMediumFontSize();
            } else {
                fs = engine.getComputedStyle(p, null, idx).getFloatValue();
            }
            return new FloatValue(CSSPrimitiveValue.CSS_NUMBER, v * fs);

        case CSSPrimitiveValue.CSS_EXS:
            sm.putParentRelative(idx, true);

            v = value.getFloatValue();
            p = (CSSStylableElement)CSSEngine.getParentCSSStylableElement(elt);
            if (p == null) {
                ctx = engine.getCSSContext();
                fs = ctx.getMediumFontSize();
            } else {
                fs = engine.getComputedStyle(p, null, idx).getFloatValue();
            }
            return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,
                                  v * fs * 0.5f); // !!! x-height

        case CSSPrimitiveValue.CSS_PERCENTAGE:
            sm.putParentRelative(idx, true);

            v = value.getFloatValue();
            p = (CSSStylableElement)CSSEngine.getParentCSSStylableElement(elt);
            if (p == null) {
                ctx = engine.getCSSContext();
                fs = ctx.getMediumFontSize();
            } else {
                fs = engine.getComputedStyle(p, null, idx).getFloatValue();
            }
            return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,
                                  v * fs / 100f);
        }

        if (value == ValueConstants.LARGER_VALUE) {
            sm.putParentRelative(idx, true);

            CSSStylableElement p;
            p = (CSSStylableElement)CSSEngine.getParentCSSStylableElement(elt);
            float fs;
            if (p == null) {
                CSSContext ctx = engine.getCSSContext();
                fs = ctx.getMediumFontSize();
            } else {
                fs = engine.getComputedStyle(p, null, idx).getFloatValue();
            }
            return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,
                                  fs * 1.2f);
        } else if (value == ValueConstants.SMALLER_VALUE) {
            sm.putParentRelative(idx, true);

            CSSStylableElement p;
            p = (CSSStylableElement)CSSEngine.getParentCSSStylableElement(elt);
            float fs;
            if (p == null) {
                CSSContext ctx = engine.getCSSContext();
                fs = ctx.getMediumFontSize();
View Full Code Here

Examples of org.apache.batik.css.engine.CSSStylableElement

        case CSSPrimitiveValue.CSS_EMS:
            sm.putParentRelative(idx, true);

            v = value.getFloatValue();
            CSSStylableElement p;
            p = (CSSStylableElement)CSSEngine.getParentCSSStylableElement(elt);
            float fs;
            if (p == null) {
                ctx = engine.getCSSContext();
                fs = ctx.getMediumFontSize();
            } else {
                fs = engine.getComputedStyle(p, null, idx).getFloatValue();
            }
            return new FloatValue(CSSPrimitiveValue.CSS_NUMBER, v * fs);

        case CSSPrimitiveValue.CSS_EXS:
            sm.putParentRelative(idx, true);

            v = value.getFloatValue();
            p = (CSSStylableElement)CSSEngine.getParentCSSStylableElement(elt);
            if (p == null) {
                ctx = engine.getCSSContext();
                fs = ctx.getMediumFontSize();
            } else {
                fs = engine.getComputedStyle(p, null, idx).getFloatValue();
            }
            return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,
                                  v * fs * 0.5f); // !!! x-height

        case CSSPrimitiveValue.CSS_PERCENTAGE:
            sm.putParentRelative(idx, true);

            v = value.getFloatValue();
            p = (CSSStylableElement)CSSEngine.getParentCSSStylableElement(elt);
            if (p == null) {
                ctx = engine.getCSSContext();
                fs = ctx.getMediumFontSize();
            } else {
                fs = engine.getComputedStyle(p, null, idx).getFloatValue();
            }
            return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,
                                  v * fs / 100f);
        }

        if (value == ValueConstants.LARGER_VALUE) {
            sm.putParentRelative(idx, true);

            CSSStylableElement p;
            p = (CSSStylableElement)CSSEngine.getParentCSSStylableElement(elt);
            float fs;
            if (p == null) {
                CSSContext ctx = engine.getCSSContext();
                fs = ctx.getMediumFontSize();
            } else {
                fs = engine.getComputedStyle(p, null, idx).getFloatValue();
            }
            return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,
                                  fs * 1.2f);
        } else if (value == ValueConstants.SMALLER_VALUE) {
            sm.putParentRelative(idx, true);

            CSSStylableElement p;
            p = (CSSStylableElement)CSSEngine.getParentCSSStylableElement(elt);
            float fs;
            if (p == null) {
                CSSContext ctx = engine.getCSSContext();
                fs = ctx.getMediumFontSize();
View Full Code Here

Examples of org.apache.batik.css.engine.CSSStylableElement

                              Value value) {
        if (value.getPrimitiveType() == CSSPrimitiveValue.CSS_PERCENTAGE) {
            sm.putLineHeightRelative(idx, true);

            int fsi = engine.getLineHeightIndex();
      CSSStylableElement parent;
      parent = (CSSStylableElement)elt.getParentNode();
      if (parent == null) {
    // Hmmm somthing pretty odd - can't happen accordint to spec,
    // should always have text parent.
    // http://www.w3.org/TR/SVG11/text.html#BaselineShiftProperty
View Full Code Here

Examples of org.apache.batik.css.engine.CSSStylableElement

        }

        if (doParentRelative) {
            sm.putParentRelative(idx, true);

            CSSStylableElement p;
            p = CSSEngine.getParentCSSStylableElement(elt);
            float fs;
            if (p == null) {
                CSSContext ctx = engine.getCSSContext();
                fs = ctx.getMediumFontSize();
View Full Code Here

Examples of org.apache.batik.css.engine.CSSStylableElement

                              Value value) {
        if (value == ValueConstants.BOLDER_VALUE) {
            sm.putParentRelative(idx, true);

            CSSContext ctx = engine.getCSSContext();
            CSSStylableElement p = CSSEngine.getParentCSSStylableElement(elt);
            float fw;
            if (p == null) {
                fw = 400;
            } else {
                Value v = engine.getComputedStyle(p, pseudo, idx);
                fw = v.getFloatValue();
            }
            return createFontWeight(ctx.getBolderFontWeight(fw));
        } else if (value == ValueConstants.LIGHTER_VALUE) {
            sm.putParentRelative(idx, true);

            CSSContext ctx = engine.getCSSContext();
            CSSStylableElement p = CSSEngine.getParentCSSStylableElement(elt);
            float fw;
            if (p == null) {
                fw = 400;
            } else {
                Value v = engine.getComputedStyle(p, pseudo, idx);
View Full Code Here

Examples of org.apache.batik.css.engine.CSSStylableElement

                              StyleMap sm,
                              Value value) {
        if (value == ValueConstants.NARROWER_VALUE) {
            sm.putParentRelative(idx, true);

            CSSStylableElement p = CSSEngine.getParentCSSStylableElement(elt);
            if (p == null) {
                return ValueConstants.SEMI_CONDENSED_VALUE;
            }
            Value v = engine.getComputedStyle(p, pseudo, idx);
            if (v == ValueConstants.NORMAL_VALUE) {
                return ValueConstants.SEMI_CONDENSED_VALUE;
            }
            if (v == ValueConstants.CONDENSED_VALUE) {
                return ValueConstants.EXTRA_CONDENSED_VALUE;
            }
            if (v == ValueConstants.EXPANDED_VALUE) {
                return ValueConstants.SEMI_EXPANDED_VALUE;
            }
            if (v == ValueConstants.SEMI_EXPANDED_VALUE) {
                return ValueConstants.NORMAL_VALUE;
            }
            if (v == ValueConstants.SEMI_CONDENSED_VALUE) {
                return ValueConstants.CONDENSED_VALUE;
            }
            if (v == ValueConstants.EXTRA_CONDENSED_VALUE) {
                return ValueConstants.ULTRA_CONDENSED_VALUE;
            }
            if (v == ValueConstants.EXTRA_EXPANDED_VALUE) {
                return ValueConstants.EXPANDED_VALUE;
            }
            if (v == ValueConstants.ULTRA_CONDENSED_VALUE) {
                return ValueConstants.ULTRA_CONDENSED_VALUE;
            }
            return ValueConstants.EXTRA_EXPANDED_VALUE;
        } else if (value == ValueConstants.WIDER_VALUE) {
            sm.putParentRelative(idx, true);

            CSSStylableElement p = CSSEngine.getParentCSSStylableElement(elt);
            if (p == null) {
                return ValueConstants.SEMI_CONDENSED_VALUE;
            }
            Value v = engine.getComputedStyle(p, pseudo, idx);
            if (v == ValueConstants.NORMAL_VALUE) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.