org.apache.batik.css_1.6.0.v201011041432

16:40:50.466 INFO  jd.cli.Main - Decompiling org.apache.batik.css_1.6.0.v201011041432.jar
package org.apache.batik.css.dom;

import org.apache.batik.css.engine.CSSEngine;
import org.apache.batik.css.engine.value.Value;

public class CSSOMComputedStyle$ComputedCSSValue
  extends CSSOMValue
  implements CSSOMValue.ValueProvider
{
  protected int index;
  private final CSSOMComputedStyle this$0;
  
  public CSSOMComputedStyle$ComputedCSSValue(CSSOMComputedStyle paramCSSOMComputedStyle, int paramInt)
  {
    super(null);
    this$0 = paramCSSOMComputedStyle;
    valueProvider = this;
    index = paramInt;
  }
  
  public Value getValue()
  {
    return this$0.cssEngine.getComputedStyle(this$0.element, this$0.pseudoElement, index);
  }
}

/* Location:
 * Qualified Name:     org.apache.batik.css.dom.CSSOMComputedStyle.ComputedCSSValue
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.css.dom;

import java.util.HashMap;
import java.util.Map;
import org.apache.batik.css.engine.CSSEngine;
import org.apache.batik.css.engine.CSSStylableElement;
import org.apache.batik.css.engine.value.Value;
import org.w3c.dom.DOMException;
import org.w3c.dom.css.CSSRule;
import org.w3c.dom.css.CSSStyleDeclaration;
import org.w3c.dom.css.CSSValue;

public class CSSOMComputedStyle
  implements CSSStyleDeclaration
{
  protected CSSEngine cssEngine;
  protected CSSStylableElement element;
  protected String pseudoElement;
  protected Map values = new HashMap();
  
  public CSSOMComputedStyle(CSSEngine paramCSSEngine, CSSStylableElement paramCSSStylableElement, String paramString)
  {
    cssEngine = paramCSSEngine;
    element = paramCSSStylableElement;
    pseudoElement = paramString;
  }
  
  public String getCssText()
  {
    StringBuffer localStringBuffer = new StringBuffer();
    for (int i = 0; i < cssEngine.getNumberOfProperties(); i++)
    {
      localStringBuffer.append(cssEngine.getPropertyName(i));
      localStringBuffer.append(": ");
      localStringBuffer.append(cssEngine.getComputedStyle(element, pseudoElement, i).getCssText());
      localStringBuffer.append(";\n");
    }
    return localStringBuffer.toString();
  }
  
  public void setCssText(String paramString)
    throws DOMException
  {
    throw new DOMException((short)7, "");
  }
  
  public String getPropertyValue(String paramString)
  {
    int i = cssEngine.getPropertyIndex(paramString);
    if (i == -1) {
      return "";
    }
    Value localValue = cssEngine.getComputedStyle(element, pseudoElement, i);
    return localValue.getCssText();
  }
  
  public CSSValue getPropertyCSSValue(String paramString)
  {
    CSSValue localCSSValue = (CSSValue)values.get(paramString);
    if (localCSSValue == null)
    {
      int i = cssEngine.getPropertyIndex(paramString);
      if (i != -1)
      {
        localCSSValue = createCSSValue(i);
        values.put(paramString, localCSSValue);
      }
    }
    return localCSSValue;
  }
  
  public String removeProperty(String paramString)
    throws DOMException
  {
    throw new DOMException((short)7, "");
  }
  
  public String getPropertyPriority(String paramString)
  {
    return "";
  }
  
  public void setProperty(String paramString1, String paramString2, String paramString3)
    throws DOMException
  {
    throw new DOMException((short)7, "");
  }
  
  public int getLength()
  {
    return cssEngine.getNumberOfProperties();
  }
  
  public String item(int paramInt)
  {
    if ((paramInt < 0) || (paramInt >= cssEngine.getNumberOfProperties())) {
      return "";
    }
    return cssEngine.getPropertyName(paramInt);
  }
  
  public CSSRule getParentRule()
  {
    return null;
  }
  
  protected CSSValue createCSSValue(int paramInt)
  {
    return new ComputedCSSValue(paramInt);
  }
  
  public class ComputedCSSValue
    extends CSSOMValue
    implements CSSOMValue.ValueProvider
  {
    protected int index;
    
    public ComputedCSSValue(int paramInt)
    {
      super();
      valueProvider = this;
      index = paramInt;
    }
    
    public Value getValue()
    {
      return cssEngine.getComputedStyle(element, pseudoElement, index);
    }
  }
}

/* Location:
 * Qualified Name:     org.apache.batik.css.dom.CSSOMComputedStyle
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.css.dom;

import org.apache.batik.css.engine.value.Value;
import org.w3c.dom.DOMException;
import org.w3c.dom.css.CSSPrimitiveValue;
import org.w3c.dom.css.CSSValue;
import org.w3c.dom.css.Counter;
import org.w3c.dom.css.RGBColor;
import org.w3c.dom.css.Rect;

public abstract class CSSOMSVGColor$AbstractComponent
  implements CSSPrimitiveValue
{
  private final CSSOMSVGColor this$0;
  
  protected CSSOMSVGColor$AbstractComponent(CSSOMSVGColor paramCSSOMSVGColor)
  {
    this$0 = paramCSSOMSVGColor;
  }
  
  protected abstract Value getValue();
  
  public String getCssText()
  {
    return getValue().getCssText();
  }
  
  public short getCssValueType()
  {
    return getValue().getCssValueType();
  }
  
  public short getPrimitiveType()
  {
    return getValue().getPrimitiveType();
  }
  
  public float getFloatValue(short paramShort)
    throws DOMException
  {
    return CSSOMValue.convertFloatValue(paramShort, getValue());
  }
  
  public String getStringValue()
    throws DOMException
  {
    return this$0.valueProvider.getValue().getStringValue();
  }
  
  public Counter getCounterValue()
    throws DOMException
  {
    throw new DOMException((short)15, "");
  }
  
  public Rect getRectValue()
    throws DOMException
  {
    throw new DOMException((short)15, "");
  }
  
  public RGBColor getRGBColorValue()
    throws DOMException
  {
    throw new DOMException((short)15, "");
  }
  
  public int getLength()
  {
    throw new DOMException((short)15, "");
  }
  
  public CSSValue item(int paramInt)
  {
    throw new DOMException((short)15, "");
  }
  
  public abstract void setStringValue(short paramShort, String paramString)
    throws DOMException;
  
  public abstract void setFloatValue(short paramShort, float paramFloat)
    throws DOMException;
  
  public abstract void setCssText(String paramString)
    throws DOMException;
}

/* Location:
 * Qualified Name:     org.apache.batik.css.dom.CSSOMSVGColor.AbstractComponent
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.css.dom;

import org.apache.batik.css.engine.value.AbstractValue;
import org.apache.batik.css.engine.value.FloatValue;
import org.apache.batik.css.engine.value.Value;
import org.apache.batik.css.engine.value.svg.ICCColor;
import org.w3c.dom.DOMException;

public abstract class CSSOMSVGColor$AbstractModificationHandler
  implements CSSOMSVGColor.ModificationHandler
{
  private final CSSOMSVGColor this$0;
  
  public CSSOMSVGColor$AbstractModificationHandler(CSSOMSVGColor paramCSSOMSVGColor)
  {
    this$0 = paramCSSOMSVGColor;
  }
  
  protected abstract Value getValue();
  
  public void redTextChanged(String paramString)
    throws DOMException
  {
    switch (this$0.getColorType())
    {
    case 1: 
      paramString = "rgb(" + paramString + ", " + getValue().getGreen().getCssText() + ", " + getValue().getBlue().getCssText() + ")";
      break;
    case 2: 
      paramString = "rgb(" + paramString + ", " + getValue().item(0).getGreen().getCssText() + ", " + getValue().item(0).getBlue().getCssText() + ") " + getValue().item(1).getCssText();
      break;
    default: 
      throw new DOMException((short)7, "");
    }
    textChanged(paramString);
  }
  
  public void redFloatValueChanged(short paramShort, float paramFloat)
    throws DOMException
  {
    String str;
    switch (this$0.getColorType())
    {
    case 1: 
      str = "rgb(" + FloatValue.getCssText(paramShort, paramFloat) + ", " + getValue().getGreen().getCssText() + ", " + getValue().getBlue().getCssText() + ")";
      break;
    case 2: 
      str = "rgb(" + FloatValue.getCssText(paramShort, paramFloat) + ", " + getValue().item(0).getGreen().getCssText() + ", " + getValue().item(0).getBlue().getCssText() + ") " + getValue().item(1).getCssText();
      break;
    default: 
      throw new DOMException((short)7, "");
    }
    textChanged(str);
  }
  
  public void greenTextChanged(String paramString)
    throws DOMException
  {
    switch (this$0.getColorType())
    {
    case 1: 
      paramString = "rgb(" + getValue().getRed().getCssText() + ", " + paramString + ", " + getValue().getBlue().getCssText() + ")";
      break;
    case 2: 
      paramString = "rgb(" + getValue().item(0).getRed().getCssText() + ", " + paramString + ", " + getValue().item(0).getBlue().getCssText() + ") " + getValue().item(1).getCssText();
      break;
    default: 
      throw new DOMException((short)7, "");
    }
    textChanged(paramString);
  }
  
  public void greenFloatValueChanged(short paramShort, float paramFloat)
    throws DOMException
  {
    String str;
    switch (this$0.getColorType())
    {
    case 1: 
      str = "rgb(" + getValue().getRed().getCssText() + ", " + FloatValue.getCssText(paramShort, paramFloat) + ", " + getValue().getBlue().getCssText() + ")";
      break;
    case 2: 
      str = "rgb(" + getValue().item(0).getRed().getCssText() + ", " + FloatValue.getCssText(paramShort, paramFloat) + ", " + getValue().item(0).getBlue().getCssText() + ") " + getValue().item(1).getCssText();
      break;
    default: 
      throw new DOMException((short)7, "");
    }
    textChanged(str);
  }
  
  public void blueTextChanged(String paramString)
    throws DOMException
  {
    switch (this$0.getColorType())
    {
    case 1: 
      paramString = "rgb(" + getValue().getRed().getCssText() + ", " + getValue().getGreen().getCssText() + ", " + paramString + ")";
      break;
    case 2: 
      paramString = "rgb(" + getValue().item(0).getRed().getCssText() + ", " + getValue().item(0).getGreen().getCssText() + ", " + paramString + ") " + getValue().item(1).getCssText();
    default: 
      throw new DOMException((short)7, "");
    }
    textChanged(paramString);
  }
  
  public void blueFloatValueChanged(short paramShort, float paramFloat)
    throws DOMException
  {
    String str;
    switch (this$0.getColorType())
    {
    case 1: 
      str = "rgb(" + getValue().getRed().getCssText() + ", " + getValue().getGreen().getCssText() + ", " + FloatValue.getCssText(paramShort, paramFloat) + ")";
      break;
    case 2: 
      str = "rgb(" + getValue().item(0).getRed().getCssText() + ", " + getValue().item(0).getGreen().getCssText() + ", " + FloatValue.getCssText(paramShort, paramFloat) + ") " + getValue().item(1).getCssText();
      break;
    default: 
      throw new DOMException((short)7, "");
    }
    textChanged(str);
  }
  
  public void rgbColorChanged(String paramString)
    throws DOMException
  {
    switch (this$0.getColorType())
    {
    case 1: 
      break;
    case 2: 
      paramString = paramString + getValue().item(1).getCssText();
      break;
    default: 
      throw new DOMException((short)7, "");
    }
    textChanged(paramString);
  }
  
  public void rgbColorICCColorChanged(String paramString1, String paramString2)
    throws DOMException
  {
    switch (this$0.getColorType())
    {
    case 2: 
      textChanged(paramString1 + " " + paramString2);
      break;
    default: 
      throw new DOMException((short)7, "");
    }
  }
  
  public void colorChanged(short paramShort, String paramString1, String paramString2)
    throws DOMException
  {
    switch (paramShort)
    {
    case 3: 
      textChanged("currentcolor");
      break;
    case 1: 
      textChanged(paramString1);
      break;
    case 2: 
      textChanged(paramString1 + " " + paramString2);
      break;
    default: 
      throw new DOMException((short)9, "");
    }
  }
  
  public void colorProfileChanged(String paramString)
    throws DOMException
  {
    switch (this$0.getColorType())
    {
    case 2: 
      StringBuffer localStringBuffer = new StringBuffer(getValue().item(0).getCssText());
      localStringBuffer.append(" icc-color(");
      localStringBuffer.append(paramString);
      ICCColor localICCColor = (ICCColor)getValue().item(1);
      for (int i = 0; i < localICCColor.getLength(); i++)
      {
        localStringBuffer.append(",");
        localStringBuffer.append(localICCColor.getColor(i));
      }
      localStringBuffer.append(")");
      textChanged(localStringBuffer.toString());
      break;
    default: 
      throw new DOMException((short)7, "");
    }
  }
  
  public void colorsCleared()
    throws DOMException
  {
    switch (this$0.getColorType())
    {
    case 2: 
      StringBuffer localStringBuffer = new StringBuffer(getValue().item(0).getCssText());
      localStringBuffer.append(" icc-color(");
      ICCColor localICCColor = (ICCColor)getValue().item(1);
      localStringBuffer.append(localICCColor.getColorProfile());
      localStringBuffer.append(")");
      textChanged(localStringBuffer.toString());
      break;
    default: 
      throw new DOMException((short)7, "");
    }
  }
  
  public void colorsInitialized(float paramFloat)
    throws DOMException
  {
    switch (this$0.getColorType())
    {
    case 2: 
      StringBuffer localStringBuffer = new StringBuffer(getValue().item(0).getCssText());
      localStringBuffer.append(" icc-color(");
      ICCColor localICCColor = (ICCColor)getValue().item(1);
      localStringBuffer.append(localICCColor.getColorProfile());
      localStringBuffer.append(",");
      localStringBuffer.append(paramFloat);
      localStringBuffer.append(")");
      textChanged(localStringBuffer.toString());
      break;
    default: 
      throw new DOMException((short)7, "");
    }
  }
  
  public void colorInsertedBefore(float paramFloat, int paramInt)
    throws DOMException
  {
    switch (this$0.getColorType())
    {
    case 2: 
      StringBuffer localStringBuffer = new StringBuffer(getValue().item(0).getCssText());
      localStringBuffer.append(" icc-color(");
      ICCColor localICCColor = (ICCColor)getValue().item(1);
      localStringBuffer.append(localICCColor.getColorProfile());
      for (int i = 0; i < paramInt; i++)
      {
        localStringBuffer.append(",");
        localStringBuffer.append(localICCColor.getColor(i));
      }
      localStringBuffer.append(",");
      localStringBuffer.append(paramFloat);
      for (int j = paramInt; j < localICCColor.getLength(); j++)
      {
        localStringBuffer.append(",");
        localStringBuffer.append(localICCColor.getColor(j));
      }
      localStringBuffer.append(")");
      textChanged(localStringBuffer.toString());
      break;
    default: 
      throw new DOMException((short)7, "");
    }
  }
  
  public void colorReplaced(float paramFloat, int paramInt)
    throws DOMException
  {
    switch (this$0.getColorType())
    {
    case 2: 
      StringBuffer localStringBuffer = new StringBuffer(getValue().item(0).getCssText());
      localStringBuffer.append(" icc-color(");
      ICCColor localICCColor = (ICCColor)getValue().item(1);
      localStringBuffer.append(localICCColor.getColorProfile());
      for (int i = 0; i < paramInt; i++)
      {
        localStringBuffer.append(",");
        localStringBuffer.append(localICCColor.getColor(i));
      }
      localStringBuffer.append(",");
      localStringBuffer.append(paramFloat);
      for (int j = paramInt + 1; j < localICCColor.getLength(); j++)
      {
        localStringBuffer.append(",");
        localStringBuffer.append(localICCColor.getColor(j));
      }
      localStringBuffer.append(")");
      textChanged(localStringBuffer.toString());
      break;
    default: 
      throw new DOMException((short)7, "");
    }
  }
  
  public void colorRemoved(int paramInt)
    throws DOMException
  {
    switch (this$0.getColorType())
    {
    case 2: 
      StringBuffer localStringBuffer = new StringBuffer(getValue().item(0).getCssText());
      localStringBuffer.append(" icc-color(");
      ICCColor localICCColor = (ICCColor)getValue().item(1);
      localStringBuffer.append(localICCColor.getColorProfile());
      for (int i = 0; i < paramInt; i++)
      {
        localStringBuffer.append(",");
        localStringBuffer.append(localICCColor.getColor(i));
      }
      for (int j = paramInt + 1; j < localICCColor.getLength(); j++)
      {
        localStringBuffer.append(",");
        localStringBuffer.append(localICCColor.getColor(j));
      }
      localStringBuffer.append(")");
      textChanged(localStringBuffer.toString());
      break;
    default: 
      throw new DOMException((short)7, "");
    }
  }
  
  public void colorAppend(float paramFloat)
    throws DOMException
  {
    switch (this$0.getColorType())
    {
    case 2: 
      StringBuffer localStringBuffer = new StringBuffer(getValue().item(0).getCssText());
      localStringBuffer.append(" icc-color(");
      ICCColor localICCColor = (ICCColor)getValue().item(1);
      localStringBuffer.append(localICCColor.getColorProfile());
      for (int i = 0; i < localICCColor.getLength(); i++)
      {
        localStringBuffer.append(",");
        localStringBuffer.append(localICCColor.getColor(i));
      }
      localStringBuffer.append(",");
      localStringBuffer.append(paramFloat);
      localStringBuffer.append(")");
      textChanged(localStringBuffer.toString());
      break;
    default: 
      throw new DOMException((short)7, "");
    }
  }
  
  public abstract void textChanged(String paramString)
    throws DOMException;
}

/* Location:
 * Qualified Name:     org.apache.batik.css.dom.CSSOMSVGColor.AbstractModificationHandler
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.css.dom;

import org.apache.batik.css.engine.value.Value;
import org.w3c.dom.DOMException;

public class CSSOMSVGColor$BlueComponent
  extends CSSOMSVGColor.FloatComponent
{
  private final CSSOMSVGColor this$0;
  
  protected CSSOMSVGColor$BlueComponent(CSSOMSVGColor paramCSSOMSVGColor)
  {
    super(paramCSSOMSVGColor);
    this$0 = paramCSSOMSVGColor;
  }
  
  protected Value getValue()
  {
    return this$0.valueProvider.getValue().getBlue();
  }
  
  public void setCssText(String paramString)
    throws DOMException
  {
    if (this$0.handler == null) {
      throw new DOMException((short)7, "");
    }
    getValue();
    this$0.handler.blueTextChanged(paramString);
  }
  
  public void setFloatValue(short paramShort, float paramFloat)
    throws DOMException
  {
    if (this$0.handler == null) {
      throw new DOMException((short)7, "");
    }
    getValue();
    this$0.handler.blueFloatValueChanged(paramShort, paramFloat);
  }
}

/* Location:
 * Qualified Name:     org.apache.batik.css.dom.CSSOMSVGColor.BlueComponent
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.css.dom;

import java.util.ArrayList;
import org.apache.batik.css.engine.value.Value;
import org.apache.batik.css.engine.value.svg.ICCColor;
import org.w3c.dom.DOMException;
import org.w3c.dom.svg.SVGNumber;

public class CSSOMSVGColor$ColorNumber
  implements SVGNumber
{
  protected float value;
  private final CSSOMSVGColor this$0;
  
  public CSSOMSVGColor$ColorNumber(CSSOMSVGColor paramCSSOMSVGColor, float paramFloat)
  {
    this$0 = paramCSSOMSVGColor;
    value = paramFloat;
  }
  
  public float getValue()
  {
    if (this$0.iccColors == null) {
      return value;
    }
    int i = this$0.iccColors.indexOf(this);
    if (i == -1) {
      return value;
    }
    Value localValue = this$0.valueProvider.getValue().item(1);
    return ((ICCColor)localValue).getColor(i);
  }
  
  public void setValue(float paramFloat)
  {
    value = paramFloat;
    if (this$0.iccColors == null) {
      return;
    }
    int i = this$0.iccColors.indexOf(this);
    if (i == -1) {
      return;
    }
    if (this$0.handler == null) {
      throw new DOMException((short)7, "");
    }
    this$0.handler.colorReplaced(paramFloat, i);
  }
}

/* Location:
 * Qualified Name:     org.apache.batik.css.dom.CSSOMSVGColor.ColorNumber
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.css.dom;

import org.w3c.dom.DOMException;

public abstract class CSSOMSVGColor$FloatComponent
  extends CSSOMSVGColor.AbstractComponent
{
  private final CSSOMSVGColor this$0;
  
  protected CSSOMSVGColor$FloatComponent(CSSOMSVGColor paramCSSOMSVGColor)
  {
    super(paramCSSOMSVGColor);
    this$0 = paramCSSOMSVGColor;
  }
  
  public void setStringValue(short paramShort, String paramString)
    throws DOMException
  {
    throw new DOMException((short)15, "");
  }
}

/* Location:
 * Qualified Name:     org.apache.batik.css.dom.CSSOMSVGColor.FloatComponent
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.css.dom;

import org.apache.batik.css.engine.value.Value;
import org.w3c.dom.DOMException;

public class CSSOMSVGColor$GreenComponent
  extends CSSOMSVGColor.FloatComponent
{
  private final CSSOMSVGColor this$0;
  
  protected CSSOMSVGColor$GreenComponent(CSSOMSVGColor paramCSSOMSVGColor)
  {
    super(paramCSSOMSVGColor);
    this$0 = paramCSSOMSVGColor;
  }
  
  protected Value getValue()
  {
    return this$0.valueProvider.getValue().getGreen();
  }
  
  public void setCssText(String paramString)
    throws DOMException
  {
    if (this$0.handler == null) {
      throw new DOMException((short)7, "");
    }
    getValue();
    this$0.handler.greenTextChanged(paramString);
  }
  
  public void setFloatValue(short paramShort, float paramFloat)
    throws DOMException
  {
    if (this$0.handler == null) {
      throw new DOMException((short)7, "");
    }
    getValue();
    this$0.handler.greenFloatValueChanged(paramShort, paramFloat);
  }
}

/* Location:
 * Qualified Name:     org.apache.batik.css.dom.CSSOMSVGColor.GreenComponent
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.css.dom;

import org.w3c.dom.DOMException;

public abstract interface CSSOMSVGColor$ModificationHandler
{
  public abstract void textChanged(String paramString)
    throws DOMException;
  
  public abstract void redTextChanged(String paramString)
    throws DOMException;
  
  public abstract void redFloatValueChanged(short paramShort, float paramFloat)
    throws DOMException;
  
  public abstract void greenTextChanged(String paramString)
    throws DOMException;
  
  public abstract void greenFloatValueChanged(short paramShort, float paramFloat)
    throws DOMException;
  
  public abstract void blueTextChanged(String paramString)
    throws DOMException;
  
  public abstract void blueFloatValueChanged(short paramShort, float paramFloat)
    throws DOMException;
  
  public abstract void rgbColorChanged(String paramString)
    throws DOMException;
  
  public abstract void rgbColorICCColorChanged(String paramString1, String paramString2)
    throws DOMException;
  
  public abstract void colorChanged(short paramShort, String paramString1, String paramString2)
    throws DOMException;
  
  public abstract void colorProfileChanged(String paramString)
    throws DOMException;
  
  public abstract void colorsCleared()
    throws DOMException;
  
  public abstract void colorsInitialized(float paramFloat)
    throws DOMException;
  
  public abstract void colorInsertedBefore(float paramFloat, int paramInt)
    throws DOMException;
  
  public abstract void colorReplaced(float paramFloat, int paramInt)
    throws DOMException;
  
  public abstract void colorRemoved(int paramInt)
    throws DOMException;
  
  public abstract void colorAppend(float paramFloat)
    throws DOMException;
}

/* Location:
 * Qualified Name:     org.apache.batik.css.dom.CSSOMSVGColor.ModificationHandler
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.css.dom;

import org.apache.batik.css.engine.value.Value;
import org.w3c.dom.DOMException;

public class CSSOMSVGColor$RedComponent
  extends CSSOMSVGColor.FloatComponent
{
  private final CSSOMSVGColor this$0;
  
  protected CSSOMSVGColor$RedComponent(CSSOMSVGColor paramCSSOMSVGColor)
  {
    super(paramCSSOMSVGColor);
    this$0 = paramCSSOMSVGColor;
  }
  
  protected Value getValue()
  {
    return this$0.valueProvider.getValue().getRed();
  }
  
  public void setCssText(String paramString)
    throws DOMException
  {
    if (this$0.handler == null) {
      throw new DOMException((short)7, "");
    }
    getValue();
    this$0.handler.redTextChanged(paramString);
  }
  
  public void setFloatValue(short paramShort, float paramFloat)
    throws DOMException
  {
    if (this$0.handler == null) {
      throw new DOMException((short)7, "");
    }
    getValue();
    this$0.handler.redFloatValueChanged(paramShort, paramFloat);
  }
}

/* Location:
 * Qualified Name:     org.apache.batik.css.dom.CSSOMSVGColor.RedComponent
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.css.dom;

import org.apache.batik.css.engine.value.Value;

public abstract interface CSSOMSVGColor$ValueProvider
{
  public abstract Value getValue();
}

/* Location:
 * Qualified Name:     org.apache.batik.css.dom.CSSOMSVGColor.ValueProvider
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.css.dom;

import java.util.ArrayList;
import org.apache.batik.css.engine.value.AbstractValue;
import org.apache.batik.css.engine.value.FloatValue;
import org.apache.batik.css.engine.value.Value;
import org.apache.batik.css.engine.value.svg.ICCColor;
import org.w3c.dom.DOMException;
import org.w3c.dom.css.CSSPrimitiveValue;
import org.w3c.dom.css.CSSValue;
import org.w3c.dom.css.Counter;
import org.w3c.dom.css.RGBColor;
import org.w3c.dom.css.Rect;
import org.w3c.dom.svg.SVGColor;
import org.w3c.dom.svg.SVGICCColor;
import org.w3c.dom.svg.SVGNumber;
import org.w3c.dom.svg.SVGNumberList;

public class CSSOMSVGColor
  implements SVGColor, RGBColor, SVGICCColor, SVGNumberList
{
  protected ValueProvider valueProvider;
  protected ModificationHandler handler;
  protected RedComponent redComponent;
  protected GreenComponent greenComponent;
  protected BlueComponent blueComponent;
  protected ArrayList iccColors;
  
  public CSSOMSVGColor(ValueProvider paramValueProvider)
  {
    valueProvider = paramValueProvider;
  }
  
  public void setModificationHandler(ModificationHandler paramModificationHandler)
  {
    handler = paramModificationHandler;
  }
  
  public String getCssText()
  {
    return valueProvider.getValue().getCssText();
  }
  
  public void setCssText(String paramString)
    throws DOMException
  {
    if (handler == null) {
      throw new DOMException((short)7, "");
    }
    iccColors = null;
    handler.textChanged(paramString);
  }
  
  public short getCssValueType()
  {
    return 3;
  }
  
  public short getColorType()
  {
    Value localValue = valueProvider.getValue();
    switch (localValue.getCssValueType())
    {
    case 1: 
      switch (localValue.getPrimitiveType())
      {
      case 21: 
        if (localValue.getStringValue().equalsIgnoreCase("currentcolor")) {
          return 3;
        }
        return 1;
      case 25: 
        return 1;
      }
      break;
    case 2: 
      return 2;
    }
    throw new InternalError();
  }
  
  public RGBColor getRGBColor()
  {
    return this;
  }
  
  public RGBColor getRgbColor()
  {
    return this;
  }
  
  public void setRGBColor(String paramString)
  {
    if (handler == null) {
      throw new DOMException((short)7, "");
    }
    handler.rgbColorChanged(paramString);
  }
  
  public SVGICCColor getICCColor()
  {
    return this;
  }
  
  public SVGICCColor getIccColor()
  {
    return this;
  }
  
  public void setRGBColorICCColor(String paramString1, String paramString2)
  {
    if (handler == null) {
      throw new DOMException((short)7, "");
    }
    iccColors = null;
    handler.rgbColorICCColorChanged(paramString1, paramString2);
  }
  
  public void setColor(short paramShort, String paramString1, String paramString2)
  {
    if (handler == null) {
      throw new DOMException((short)7, "");
    }
    iccColors = null;
    handler.colorChanged(paramShort, paramString1, paramString2);
  }
  
  public CSSPrimitiveValue getRed()
  {
    valueProvider.getValue().getRed();
    if (redComponent == null) {
      redComponent = new RedComponent();
    }
    return redComponent;
  }
  
  public CSSPrimitiveValue getGreen()
  {
    valueProvider.getValue().getGreen();
    if (greenComponent == null) {
      greenComponent = new GreenComponent();
    }
    return greenComponent;
  }
  
  public CSSPrimitiveValue getBlue()
  {
    valueProvider.getValue().getBlue();
    if (blueComponent == null) {
      blueComponent = new BlueComponent();
    }
    return blueComponent;
  }
  
  public String getColorProfile()
  {
    if (getColorType() != 2) {
      throw new DOMException((short)12, "");
    }
    Value localValue = valueProvider.getValue();
    return ((ICCColor)localValue.item(1)).getColorProfile();
  }
  
  public void setColorProfile(String paramString)
    throws DOMException
  {
    if (handler == null) {
      throw new DOMException((short)7, "");
    }
    handler.colorProfileChanged(paramString);
  }
  
  public SVGNumberList getColors()
  {
    return this;
  }
  
  public int getNumberOfItems()
  {
    if (getColorType() != 2) {
      throw new DOMException((short)12, "");
    }
    Value localValue = valueProvider.getValue();
    return ((ICCColor)localValue.item(1)).getNumberOfColors();
  }
  
  public void clear()
    throws DOMException
  {
    if (handler == null) {
      throw new DOMException((short)7, "");
    }
    iccColors = null;
    handler.colorsCleared();
  }
  
  public SVGNumber initialize(SVGNumber paramSVGNumber)
    throws DOMException
  {
    if (handler == null) {
      throw new DOMException((short)7, "");
    }
    float f = paramSVGNumber.getValue();
    iccColors = new ArrayList();
    ColorNumber localColorNumber = new ColorNumber(f);
    iccColors.add(localColorNumber);
    handler.colorsInitialized(f);
    return localColorNumber;
  }
  
  public SVGNumber getItem(int paramInt)
    throws DOMException
  {
    if (getColorType() != 2) {
      throw new DOMException((short)1, "");
    }
    int i = getNumberOfItems();
    if ((paramInt < 0) || (paramInt >= i)) {
      throw new DOMException((short)1, "");
    }
    if (iccColors == null)
    {
      iccColors = new ArrayList(i);
      for (int j = iccColors.size(); j < i; j++) {
        iccColors.add(null);
      }
    }
    Value localValue = valueProvider.getValue().item(1);
    float f = ((ICCColor)localValue).getColor(paramInt);
    ColorNumber localColorNumber = new ColorNumber(f);
    iccColors.set(paramInt, localColorNumber);
    return localColorNumber;
  }
  
  public SVGNumber insertItemBefore(SVGNumber paramSVGNumber, int paramInt)
    throws DOMException
  {
    if (handler == null) {
      throw new DOMException((short)7, "");
    }
    int i = getNumberOfItems();
    if ((paramInt < 0) || (paramInt > i)) {
      throw new DOMException((short)1, "");
    }
    if (iccColors == null)
    {
      iccColors = new ArrayList(i);
      for (int j = iccColors.size(); j < i; j++) {
        iccColors.add(null);
      }
    }
    float f = paramSVGNumber.getValue();
    ColorNumber localColorNumber = new ColorNumber(f);
    iccColors.add(paramInt, localColorNumber);
    handler.colorInsertedBefore(f, paramInt);
    return localColorNumber;
  }
  
  public SVGNumber replaceItem(SVGNumber paramSVGNumber, int paramInt)
    throws DOMException
  {
    if (handler == null) {
      throw new DOMException((short)7, "");
    }
    int i = getNumberOfItems();
    if ((paramInt < 0) || (paramInt >= i)) {
      throw new DOMException((short)1, "");
    }
    if (iccColors == null)
    {
      iccColors = new ArrayList(i);
      for (int j = iccColors.size(); j < i; j++) {
        iccColors.add(null);
      }
    }
    float f = paramSVGNumber.getValue();
    ColorNumber localColorNumber = new ColorNumber(f);
    iccColors.set(paramInt, localColorNumber);
    handler.colorReplaced(f, paramInt);
    return localColorNumber;
  }
  
  public SVGNumber removeItem(int paramInt)
    throws DOMException
  {
    if (handler == null) {
      throw new DOMException((short)7, "");
    }
    int i = getNumberOfItems();
    if ((paramInt < 0) || (paramInt >= i)) {
      throw new DOMException((short)1, "");
    }
    ColorNumber localColorNumber = null;
    if (iccColors != null) {
      localColorNumber = (ColorNumber)iccColors.get(paramInt);
    }
    if (localColorNumber == null)
    {
      Value localValue = valueProvider.getValue().item(1);
      localColorNumber = new ColorNumber(((ICCColor)localValue).getColor(paramInt));
    }
    handler.colorRemoved(paramInt);
    return localColorNumber;
  }
  
  public SVGNumber appendItem(SVGNumber paramSVGNumber)
    throws DOMException
  {
    if (handler == null) {
      throw new DOMException((short)7, "");
    }
    if (iccColors == null)
    {
      int i = getNumberOfItems();
      iccColors = new ArrayList(i);
      for (int j = 0; j < i; j++) {
        iccColors.add(null);
      }
    }
    float f = paramSVGNumber.getValue();
    ColorNumber localColorNumber = new ColorNumber(f);
    iccColors.add(localColorNumber);
    handler.colorAppend(f);
    return localColorNumber;
  }
  
  protected abstract class AbstractComponent
    implements CSSPrimitiveValue
  {
    protected AbstractComponent() {}
    
    protected abstract Value getValue();
    
    public String getCssText()
    {
      return getValue().getCssText();
    }
    
    public short getCssValueType()
    {
      return getValue().getCssValueType();
    }
    
    public short getPrimitiveType()
    {
      return getValue().getPrimitiveType();
    }
    
    public float getFloatValue(short paramShort)
      throws DOMException
    {
      return CSSOMValue.convertFloatValue(paramShort, getValue());
    }
    
    public String getStringValue()
      throws DOMException
    {
      return valueProvider.getValue().getStringValue();
    }
    
    public Counter getCounterValue()
      throws DOMException
    {
      throw new DOMException((short)15, "");
    }
    
    public Rect getRectValue()
      throws DOMException
    {
      throw new DOMException((short)15, "");
    }
    
    public RGBColor getRGBColorValue()
      throws DOMException
    {
      throw new DOMException((short)15, "");
    }
    
    public int getLength()
    {
      throw new DOMException((short)15, "");
    }
    
    public CSSValue item(int paramInt)
    {
      throw new DOMException((short)15, "");
    }
    
    public abstract void setStringValue(short paramShort, String paramString)
      throws DOMException;
    
    public abstract void setFloatValue(short paramShort, float paramFloat)
      throws DOMException;
    
    public abstract void setCssText(String paramString)
      throws DOMException;
  }
  
  public abstract class AbstractModificationHandler
    implements CSSOMSVGColor.ModificationHandler
  {
    public AbstractModificationHandler() {}
    
    protected abstract Value getValue();
    
    public void redTextChanged(String paramString)
      throws DOMException
    {
      switch (getColorType())
      {
      case 1: 
        paramString = "rgb(" + paramString + ", " + getValue().getGreen().getCssText() + ", " + getValue().getBlue().getCssText() + ")";
        break;
      case 2: 
        paramString = "rgb(" + paramString + ", " + getValue().item(0).getGreen().getCssText() + ", " + getValue().item(0).getBlue().getCssText() + ") " + getValue().item(1).getCssText();
        break;
      default: 
        throw new DOMException((short)7, "");
      }
      textChanged(paramString);
    }
    
    public void redFloatValueChanged(short paramShort, float paramFloat)
      throws DOMException
    {
      String str;
      switch (getColorType())
      {
      case 1: 
        str = "rgb(" + FloatValue.getCssText(paramShort, paramFloat) + ", " + getValue().getGreen().getCssText() + ", " + getValue().getBlue().getCssText() + ")";
        break;
      case 2: 
        str = "rgb(" + FloatValue.getCssText(paramShort, paramFloat) + ", " + getValue().item(0).getGreen().getCssText() + ", " + getValue().item(0).getBlue().getCssText() + ") " + getValue().item(1).getCssText();
        break;
      default: 
        throw new DOMException((short)7, "");
      }
      textChanged(str);
    }
    
    public void greenTextChanged(String paramString)
      throws DOMException
    {
      switch (getColorType())
      {
      case 1: 
        paramString = "rgb(" + getValue().getRed().getCssText() + ", " + paramString + ", " + getValue().getBlue().getCssText() + ")";
        break;
      case 2: 
        paramString = "rgb(" + getValue().item(0).getRed().getCssText() + ", " + paramString + ", " + getValue().item(0).getBlue().getCssText() + ") " + getValue().item(1).getCssText();
        break;
      default: 
        throw new DOMException((short)7, "");
      }
      textChanged(paramString);
    }
    
    public void greenFloatValueChanged(short paramShort, float paramFloat)
      throws DOMException
    {
      String str;
      switch (getColorType())
      {
      case 1: 
        str = "rgb(" + getValue().getRed().getCssText() + ", " + FloatValue.getCssText(paramShort, paramFloat) + ", " + getValue().getBlue().getCssText() + ")";
        break;
      case 2: 
        str = "rgb(" + getValue().item(0).getRed().getCssText() + ", " + FloatValue.getCssText(paramShort, paramFloat) + ", " + getValue().item(0).getBlue().getCssText() + ") " + getValue().item(1).getCssText();
        break;
      default: 
        throw new DOMException((short)7, "");
      }
      textChanged(str);
    }
    
    public void blueTextChanged(String paramString)
      throws DOMException
    {
      switch (getColorType())
      {
      case 1: 
        paramString = "rgb(" + getValue().getRed().getCssText() + ", " + getValue().getGreen().getCssText() + ", " + paramString + ")";
        break;
      case 2: 
        paramString = "rgb(" + getValue().item(0).getRed().getCssText() + ", " + getValue().item(0).getGreen().getCssText() + ", " + paramString + ") " + getValue().item(1).getCssText();
      default: 
        throw new DOMException((short)7, "");
      }
      textChanged(paramString);
    }
    
    public void blueFloatValueChanged(short paramShort, float paramFloat)
      throws DOMException
    {
      String str;
      switch (getColorType())
      {
      case 1: 
        str = "rgb(" + getValue().getRed().getCssText() + ", " + getValue().getGreen().getCssText() + ", " + FloatValue.getCssText(paramShort, paramFloat) + ")";
        break;
      case 2: 
        str = "rgb(" + getValue().item(0).getRed().getCssText() + ", " + getValue().item(0).getGreen().getCssText() + ", " + FloatValue.getCssText(paramShort, paramFloat) + ") " + getValue().item(1).getCssText();
        break;
      default: 
        throw new DOMException((short)7, "");
      }
      textChanged(str);
    }
    
    public void rgbColorChanged(String paramString)
      throws DOMException
    {
      switch (getColorType())
      {
      case 1: 
        break;
      case 2: 
        paramString = paramString + getValue().item(1).getCssText();
        break;
      default: 
        throw new DOMException((short)7, "");
      }
      textChanged(paramString);
    }
    
    public void rgbColorICCColorChanged(String paramString1, String paramString2)
      throws DOMException
    {
      switch (getColorType())
      {
      case 2: 
        textChanged(paramString1 + " " + paramString2);
        break;
      default: 
        throw new DOMException((short)7, "");
      }
    }
    
    public void colorChanged(short paramShort, String paramString1, String paramString2)
      throws DOMException
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd