/** * 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); }
/** * 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, ""); } }
/** * 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, ""); } }
/** * 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); }
/** * Called when the ICC color has been replaced. */ public void colorReplaced(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 + 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, ""); } }
/** * 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); }
/** * 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, ""); } }
/** * 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, ""); } }
/** * 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, ""); } }
/** * 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, ""); } }
/** * Called when the ICC color has been append. */ public void colorAppend(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()); for (int i = 0; i < iccc.getLength(); i++) { sb.append(','); sb.append(iccc.getColor(i)); } 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, ""); } }
/** * Called when the ICC color has been append. */ public void colorAppend(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()); for (int i = 0; i < iccc.getLength(); i++) { sb.append(','); sb.append(iccc.getColor(i)); } sb.append(','); sb.append(f); sb.append(')'); textChanged(sb.toString()); break; default: throw new DOMException (DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); } } }
/** * <b>DOM</b>: Implements {@link SVGNumberList#getItem(int)}. */ public SVGNumber getItem(int index) throws DOMException { if (getColorType() != SVG_COLORTYPE_RGBCOLOR_ICCCOLOR) { throw new DOMException(DOMException.INDEX_SIZE_ERR, ""); } int n = getNumberOfItems(); if (index < 0 || index >= n) { throw new DOMException(DOMException.INDEX_SIZE_ERR, ""); } if (iccColors == null) { iccColors = new ArrayList(n); for (int i = iccColors.size(); i < n; i++) { iccColors.add(null); } } Value value = valueProvider.getValue().item(1); float f = ((ICCColor)value).getColor(index); SVGNumber result = new ColorNumber(f); iccColors.set(index, result); return result; }
/** * Called when the ICC color has been append. */ public void colorAppend(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()); for (int i = 0; i < iccc.getLength(); i++) { sb.append(','); sb.append(iccc.getColor(i)); } sb.append(','); sb.append(f); sb.append(')'); textChanged(sb.toString()); break; default: throw new DOMException (DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); } } }
/** * <b>DOM</b>: Implements {@link SVGNumberList#getItem(int)}. */ public SVGNumber getItem(int index) throws DOMException { if (getColorType() != SVG_COLORTYPE_RGBCOLOR_ICCCOLOR) { throw new DOMException(DOMException.INDEX_SIZE_ERR, ""); } int n = getNumberOfItems(); if (index < 0 || index >= n) { throw new DOMException(DOMException.INDEX_SIZE_ERR, ""); } if (iccColors == null) { iccColors = new ArrayList(n); for (int i = iccColors.size(); i < n; i++) { iccColors.add(null); } } Value value = valueProvider.getValue().item(1); float f = ((ICCColor)value).getColor(index); SVGNumber result = new ColorNumber(f); iccColors.set(index, result); return result; }
/** * <b>DOM</b>: Implements {@link SVGNumberList#getItem(int)}. */ public SVGNumber getItem(int index) throws DOMException { if (getColorType() != SVG_COLORTYPE_RGBCOLOR_ICCCOLOR) { throw new DOMException(DOMException.INDEX_SIZE_ERR, ""); } int n = getNumberOfItems(); if (index < 0 || index >= n) { throw new DOMException(DOMException.INDEX_SIZE_ERR, ""); } if (iccColors == null) { iccColors = new ArrayList(n); for (int i = iccColors.size(); i < n; i++) { iccColors.add(null); } } Value value = valueProvider.getValue().item(1); float f = ((ICCColor)value).getColor(index); SVGNumber result = new ColorNumber(f); iccColors.set(index, result); return result; }
/** * <b>DOM</b>: Implements {@link SVGNumberList#removeItem(int)}. */ public SVGNumber removeItem(int index) throws DOMException { if (handler == null) { throw new DOMException (DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); } else { int n = getNumberOfItems(); if (index < 0 || index >= n) { throw new DOMException(DOMException.INDEX_SIZE_ERR, ""); } SVGNumber result = null; if (iccColors != null) { result = (ColorNumber)iccColors.get(index); } if (result == null) { Value value = valueProvider.getValue().item(1); result = new ColorNumber(((ICCColor)value).getColor(index)); } handler.colorRemoved(index); return result; } }
/** * <b>DOM</b>: Implements {@link SVGNumberList#removeItem(int)}. */ public SVGNumber removeItem(int index) throws DOMException { if (handler == null) { throw new DOMException (DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); } else { int n = getNumberOfItems(); if (index < 0 || index >= n) { throw new DOMException(DOMException.INDEX_SIZE_ERR, ""); } SVGNumber result = null; if (iccColors != null) { result = (ColorNumber)iccColors.get(index); } if (result == null) { Value value = valueProvider.getValue().item(1); result = new ColorNumber(((ICCColor)value).getColor(index)); } handler.colorRemoved(index); return result; } }
/** * <b>DOM</b>: Implements {@link SVGNumberList#removeItem(int)}. */ public SVGNumber removeItem(int index) throws DOMException { if (handler == null) { throw new DOMException (DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); } else { int n = getNumberOfItems(); if (index < 0 || index >= n) { throw new DOMException(DOMException.INDEX_SIZE_ERR, ""); } SVGNumber result = null; if (iccColors != null) { result = (ColorNumber)iccColors.get(index); } if (result == null) { Value value = valueProvider.getValue().item(1); result = new ColorNumber(((ICCColor)value).getColor(index)); } handler.colorRemoved(index); return result; } }