public FSFontMetrics getFSFontMetrics(CssContext c) { if (_FSFontMetrics == null) { _FSFontMetrics = c.getFSFontMetrics(getFSFont(c)); } return _FSFontMetrics; }
/** * Gets the ident attribute of the CalculatedStyle object * * @param cssName PARAM * @return The ident value */ public IdentValue getIdent(CSSName cssName) { return valueByName(cssName).asIdentValue(); }
public Length asLength(CssContext c, CSSName cssName) { Length result = new Length(); FSDerivedValue value = valueByName(cssName); if (value instanceof LengthValue || value instanceof NumberValue) { if (value.hasAbsoluteUnit()) { result.setValue((int) value.getFloatProportionalTo(cssName, 0, c)); result.setType(Length.FIXED); } else { result.setValue((int) value.asFloat()); result.setType(Length.PERCENT); } } return result; }
/** * @param cssName * @param parentWidth * @param ctx * @return TODO */ public float getFloatPropertyProportionalWidth(CSSName cssName, float parentWidth, CssContext ctx) { return valueByName(cssName).getFloatProportionalTo(cssName, parentWidth, ctx); }
/** * @param cssName * @return TODO */ public String getStringProperty(CSSName cssName) { return valueByName(cssName).asString(); }
public FSColor asColor(CSSName cssName) { FSDerivedValue prop = valueByName(cssName); if (prop == IdentValue.TRANSPARENT) { return FSRGBColor.TRANSPARENT; } else { return prop.asColor(); } }
/** * TODO: doc */ public boolean isLength(CSSName cssName) { FSDerivedValue val = valueByName(cssName); return val instanceof LengthValue; }
public boolean isForcePageBreakAfter() { IdentValue val = getIdent(CSSName.PAGE_BREAK_AFTER); return val == IdentValue.ALWAYS || val == IdentValue.LEFT || val == IdentValue.RIGHT; }
/** * Convenience property accessor; returns a Border initialized with the * four-sided margin width. Uses the actual value (computed actual value) * for this element. * * @param cbWidth * @param ctx * @return The marginWidth value */ public RectPropertySet getMarginRect(float cbWidth, CssContext ctx) { return getMarginRect(cbWidth, ctx, true); }
public Length asLength(CssContext c, CSSName cssName) { Length result = new Length(); FSDerivedValue value = valueByName(cssName); if (value instanceof LengthValue || value instanceof NumberValue) { if (value.hasAbsoluteUnit()) { result.setValue((int) value.getFloatProportionalTo(cssName, 0, c)); result.setType(Length.FIXED); } else { result.setValue((int) value.asFloat()); result.setType(Length.PERCENT); } } return result; }
/** * @param cssName * @param parentWidth * @param ctx * @return TODO */ public float getFloatPropertyProportionalWidth(CSSName cssName, float parentWidth, CssContext ctx) { return valueByName(cssName).getFloatProportionalTo(cssName, parentWidth, ctx); }
/** * @param cssName * @return TODO */ public String getStringProperty(CSSName cssName) { return valueByName(cssName).asString(); }
public FSFontMetrics getFSFontMetrics(CssContext c) { if (_FSFontMetrics == null) { _FSFontMetrics = c.getFSFontMetrics(getFSFont(c)); } return _FSFontMetrics; }
/** * Gets the ident attribute of the CalculatedStyle object * * @param cssName PARAM * @return The ident value */ public IdentValue getIdent(CSSName cssName) { return valueByName(cssName).asIdentValue(); }
public FSColor asColor(CSSName cssName) { FSDerivedValue prop = valueByName(cssName); if (prop == IdentValue.TRANSPARENT) { return FSRGBColor.TRANSPARENT; } else { return prop.asColor(); } }
/** * @param cssName * @param parentHeight * @param ctx * @return TODO */ public float getFloatPropertyProportionalHeight(CSSName cssName, float parentHeight, CssContext ctx) { return valueByName(cssName).getFloatProportionalTo(cssName, parentHeight, ctx); }
/** * @param cssName * @param parentHeight * @param ctx * @return TODO */ public float getFloatPropertyProportionalHeight(CSSName cssName, float parentHeight, CssContext ctx) { return valueByName(cssName).getFloatProportionalTo(cssName, parentHeight, ctx); }
public float getFloatPropertyProportionalTo(CSSName cssName, float baseValue, CssContext ctx) { return valueByName(cssName).getFloatProportionalTo(cssName, baseValue, ctx); }