Tabnine Logo
ICCColor
Code IndexAdd Tabnine to your IDE (free)

How to use
ICCColor
in
org.apache.batik.css.engine.value.svg

Best Java code snippets using org.apache.batik.css.engine.value.svg.ICCColor (Showing top 20 results out of 315)

origin: org.apache.xmlgraphics/batik-css

/**
 * 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, "");
  }
}
origin: org.apache.xmlgraphics/batik-bridge

                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);
origin: org.apache.xmlgraphics/batik-css

  /** {@inheritDoc} */
  public String toString() {
    return getCssText();
  }
}
origin: org.apache.xmlgraphics/batik-css

/**
 * 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, "");
  }
}
origin: fr.avianey.apache-xmlgraphics/batik

/**
 * 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, "");
  }
}
origin: org.apache.xmlgraphics/batik-css

/**
 * 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);
}
origin: fr.avianey.apache-xmlgraphics/batik

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;
}
origin: fr.avianey.apache-xmlgraphics/batik

/**
 * <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();
}
origin: fr.avianey.apache-xmlgraphics/batik

/**
 * 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, "");
  }
}
origin: org.apache.xmlgraphics/batik-css

/**
 * 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, "");
  }
}
origin: fr.avianey.apache-xmlgraphics/batik

/**
 * 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);
}
origin: apache/batik

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;
}
origin: org.apache.xmlgraphics/batik-css

/**
 * <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();
}
origin: org.apache.xmlgraphics/batik-css

/**
 * 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, "");
  }
}
origin: apache/batik

                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);
origin: apache/batik

/**
 * 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, "");
  }
}
origin: apache/batik

/**
 * 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, "");
  }
}
origin: apache/batik

/**
 * 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);
}
origin: org.apache.xmlgraphics/batik-css

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;
}
origin: apache/batik

/**
 * <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();
}
org.apache.batik.css.engine.value.svgICCColor

Javadoc

This class represents an ICC color value.

Most used methods

  • getColor
    Returns the color at the given index.
  • getColorProfile
    Returns the color name.
  • getNumberOfColors
    Returns the number of colors.
  • <init>
    Creates a new ICCColor.
  • append
    Appends a color to the list.
  • getCssText
    A string representation of the current value.
  • getLength

Popular in Java

  • Creating JSON documents from java classes using gson
  • findViewById (Activity)
  • compareTo (BigDecimal)
  • getSharedPreferences (Context)
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Path (java.nio.file)
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now