/** * Returns the Value corresponding to the given system color. */ public static Value getSystemColor(String ident) { ident = ident.toLowerCase( ); // todo locale?? SystemColor sc = (SystemColor)factories.get(ident); return new RGBColorValue (new FloatValue(CSSPrimitiveValue.CSS_NUMBER, sc.getRed()), new FloatValue(CSSPrimitiveValue.CSS_NUMBER, sc.getGreen()), new FloatValue(CSSPrimitiveValue.CSS_NUMBER, sc.getBlue())); }
/** * A string representation of the current value. */ public String getCssText() { return getCssText(unitType, floatValue); }
protected AnimatableValue createAnimatableValue(AnimationTarget target, String pn, Value v) { FloatValue fv = (FloatValue) v; short unit; switch (fv.getPrimitiveType()) { case CSSPrimitiveValue.CSS_NUMBER: case CSSPrimitiveValue.CSS_DEG: unit = SVGAngle.SVG_ANGLETYPE_DEG; break; case CSSPrimitiveValue.CSS_RAD: unit = SVGAngle.SVG_ANGLETYPE_RAD; break; case CSSPrimitiveValue.CSS_GRAD: unit = SVGAngle.SVG_ANGLETYPE_GRAD; break; default: // XXX Do something better than returning null. return null; } return new AnimatableAngleValue(target, fv.getFloatValue(), unit); } }
protected AnimatableValue createAnimatableValue(AnimationTarget target, String pn, Value v) { if (v instanceof StringValue) { return new AnimatableNumberOrIdentValue(target, v.getStringValue()); } FloatValue fv = (FloatValue) v; return new AnimatableNumberOrIdentValue(target, fv.getFloatValue(), numericIdents); } }
protected AnimatableValue createAnimatableValue(AnimationTarget target, String pn, Value v) { if (v instanceof StringValue) { return new AnimatableNumberOrIdentValue(target, v.getStringValue()); } FloatValue fv = (FloatValue) v; return new AnimatableNumberOrIdentValue(target, fv.getFloatValue(), numericIdents); } }
/** * Returns the Value corresponding to the given system color. */ public static Value getSystemColor(String ident) { ident = ident.toLowerCase( ); // todo locale?? SystemColor sc = (SystemColor)factories.get(ident); return new RGBColorValue (new FloatValue(CSSPrimitiveValue.CSS_NUMBER, sc.getRed()), new FloatValue(CSSPrimitiveValue.CSS_NUMBER, sc.getGreen()), new FloatValue(CSSPrimitiveValue.CSS_NUMBER, sc.getBlue())); }
/** * Returns a printable representation of this value. */ public String toString() { return getCssText(); } }
protected AnimatableValue createAnimatableValue(AnimationTarget target, String pn, Value v) { FloatValue fv = (FloatValue) v; short unit; switch (fv.getPrimitiveType()) { case CSSPrimitiveValue.CSS_NUMBER: case CSSPrimitiveValue.CSS_DEG: unit = SVGAngle.SVG_ANGLETYPE_DEG; break; case CSSPrimitiveValue.CSS_RAD: unit = SVGAngle.SVG_ANGLETYPE_RAD; break; case CSSPrimitiveValue.CSS_GRAD: unit = SVGAngle.SVG_ANGLETYPE_GRAD; break; default: // XXX Do something better than returning null. return null; } return new AnimatableAngleValue(target, fv.getFloatValue(), unit); } }
protected AnimatableValue createAnimatableValue(AnimationTarget target, String pn, Value v) { if (v instanceof StringValue) { return new AnimatableNumberOrIdentValue(target, v.getStringValue()); } FloatValue fv = (FloatValue) v; return new AnimatableNumberOrIdentValue(target, fv.getFloatValue(), numericIdents); } }
/** * Returns the Value corresponding to the given system color. */ public static Value getSystemColor(String ident) { ident = ident.toLowerCase( ); // todo locale?? SystemColor sc = (SystemColor)factories.get(ident); return new RGBColorValue (new FloatValue(CSSPrimitiveValue.CSS_NUMBER, sc.getRed()), new FloatValue(CSSPrimitiveValue.CSS_NUMBER, sc.getGreen()), new FloatValue(CSSPrimitiveValue.CSS_NUMBER, sc.getBlue())); }
/** * Returns a printable representation of this value. */ public String toString() { return getCssText(); } }
protected AnimatableValue createAnimatableValue(AnimationTarget target, String pn, Value v) { FloatValue fv = (FloatValue) v; short unit; switch (fv.getPrimitiveType()) { case CSSPrimitiveValue.CSS_NUMBER: case CSSPrimitiveValue.CSS_DEG: unit = SVGAngle.SVG_ANGLETYPE_DEG; break; case CSSPrimitiveValue.CSS_RAD: unit = SVGAngle.SVG_ANGLETYPE_RAD; break; case CSSPrimitiveValue.CSS_GRAD: unit = SVGAngle.SVG_ANGLETYPE_GRAD; break; default: // XXX Do something better than returning null. return null; } return new AnimatableAngleValue(target, fv.getFloatValue(), unit); } }
/** Get the Link Color to use in this document */ Value getLinkColor() { // Element body = DesignerService.getDefault().getBody(document); // Element body = InSyncService.getProvider().getHtmlBodyForMarkupFile(InSyncService.getProvider().getFileObject(document)); UserAgent userAgent = getUserAgent(); Element body = userAgent == null ? null : userAgent.getHtmlBodyForDocument(document); if (body == null) { // XXX Is it OK? return new RGBColorValue (new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 0), new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 0), new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 200)); } return getComputedStyle((CSSStylableElement)body, null, XhtmlCss.RAVELINKCOLOR_INDEX); }
/** * Returns a printable representation of this value. */ public String toString() { return getCssText(); } }
protected AnimatableValue createAnimatableValue(AnimationTarget target, String pn, Value v) { if (v instanceof StringValue) { return new AnimatableLengthOrIdentValue(target, v.getStringValue()); } short pcInterp = target.getPercentageInterpretation(null, pn, true); FloatValue fv = (FloatValue) v; return new AnimatableLengthOrIdentValue (target, fv.getPrimitiveType(), fv.getFloatValue(), pcInterp); } }
/** * Implements {@link ValueManager#createFloatValue(short,float)}. */ public Value createFloatValue(short type, float floatValue) throws DOMException { if (type == CSSPrimitiveValue.CSS_NUMBER) { return new FloatValue(type, floatValue); } throw createInvalidFloatTypeDOMException(type); } }
/** * A string representation of the current value. */ public String getCssText() { return getCssText(unitType, floatValue); }
protected AnimatableValue createAnimatableValue(AnimationTarget target, String pn, Value v) { if (v instanceof StringValue) { return new AnimatableLengthOrIdentValue(target, v.getStringValue()); } short pcInterp = target.getPercentageInterpretation(null, pn, true); FloatValue fv = (FloatValue) v; return new AnimatableLengthOrIdentValue (target, fv.getPrimitiveType(), fv.getFloatValue(), pcInterp); } }
/** * Implements {@link ValueManager#createFloatValue(short,float)}. */ public Value createFloatValue(short type, float floatValue) throws DOMException { if (type == CSSPrimitiveValue.CSS_NUMBER) { return new FloatValue(type, floatValue); } throw createInvalidFloatTypeDOMException(type); } }
/** * A string representation of the current value. */ public String getCssText() { return getCssText(unitType, floatValue); }