/** * Called when the ICC color has been removed. */ public void colorRemoved(int idx) throws DOMException { Value value = getValue(); switch (getColorType()) { case SVG_COLORTYPE_RGBCOLOR_ICCCOLOR: StringBuffer sb = new StringBuffer( value.item(0).getCssText()); sb.append(" icc-color("); ICCColor iccc = (ICCColor)value.item(1); sb.append(iccc.getColorProfile()); for (int i = 0; i < idx; i++) { sb.append(','); sb.append(iccc.getColor(i)); } for (int i = idx + 1; i < iccc.getLength(); i++) { sb.append(','); sb.append(iccc.getColor(i)); } sb.append(')'); textChanged(sb.toString()); break; default: throw new DOMException (DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); } }
BridgeContext ctx) { String iccProfileName = c.getColorProfile(); if (iccProfileName == null){ return null; int n = c.getNumberOfColors(); float[] colorValue = new float[n]; if (n == 0) { colorValue[i] = c.getColor(i);
/** {@inheritDoc} */ public String toString() { return getCssText(); } }
/** * Called when the ICC colors has been initialized. */ public void colorsInitialized(float f) throws DOMException { Value value = getValue(); switch (getColorType()) { case SVG_COLORTYPE_RGBCOLOR_ICCCOLOR: StringBuffer sb = new StringBuffer( value.item(0).getCssText()); sb.append(" icc-color("); ICCColor iccc = (ICCColor)value.item(1); sb.append(iccc.getColorProfile()); sb.append(','); sb.append(f); sb.append(')'); textChanged(sb.toString()); break; default: throw new DOMException (DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); } }
/** * Called when the ICC color profile has changed. */ public void colorProfileChanged(String cp) throws DOMException { Value value = getValue(); switch (getColorType()) { case SVG_COLORTYPE_RGBCOLOR_ICCCOLOR: StringBuffer sb = new StringBuffer( value.item(0).getCssText()); sb.append(" icc-color("); sb.append(cp); ICCColor iccc = (ICCColor)value.item(1); for (int i = 0; i < iccc.getLength(); i++) { sb.append(','); sb.append(iccc.getColor(i)); } sb.append(')'); textChanged(sb.toString()); break; default: throw new DOMException (DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); } }
/** * Implements {@link SVGNumber#getValue()}. */ public float getValue() { if (iccColors == null) { return value; } int idx = iccColors.indexOf(this); if (idx == -1) { return value; } Value value = valueProvider.getValue().item(1); return ((ICCColor)value).getColor(idx); }
private Value createICCColorValue(LexicalUnit lu, Value v) { lu = lu.getParameters(); expectIdent(lu); ICCColor icc = new ICCColor(lu.getStringValue()); lu = lu.getNextLexicalUnit(); while (lu != null) { expectComma(lu); lu = lu.getNextLexicalUnit(); icc.append(getColorValue(lu)); lu = lu.getNextLexicalUnit(); } return icc; }
/** * <b>DOM</b>: Implements {@link SVGNumberList#getNumberOfItems()}. */ public int getNumberOfItems() { if (getColorType() != SVG_COLORTYPE_RGBCOLOR_ICCCOLOR) { throw new DOMException(DOMException.SYNTAX_ERR, ""); } Value value = valueProvider.getValue(); return ((ICCColor)value.item(1)).getNumberOfColors(); }
/** * Called when the ICC colors has been initialized. */ public void colorsInitialized(float f) throws DOMException { Value value = getValue(); switch (getColorType()) { case SVG_COLORTYPE_RGBCOLOR_ICCCOLOR: StringBuffer sb = new StringBuffer( value.item(0).getCssText()); sb.append(" icc-color("); ICCColor iccc = (ICCColor)value.item(1); sb.append(iccc.getColorProfile()); sb.append(','); sb.append(f); sb.append(')'); textChanged(sb.toString()); break; default: throw new DOMException (DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); } }
/** * Called when the ICC color profile has changed. */ public void colorProfileChanged(String cp) throws DOMException { Value value = getValue(); switch (getColorType()) { case SVG_COLORTYPE_RGBCOLOR_ICCCOLOR: StringBuffer sb = new StringBuffer( value.item(0).getCssText()); sb.append(" icc-color("); sb.append(cp); ICCColor iccc = (ICCColor)value.item(1); for (int i = 0; i < iccc.getLength(); i++) { sb.append(','); sb.append(iccc.getColor(i)); } sb.append(')'); textChanged(sb.toString()); break; default: throw new DOMException (DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); } }
/** * Implements {@link SVGNumber#getValue()}. */ public float getValue() { if (iccColors == null) { return value; } int idx = iccColors.indexOf(this); if (idx == -1) { return value; } Value value = valueProvider.getValue().item(1); return ((ICCColor)value).getColor(idx); }
private Value createICCColorValue(LexicalUnit lu, Value v) { lu = lu.getParameters(); expectIdent(lu); ICCColor icc = new ICCColor(lu.getStringValue()); lu = lu.getNextLexicalUnit(); while (lu != null) { expectComma(lu); lu = lu.getNextLexicalUnit(); icc.append(getColorValue(lu)); lu = lu.getNextLexicalUnit(); } return icc; }
/** * <b>DOM</b>: Implements {@link SVGNumberList#getNumberOfItems()}. */ public int getNumberOfItems() { if (getColorType() != SVG_COLORTYPE_RGBCOLOR_ICCCOLOR) { throw new DOMException(DOMException.SYNTAX_ERR, ""); } Value value = valueProvider.getValue(); return ((ICCColor)value.item(1)).getNumberOfColors(); }
/** * Called when the ICC color has been inserted. */ public void colorInsertedBefore(float f, int idx) throws DOMException { Value value = getValue(); switch (getColorType()) { case SVG_COLORTYPE_RGBCOLOR_ICCCOLOR: StringBuffer sb = new StringBuffer( value.item(0).getCssText()); sb.append(" icc-color("); ICCColor iccc = (ICCColor)value.item(1); sb.append(iccc.getColorProfile()); for (int i = 0; i < idx; i++) { sb.append(','); sb.append(iccc.getColor(i)); } sb.append(','); sb.append(f); for (int i = idx; i < iccc.getLength(); i++) { sb.append(','); sb.append(iccc.getColor(i)); } sb.append(')'); textChanged(sb.toString()); break; default: throw new DOMException (DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); } }
BridgeContext ctx) { String iccProfileName = c.getColorProfile(); if (iccProfileName == null){ return null; int n = c.getNumberOfColors(); float[] colorValue = new float[n]; if (n == 0) { colorValue[i] = c.getColor(i);
/** * Called when the ICC colors has been initialized. */ public void colorsInitialized(float f) throws DOMException { Value value = getValue(); switch (getColorType()) { case SVG_COLORTYPE_RGBCOLOR_ICCCOLOR: StringBuffer sb = new StringBuffer( value.item(0).getCssText()); sb.append(" icc-color("); ICCColor iccc = (ICCColor)value.item(1); sb.append(iccc.getColorProfile()); sb.append(','); sb.append(f); sb.append(')'); textChanged(sb.toString()); break; default: throw new DOMException (DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); } }
/** * Called when the ICC color profile has changed. */ public void colorProfileChanged(String cp) throws DOMException { Value value = getValue(); switch (getColorType()) { case SVG_COLORTYPE_RGBCOLOR_ICCCOLOR: StringBuffer sb = new StringBuffer( value.item(0).getCssText()); sb.append(" icc-color("); sb.append(cp); ICCColor iccc = (ICCColor)value.item(1); for (int i = 0; i < iccc.getLength(); i++) { sb.append(','); sb.append(iccc.getColor(i)); } sb.append(')'); textChanged(sb.toString()); break; default: throw new DOMException (DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); } }
/** * Implements {@link SVGNumber#getValue()}. */ public float getValue() { if (iccColors == null) { return value; } int idx = iccColors.indexOf(this); if (idx == -1) { return value; } Value value = valueProvider.getValue().item(1); return ((ICCColor)value).getColor(idx); }
private Value createICCColorValue(LexicalUnit lu, Value v) { lu = lu.getParameters(); expectIdent(lu); ICCColor icc = new ICCColor(lu.getStringValue()); lu = lu.getNextLexicalUnit(); while (lu != null) { expectComma(lu); lu = lu.getNextLexicalUnit(); icc.append(getColorValue(lu)); lu = lu.getNextLexicalUnit(); } return icc; }
/** * <b>DOM</b>: Implements {@link SVGNumberList#getNumberOfItems()}. */ public int getNumberOfItems() { if (getColorType() != SVG_COLORTYPE_RGBCOLOR_ICCCOLOR) { throw new DOMException(DOMException.SYNTAX_ERR, ""); } Value value = valueProvider.getValue(); return ((ICCColor)value.item(1)).getNumberOfColors(); }