org.apache.batik.dom.svg_1.6.0.v201011041432

16:40:51.250 INFO  jd.cli.Main - Decompiling org.apache.batik.dom.svg_1.6.0.v201011041432.jar
package org.apache.batik.dom.svg;

import org.apache.batik.dom.AbstractAttr;
import org.apache.batik.dom.AbstractElement.NamedNodeHashMap;
import org.apache.batik.dom.AbstractNode;
import org.w3c.dom.Attr;
import org.w3c.dom.DOMException;
import org.w3c.dom.Document;
import org.w3c.dom.Node;

public class AbstractElement$ExtendedNamedNodeHashMap
  extends AbstractElement.NamedNodeHashMap
{
  private final AbstractElement this$0;
  
  public AbstractElement$ExtendedNamedNodeHashMap(AbstractElement paramAbstractElement)
  {
    super(paramAbstractElement);
    this$0 = paramAbstractElement;
  }
  
  public void setUnspecifiedAttribute(String paramString1, String paramString2, String paramString3)
  {
    Attr localAttr = this$0.getOwnerDocument().createAttributeNS(paramString1, paramString2);
    localAttr.setValue(paramString3);
    ((AbstractAttr)localAttr).setSpecified(false);
    setNamedItemNS(localAttr);
  }
  
  public Node removeNamedItemNS(String paramString1, String paramString2)
    throws DOMException
  {
    if (this$0.isReadonly()) {
      throw this$0.createDOMException((short)7, "readonly.node.map", new Object[0]);
    }
    if (paramString2 == null) {
      throw this$0.createDOMException((short)8, "attribute.missing", new Object[] { "" });
    }
    AbstractAttr localAbstractAttr = (AbstractAttr)remove(paramString1, paramString2);
    if (localAbstractAttr == null) {
      throw this$0.createDOMException((short)8, "attribute.missing", new Object[] { paramString2 });
    }
    localAbstractAttr.setOwnerElement(null);
    String str = localAbstractAttr.getPrefix();
    if (!this$0.resetAttribute(paramString1, str, paramString2)) {
      this$0.fireDOMAttrModifiedEvent(localAbstractAttr.getNodeName(), localAbstractAttr, localAbstractAttr.getNodeValue(), "", (short)3);
    }
    return localAbstractAttr;
  }
}

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

import org.apache.batik.css.engine.CSSEngine;
import org.apache.batik.dom.AbstractAttr;
import org.apache.batik.dom.AbstractDocument;
import org.apache.batik.dom.AbstractElement.NamedNodeHashMap;
import org.apache.batik.dom.AbstractNode;
import org.apache.batik.dom.AbstractParentChildNode;
import org.apache.batik.dom.events.NodeEventTarget;
import org.apache.batik.util.SoftDoublyIndexedTable;
import org.w3c.dom.Attr;
import org.w3c.dom.DOMException;
import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;

public abstract class AbstractElement
  extends org.apache.batik.dom.AbstractElement
  implements NodeEventTarget
{
  protected transient SoftDoublyIndexedTable liveAttributeValues;
  
  protected AbstractElement() {}
  
  protected AbstractElement(String paramString, AbstractDocument paramAbstractDocument)
  {
    ownerDocument = paramAbstractDocument;
    setPrefix(paramString);
    initializeAttributes();
  }
  
  public NodeEventTarget getParentNodeEventTarget()
  {
    return (NodeEventTarget)CSSEngine.getLogicalParentNode(getParentNode());
  }
  
  public LiveAttributeValue getLiveAttributeValue(String paramString1, String paramString2)
  {
    if (liveAttributeValues == null) {
      return null;
    }
    return (LiveAttributeValue)liveAttributeValues.get(paramString1, paramString2);
  }
  
  public void putLiveAttributeValue(String paramString1, String paramString2, LiveAttributeValue paramLiveAttributeValue)
  {
    if (liveAttributeValues == null) {
      liveAttributeValues = new SoftDoublyIndexedTable();
    }
    liveAttributeValues.put(paramString1, paramString2, paramLiveAttributeValue);
  }
  
  protected AttributeInitializer getAttributeInitializer()
  {
    return null;
  }
  
  protected void initializeAttributes()
  {
    AttributeInitializer localAttributeInitializer = getAttributeInitializer();
    if (localAttributeInitializer != null) {
      localAttributeInitializer.initializeAttributes(this);
    }
  }
  
  protected boolean resetAttribute(String paramString1, String paramString2, String paramString3)
  {
    AttributeInitializer localAttributeInitializer = getAttributeInitializer();
    if (localAttributeInitializer == null) {
      return false;
    }
    return localAttributeInitializer.resetAttribute(this, paramString1, paramString2, paramString3);
  }
  
  protected NamedNodeMap createAttributes()
  {
    return new ExtendedNamedNodeHashMap();
  }
  
  public void setUnspecifiedAttribute(String paramString1, String paramString2, String paramString3)
  {
    if (attributes == null) {
      attributes = createAttributes();
    }
    ((ExtendedNamedNodeHashMap)attributes).setUnspecifiedAttribute(paramString1, paramString2, paramString3);
  }
  
  protected void attrAdded(Attr paramAttr, String paramString)
  {
    LiveAttributeValue localLiveAttributeValue = getLiveAttributeValue(paramAttr);
    if (localLiveAttributeValue != null) {
      localLiveAttributeValue.attrAdded(paramAttr, paramString);
    }
  }
  
  protected void attrModified(Attr paramAttr, String paramString1, String paramString2)
  {
    LiveAttributeValue localLiveAttributeValue = getLiveAttributeValue(paramAttr);
    if (localLiveAttributeValue != null) {
      localLiveAttributeValue.attrModified(paramAttr, paramString1, paramString2);
    }
  }
  
  protected void attrRemoved(Attr paramAttr, String paramString)
  {
    LiveAttributeValue localLiveAttributeValue = getLiveAttributeValue(paramAttr);
    if (localLiveAttributeValue != null) {
      localLiveAttributeValue.attrRemoved(paramAttr, paramString);
    }
  }
  
  private LiveAttributeValue getLiveAttributeValue(Attr paramAttr)
  {
    String str = paramAttr.getNamespaceURI();
    return getLiveAttributeValue(str, str == null ? paramAttr.getNodeName() : paramAttr.getLocalName());
  }
  
  protected Node export(Node paramNode, AbstractDocument paramAbstractDocument)
  {
    super.export(paramNode, paramAbstractDocument);
    ((AbstractElement)paramNode).initializeAttributes();
    super.export(paramNode, paramAbstractDocument);
    return paramNode;
  }
  
  protected Node deepExport(Node paramNode, AbstractDocument paramAbstractDocument)
  {
    super.export(paramNode, paramAbstractDocument);
    ((AbstractElement)paramNode).initializeAttributes();
    super.deepExport(paramNode, paramAbstractDocument);
    return paramNode;
  }
  
  protected class ExtendedNamedNodeHashMap
    extends AbstractElement.NamedNodeHashMap
  {
    public ExtendedNamedNodeHashMap()
    {
      super();
    }
    
    public void setUnspecifiedAttribute(String paramString1, String paramString2, String paramString3)
    {
      Attr localAttr = getOwnerDocument().createAttributeNS(paramString1, paramString2);
      localAttr.setValue(paramString3);
      ((AbstractAttr)localAttr).setSpecified(false);
      setNamedItemNS(localAttr);
    }
    
    public Node removeNamedItemNS(String paramString1, String paramString2)
      throws DOMException
    {
      if (isReadonly()) {
        throw createDOMException((short)7, "readonly.node.map", new Object[0]);
      }
      if (paramString2 == null) {
        throw createDOMException((short)8, "attribute.missing", new Object[] { "" });
      }
      AbstractAttr localAbstractAttr = (AbstractAttr)remove(paramString1, paramString2);
      if (localAbstractAttr == null) {
        throw createDOMException((short)8, "attribute.missing", new Object[] { paramString2 });
      }
      localAbstractAttr.setOwnerElement(null);
      String str = localAbstractAttr.getPrefix();
      if (!resetAttribute(paramString1, str, paramString2)) {
        fireDOMAttrModifiedEvent(localAbstractAttr.getNodeName(), localAbstractAttr, localAbstractAttr.getNodeValue(), "", (short)3);
      }
      return localAbstractAttr;
    }
  }
}

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

import org.apache.batik.dom.AbstractElement;
import org.w3c.dom.Attr;

public class AbstractSVGAnimatedLength$BaseSVGLength
  extends AbstractSVGLength
{
  protected boolean valid;
  private final AbstractSVGAnimatedLength this$0;
  
  public AbstractSVGAnimatedLength$BaseSVGLength(AbstractSVGAnimatedLength paramAbstractSVGAnimatedLength, short paramShort)
  {
    super(paramShort);
    this$0 = paramAbstractSVGAnimatedLength;
  }
  
  public void invalidate()
  {
    valid = false;
  }
  
  protected void reset()
  {
    try
    {
      this$0.changing = true;
      String str = getValueAsString();
      this$0.element.setAttributeNS(this$0.namespaceURI, this$0.localName, str);
    }
    finally
    {
      this$0.changing = false;
    }
  }
  
  protected void revalidate()
  {
    if (valid) {
      return;
    }
    String str = null;
    Attr localAttr = this$0.element.getAttributeNodeNS(this$0.namespaceURI, this$0.localName);
    if (localAttr == null) {
      str = this$0.getDefaultValue();
    } else {
      str = localAttr.getValue();
    }
    parse(str);
    valid = true;
  }
  
  protected SVGOMElement getAssociatedElement()
  {
    return (SVGOMElement)this$0.element;
  }
}

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

import org.w3c.dom.Attr;
import org.w3c.dom.svg.SVGAnimatedLength;
import org.w3c.dom.svg.SVGLength;

public abstract class AbstractSVGAnimatedLength
  implements SVGAnimatedLength, LiveAttributeValue
{
  public static final short HORIZONTAL_LENGTH = 2;
  public static final short VERTICAL_LENGTH = 1;
  public static final short OTHER_LENGTH = 0;
  protected AbstractElement element;
  protected String namespaceURI;
  protected String localName;
  protected short direction;
  protected BaseSVGLength baseVal;
  protected boolean changing;
  
  protected AbstractSVGAnimatedLength(AbstractElement paramAbstractElement, String paramString1, String paramString2, short paramShort)
  {
    element = paramAbstractElement;
    namespaceURI = paramString1;
    localName = paramString2;
    direction = paramShort;
  }
  
  protected abstract String getDefaultValue();
  
  public SVGLength getBaseVal()
  {
    if (baseVal == null) {
      baseVal = new BaseSVGLength(direction);
    }
    return baseVal;
  }
  
  public SVGLength getAnimVal()
  {
    throw new RuntimeException("!!! TODO: getAnimVal()");
  }
  
  public void attrAdded(Attr paramAttr, String paramString)
  {
    if ((!changing) && (baseVal != null)) {
      baseVal.invalidate();
    }
  }
  
  public void attrModified(Attr paramAttr, String paramString1, String paramString2)
  {
    if ((!changing) && (baseVal != null)) {
      baseVal.invalidate();
    }
  }
  
  public void attrRemoved(Attr paramAttr, String paramString)
  {
    if ((!changing) && (baseVal != null)) {
      baseVal.invalidate();
    }
  }
  
  protected class BaseSVGLength
    extends AbstractSVGLength
  {
    protected boolean valid;
    
    public BaseSVGLength(short paramShort)
    {
      super();
    }
    
    public void invalidate()
    {
      valid = false;
    }
    
    protected void reset()
    {
      try
      {
        changing = true;
        String str = getValueAsString();
        element.setAttributeNS(namespaceURI, localName, str);
      }
      finally
      {
        changing = false;
      }
    }
    
    protected void revalidate()
    {
      if (valid) {
        return;
      }
      String str = null;
      Attr localAttr = element.getAttributeNodeNS(namespaceURI, localName);
      if (localAttr == null) {
        str = getDefaultValue();
      } else {
        str = localAttr.getValue();
      }
      parse(str);
      valid = true;
    }
    
    protected SVGOMElement getAssociatedElement()
    {
      return (SVGOMElement)element;
    }
  }
}

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

public abstract class AbstractSVGItem
  implements SVGItem
{
  protected AbstractSVGList parent;
  protected String itemStringValue;
  
  protected abstract String getStringValue();
  
  public void setParent(AbstractSVGList paramAbstractSVGList)
  {
    parent = paramAbstractSVGList;
  }
  
  public AbstractSVGList getParent()
  {
    return parent;
  }
  
  protected void resetAttribute()
  {
    if (parent != null)
    {
      itemStringValue = null;
      parent.itemChanged();
    }
  }
  
  public String getValueAsString()
  {
    if (itemStringValue == null) {
      itemStringValue = getStringValue();
    }
    return itemStringValue;
  }
}

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

import org.apache.batik.parser.UnitProcessor.Context;
import org.w3c.dom.Element;

public class AbstractSVGLength$DefaultContext
  implements UnitProcessor.Context
{
  private final AbstractSVGLength this$0;
  
  protected AbstractSVGLength$DefaultContext(AbstractSVGLength paramAbstractSVGLength)
  {
    this$0 = paramAbstractSVGLength;
  }
  
  public Element getElement()
  {
    return this$0.getAssociatedElement();
  }
  
  public float getPixelUnitToMillimeter()
  {
    SVGContext localSVGContext = this$0.getAssociatedElement().getSVGContext();
    return localSVGContext.getPixelUnitToMillimeter();
  }
  
  public float getPixelToMM()
  {
    return getPixelUnitToMillimeter();
  }
  
  public float getFontSize()
  {
    return this$0.getAssociatedElement().getSVGContext().getFontSize();
  }
  
  public float getXHeight()
  {
    return 0.5F;
  }
  
  public float getViewportWidth()
  {
    return this$0.getAssociatedElement().getSVGContext().getViewportWidth();
  }
  
  public float getViewportHeight()
  {
    return this$0.getAssociatedElement().getSVGContext().getViewportHeight();
  }
}

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

import org.apache.batik.parser.AbstractParser;
import org.apache.batik.parser.LengthParser;
import org.apache.batik.parser.ParseException;
import org.apache.batik.parser.UnitProcessor;
import org.apache.batik.parser.UnitProcessor.Context;
import org.apache.batik.parser.UnitProcessor.UnitResolver;
import org.w3c.dom.DOMException;
import org.w3c.dom.Element;
import org.w3c.dom.svg.SVGLength;

public abstract class AbstractSVGLength
  implements SVGLength
{
  public static final short HORIZONTAL_LENGTH = 2;
  public static final short VERTICAL_LENGTH = 1;
  public static final short OTHER_LENGTH = 0;
  protected short unitType;
  protected float value;
  protected short direction;
  protected UnitProcessor.Context context = new DefaultContext();
  protected static final String[] UNITS = { "", "", "%", "em", "ex", "px", "cm", "mm", "in", "pt", "pc" };
  
  protected abstract SVGOMElement getAssociatedElement();
  
  public AbstractSVGLength(short paramShort)
  {
    direction = paramShort;
    value = 0.0F;
    unitType = 1;
  }
  
  public short getUnitType()
  {
    revalidate();
    return unitType;
  }
  
  public float getValue()
  {
    revalidate();
    return UnitProcessor.svgToUserSpace(value, unitType, direction, context);
  }
  
  public void setValue(float paramFloat)
    throws DOMException
  {
    revalidate();
    value = UnitProcessor.userSpaceToSVG(paramFloat, unitType, direction, context);
    reset();
  }
  
  public float getValueInSpecifiedUnits()
  {
    revalidate();
    return value;
  }
  
  public void setValueInSpecifiedUnits(float paramFloat)
    throws DOMException
  {
    revalidate();
    value = paramFloat;
    reset();
  }
  
  public String getValueAsString()
  {
    revalidate();
    return Float.toString(value) + UNITS[unitType];
  }
  
  public void setValueAsString(String paramString)
    throws DOMException
  {
    parse(paramString);
    reset();
  }
  
  public void newValueSpecifiedUnits(short paramShort, float paramFloat)
  {
    unitType = paramShort;
    value = paramFloat;
    reset();
  }
  
  public void convertToSpecifiedUnits(short paramShort)
  {
    float f = getValue();
    unitType = paramShort;
    setValue(f);
  }
  
  protected void reset() {}
  
  protected void revalidate() {}
  
  protected void parse(String paramString)
  {
    try
    {
      LengthParser localLengthParser = new LengthParser();
      UnitProcessor.UnitResolver localUnitResolver = new UnitProcessor.UnitResolver();
      localLengthParser.setLengthHandler(localUnitResolver);
      localLengthParser.parse(paramString);
      unitType = unit;
      value = value;
    }
    catch (ParseException localParseException)
    {
      unitType = 0;
      value = 0.0F;
    }
  }
  
  protected class DefaultContext
    implements UnitProcessor.Context
  {
    protected DefaultContext() {}
    
    public Element getElement()
    {
      return getAssociatedElement();
    }
    
    public float getPixelUnitToMillimeter()
    {
      SVGContext localSVGContext = getAssociatedElement().getSVGContext();
      return localSVGContext.getPixelUnitToMillimeter();
    }
    
    public float getPixelToMM()
    {
      return getPixelUnitToMillimeter();
    }
    
    public float getFontSize()
    {
      return getAssociatedElement().getSVGContext().getFontSize();
    }
    
    public float getXHeight()
    {
      return 0.5F;
    }
    
    public float getViewportWidth()
    {
      return getAssociatedElement().getSVGContext().getViewportWidth();
    }
    
    public float getViewportHeight()
    {
      return getAssociatedElement().getSVGContext().getViewportHeight();
    }
  }
}

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

import org.apache.batik.parser.LengthListHandler;
import org.apache.batik.parser.ParseException;

public class AbstractSVGLengthList$LengthListBuilder
  implements LengthListHandler
{
  protected ListHandler listHandler;
  protected float currentValue;
  protected short currentType;
  private final AbstractSVGLengthList this$0;
  
  public AbstractSVGLengthList$LengthListBuilder(AbstractSVGLengthList paramAbstractSVGLengthList, ListHandler paramListHandler)
  {
    this$0 = paramAbstractSVGLengthList;
    listHandler = paramListHandler;
  }
  
  public void startLengthList()
    throws ParseException
  {
    listHandler.startList();
  }
  
  public void startLength()
    throws ParseException
  {
    currentType = 1;
    currentValue = 0.0F;
  }
  
  public void lengthValue(float paramFloat)
    throws ParseException
  {
    currentValue = paramFloat;
  }
  
  public void em()
    throws ParseException
  {
    currentType = 3;
  }
  
  public void ex()
    throws ParseException
  {
    currentType = 4;
  }
  
  public void in()
    throws ParseException
  {
    currentType = 8;
  }
  
  public void cm()
    throws ParseException
  {
    currentType = 6;
  }
  
  public void mm()
    throws ParseException
  {
    currentType = 7;
  }
  
  public void pc()
    throws ParseException
  {
    currentType = 10;
  }
  
  public void pt()
    throws ParseException
  {
    currentType = 3;
  }
  
  public void px()
    throws ParseException
  {
    currentType = 5;
  }
  
  public void percentage()
    throws ParseException
  {
    currentType = 2;
  }
  
  public void endLength()
    throws ParseException
  {
    listHandler.item(new AbstractSVGLengthList.SVGLengthItem(this$0, currentType, currentValue, this$0.direction));
  }
  
  public void endLengthList()
    throws ParseException
  {
    listHandler.endList();
  }
}

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

public class AbstractSVGLengthList$SVGLengthItem
  extends AbstractSVGLength
  implements SVGItem
{
  protected AbstractSVGList parentList;
  private final AbstractSVGLengthList this$0;
  
  public AbstractSVGLengthList$SVGLengthItem(AbstractSVGLengthList paramAbstractSVGLengthList, short paramShort1, float paramFloat, short paramShort2)
  {
    super(paramShort2);
    this$0 = paramAbstractSVGLengthList;
    unitType = paramShort1;
    value = paramFloat;
  }
  
  protected SVGOMElement getAssociatedElement()
  {
    return (SVGOMElement)this$0.getElement();
  }
  
  public void setParent(AbstractSVGList paramAbstractSVGList)
  {
    parentList = paramAbstractSVGList;
  }
  
  public AbstractSVGList getParent()
  {
    return parentList;
  }
  
  protected void reset()
  {
    if (parentList != null) {
      parentList.itemChanged();
    }
  }
}

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

import org.apache.batik.parser.AbstractParser;
import org.apache.batik.parser.LengthListHandler;
import org.apache.batik.parser.LengthListParser;
import org.apache.batik.parser.ParseException;
import org.w3c.dom.DOMException;
import org.w3c.dom.Element;
import org.w3c.dom.svg.SVGException;
import org.w3c.dom.svg.SVGLength;
import org.w3c.dom.svg.SVGLengthList;

public abstract class AbstractSVGLengthList
  extends AbstractSVGList
  implements SVGLengthList
{
  protected short direction;
  public static final String SVG_LENGTH_LIST_SEPARATOR = " ";
  
  protected String getItemSeparator()
  {
    return " ";
  }
  
  protected abstract SVGException createSVGException(short paramShort, String paramString, Object[] paramArrayOfObject);
  
  protected abstract Element getElement();
  
  protected AbstractSVGLengthList(short paramShort)
  {
    direction = paramShort;
  }
  
  public SVGLength initialize(SVGLength paramSVGLength)
    throws DOMException, SVGException
  {
    return (SVGLength)initializeImpl(paramSVGLength);
  }
  
  public SVGLength getItem(int paramInt)
    throws DOMException
  {
    return (SVGLength)getItemImpl(paramInt);
  }
  
  public SVGLength insertItemBefore(SVGLength paramSVGLength, int paramInt)
    throws DOMException, SVGException
  {
    return (SVGLength)insertItemBeforeImpl(paramSVGLength, paramInt);
  }
  
  public SVGLength replaceItem(SVGLength paramSVGLength, int paramInt)
    throws DOMException, SVGException
  {
    return (SVGLength)replaceItemImpl(paramSVGLength, paramInt);
  }
  
  public SVGLength removeItem(int paramInt)
    throws DOMException
  {
    return (SVGLength)removeItemImpl(paramInt);
  }
  
  public SVGLength appendItem(SVGLength paramSVGLength)
    throws DOMException, SVGException
  {
    return (SVGLength)appendItemImpl(paramSVGLength);
  }
  
  protected SVGItem createSVGItem(Object paramObject)
  {
    SVGLength localSVGLength = (SVGLength)paramObject;
    return new SVGLengthItem(localSVGLength.getUnitType(), localSVGLength.getValueInSpecifiedUnits(), direction);
  }
  
  protected void doParse(String paramString, ListHandler paramListHandler)
    throws ParseException
  {
    LengthListParser localLengthListParser = new LengthListParser();
    LengthListBuilder localLengthListBuilder = new LengthListBuilder(paramListHandler);
    localLengthListParser.setLengthListHandler(localLengthListBuilder);
    localLengthListParser.parse(paramString);
  }
  
  protected void checkItemType(Object paramObject)
    throws SVGException
  {
    if (!(paramObject instanceof SVGLength)) {
      createSVGException((short)0, "expected SVGLength", null);
    }
  }
  
  protected class LengthListBuilder
    implements LengthListHandler
  {
    protected ListHandler listHandler;
    protected float currentValue;
    protected short currentType;
    
    public LengthListBuilder(ListHandler paramListHandler)
    {
      listHandler = paramListHandler;
    }
    
    public void startLengthList()
      throws ParseException
    {
      listHandler.startList();
    }
    
    public void startLength()
      throws ParseException
    {
      currentType = 1;
      currentValue = 0.0F;
    }
    
    public void lengthValue(float paramFloat)
      throws ParseException
    {
      currentValue = paramFloat;
    }
    
    public void em()
      throws ParseException
    {
      currentType = 3;
    }
    
    public void ex()
      throws ParseException
    {
      currentType = 4;
    }
    
    public void in()
      throws ParseException
    {
      currentType = 8;
    }
    
    public void cm()
      throws ParseException
    {
      currentType = 6;
    }
    
    public void mm()
      throws ParseException
    {
      currentType = 7;
    }
    
    public void pc()
      throws ParseException
    {
      currentType = 10;
    }
    
    public void pt()
      throws ParseException
    {
      currentType = 3;
    }
    
    public void px()
      throws ParseException
    {
      currentType = 5;
    }
    
    public void percentage()
      throws ParseException
    {
      currentType = 2;
    }
    
    public void endLength()
      throws ParseException
    {
      listHandler.item(new AbstractSVGLengthList.SVGLengthItem(AbstractSVGLengthList.this, currentType, currentValue, direction));
    }
    
    public void endLengthList()
      throws ParseException
    {
      listHandler.endList();
    }
  }
  
  protected class SVGLengthItem
    extends AbstractSVGLength
    implements SVGItem
  {
    protected AbstractSVGList parentList;
    
    public SVGLengthItem(short paramShort1, float paramFloat, short paramShort2)
    {
      super();
      unitType = paramShort1;
      value = paramFloat;
    }
    
    protected SVGOMElement getAssociatedElement()
    {
      return (SVGOMElement)getElement();
    }
    
    public void setParent(AbstractSVGList paramAbstractSVGList)
    {
      parentList = paramAbstractSVGList;
    }
    
    public AbstractSVGList getParent()
    {
      return parentList;
    }
    
    protected void reset()
    {
      if (parentList != null) {
        parentList.itemChanged();
      }
    }
  }
}

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

import java.util.ArrayList;
import java.util.List;

public class AbstractSVGList$ListBuilder
  implements ListHandler
{
  protected List list;
  private final AbstractSVGList this$0;
  
  public AbstractSVGList$ListBuilder(AbstractSVGList paramAbstractSVGList)
  {
    this$0 = paramAbstractSVGList;
  }
  
  public List getList()
  {
    return list;
  }
  
  public void startList()
  {
    if (list == null) {
      list = new ArrayList();
    }
  }
  
  public void item(SVGItem paramSVGItem)
  {
    paramSVGItem.setParent(this$0);
    list.add(paramSVGItem);
  }
  
  public void endList() {}
}

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

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.apache.batik.parser.ParseException;
import org.w3c.dom.DOMException;
import org.w3c.dom.svg.SVGException;

public abstract class AbstractSVGList
{
  protected boolean valid;
  protected List itemList;
  
  protected abstract String getItemSeparator();
  
  protected abstract SVGItem createSVGItem(Object paramObject);
  
  protected abstract void doParse(String paramString, ListHandler paramListHandler)
    throws ParseException;
  
  protected abstract void checkItemType(Object paramObject)
    throws SVGException;
  
  protected abstract String getValueAsString();
  
  protected abstract void setAttributeValue(String paramString);
  
  protected abstract DOMException createDOMException(short paramShort, String paramString, Object[] paramArrayOfObject);
  
  public int getNumberOfItems()
  {
    revalidate();
    if (itemList != null) {
      return itemList.size();
    }
    return 0;
  }
  
  public void clear()
    throws DOMException
  {
    revalidate();
    if (itemList != null)
    {
      clear(itemList);
      resetAttribute();
    }
  }
  
  protected SVGItem initializeImpl(Object paramObject)
    throws DOMException, SVGException
  {
    checkItemType(paramObject);
    if (itemList == null) {
      itemList = new ArrayList(1);
    } else {
      clear(itemList);
    }
    SVGItem localSVGItem = removeIfNeeded(paramObject);
    itemList.add(localSVGItem);
    localSVGItem.setParent(this);
    resetAttribute();
    return localSVGItem;
  }
  
  protected SVGItem getItemImpl(int paramInt)
    throws DOMException
  {
    revalidate();
    if ((paramInt < 0) || (itemList == null) || (paramInt >= itemList.size())) {
      throw createDOMException((short)1, "AbstractSVGList.getItem.OutOfBoundsException", null);
    }
    return (SVGItem)itemList.get(paramInt);
  }
  
  protected SVGItem insertItemBeforeImpl(Object paramObject, int paramInt)
    throws DOMException, SVGException
  {
    checkItemType(paramObject);
    revalidate();
    if (paramInt < 0) {
      throw createDOMException((short)1, "AbstractSVGList.insertItemBefore.OutOfBoundsException", null);
    }
    if (paramInt > itemList.size()) {
      paramInt = itemList.size();
    }
    SVGItem localSVGItem = removeIfNeeded(paramObject);
    itemList.add(paramInt, localSVGItem);
    localSVGItem.setParent(this);
    resetAttribute();
    return localSVGItem;
  }
  
  protected SVGItem replaceItemImpl(Object paramObject, int paramInt)
    throws DOMException, SVGException
  {
    checkItemType(paramObject);
    revalidate();
    if ((paramInt < 0) || (paramInt >= itemList.size())) {
      throw createDOMException((short)1, "AbstractSVGList.replaceItem.OutOfBoundsException", null);
    }
    SVGItem localSVGItem = removeIfNeeded(paramObject);
    itemList.set(paramInt, localSVGItem);
    localSVGItem.setParent(this);
    resetAttribute();
    return localSVGItem;
  }
  
  protected SVGItem removeItemImpl(int paramInt)
    throws DOMException
  {
    revalidate();
    if ((paramInt < 0) || (paramInt >= itemList.size())) {
      throw createDOMException((short)1, "AbstractSVGList.removeItem.OutOfBoundsException", null);
    }
    SVGItem localSVGItem = (SVGItem)itemList.remove(paramInt);
    localSVGItem.setParent(null);
    resetAttribute();
    return localSVGItem;
  }
  
  protected SVGItem appendItemImpl(Object paramObject)
    throws DOMException, SVGException
  {
    checkItemType(paramObject);
    revalidate();
    SVGItem localSVGItem = removeIfNeeded(paramObject);
    itemList.add(localSVGItem);
    localSVGItem.setParent(this);
    if (itemList.size() <= 1) {
      resetAttribute();
    } else {
      resetAttribute(localSVGItem);
    }
    return localSVGItem;
  }
  
  protected SVGItem removeIfNeeded(Object paramObject)
  {
    SVGItem localSVGItem = null;
    if ((paramObject instanceof SVGItem))
    {
      localSVGItem = (SVGItem)paramObject;
      if (localSVGItem.getParent() != null) {
        localSVGItem.getParent().removeItem(localSVGItem);
      }
    }
    else
    {
      localSVGItem = createSVGItem(paramObject);
    }
    return localSVGItem;
  }
  
  protected void revalidate()
  {
    if (valid) {
      return;
    }
    try
    {
      ListBuilder localListBuilder = new ListBuilder();
      doParse(getValueAsString(), localListBuilder);
      if (localListBuilder.getList() != null) {
        clear(itemList);
      }
      itemList = localListBuilder.getList();
    }
    catch (ParseException localParseException)
    {
      itemList = null;
    }
    valid = true;
  }
  
  protected void setValueAsString(List paramList)
    throws DOMException
  {
    StringBuffer localStringBuffer = null;
    Iterator localIterator = paramList.iterator();
    while (localIterator.hasNext())
    {
      localObject = (SVGItem)localIterator.next();
      if (localStringBuffer == null)
      {
        localStringBuffer = new StringBuffer(((SVGItem)localObject).getValueAsString());
      }
      else
      {
        localStringBuffer.append(getItemSeparator());
        localStringBuffer.append(((SVGItem)localObject).getValueAsString());
      }
    }
    Object localObject = null;
    if (localStringBuffer == null) {
      localObject = null;
    } else {
      localObject = localStringBuffer.toString();
    }
    setAttributeValue((String)localObject);
    valid = true;
  }
  
  public void itemChanged()
  {
    resetAttribute();
  }
  
  protected void resetAttribute()
  {
    setValueAsString(itemList);
  }
  
  protected void resetAttribute(SVGItem paramSVGItem)
  {
    StringBuffer localStringBuffer = new StringBuffer(getValueAsString());
    localStringBuffer.append(getItemSeparator());
    localStringBuffer.append(paramSVGItem.getValueAsString());
    setAttributeValue(localStringBuffer.toString());
    valid = true;
  }
  
  public void invalidate()
  {
    valid = false;
  }
  
  protected void removeItem(SVGItem paramSVGItem)
  {
    if (itemList.contains(paramSVGItem))
    {
      itemList.remove(paramSVGItem);
      paramSVGItem.setParent(null);
      resetAttribute();
    }
  }
  
  protected void clear(List paramList)
  {
    if (paramList == null) {
      return;
    }
    Iterator localIterator = paramList.iterator();
    while (localIterator.hasNext())
    {
      SVGItem localSVGItem = (SVGItem)localIterator.next();
      localSVGItem.setParent(null);
    }
    paramList.clear();
  }
  
  protected class ListBuilder
    implements ListHandler
  {
    protected List list;
    
    public ListBuilder() {}
    
    public List getList()
    {
      return list;
    }
    
    public void startList()
    {
      if (list == null) {
        list = new ArrayList();
      }
    }
    
    public void item(SVGItem paramSVGItem)
    {
      paramSVGItem.setParent(AbstractSVGList.this);
      list.add(paramSVGItem);
    }
    
    public void endList() {}
  }
}

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

import java.awt.geom.AffineTransform;
import java.awt.geom.NoninvertibleTransformException;
import org.w3c.dom.DOMException;
import org.w3c.dom.svg.SVGException;
import org.w3c.dom.svg.SVGMatrix;

public abstract class AbstractSVGMatrix
  implements SVGMatrix
{
  protected static final AffineTransform FLIP_X_TRANSFORM = new AffineTransform(-1.0F, 0.0F, 0.0F, 1.0F, 0.0F, 0.0F);
  protected static final AffineTransform FLIP_Y_TRANSFORM = new AffineTransform(1.0F, 0.0F, 0.0F, -1.0F, 0.0F, 0.0F);
  
  protected abstract AffineTransform getAffineTransform();
  
  public float getA()
  {
    return (float)getAffineTransform().getScaleX();
  }
  
  public void setA(float paramFloat)
    throws DOMException
  {
    AffineTransform localAffineTransform = getAffineTransform();
    localAffineTransform.setTransform(paramFloat, localAffineTransform.getShearY(), localAffineTransform.getShearX(), localAffineTransform.getScaleY(), localAffineTransform.getTranslateX(), localAffineTransform.getTranslateY());
  }
  
  public float getB()
  {
    return (float)getAffineTransform().getShearY();
  }
  
  public void setB(float paramFloat)
    throws DOMException
  {
    AffineTransform localAffineTransform = getAffineTransform();
    localAffineTransform.setTransform(localAffineTransform.getScaleX(), paramFloat, localAffineTransform.getShearX(), localAffineTransform.getScaleY(), localAffineTransform.getTranslateX(), localAffineTransform.getTranslateY());
  }
  
  public float getC()
  {
    return (float)getAffineTransform().getShearX();
  }
  
  public void setC(float paramFloat)
    throws DOMException
  {
    AffineTransform localAffineTransform = getAffineTransform();
    localAffineTransform.setTransform(localAffineTransform.getScaleX(), localAffineTransform.getShearY(), paramFloat, localAffineTransform.getScaleY(), localAffineTransform.getTranslateX(), localAffineTransform.getTranslateY());
  }
  
  public float getD()
  {
    return (float)getAffineTransform().getScaleY();
  }
  
  public void setD(float paramFloat)
    throws DOMException
  {
    AffineTransform localAffineTransform = getAffineTransform();
    localAffineTransform.setTransform(localAffineTransform.getScaleX(), localAffineTransform.getShearY(), localAffineTransform.getShearX(), paramFloat, localAffineTransform.getTranslateX(), localAffineTransform.getTranslateY());
  }
  
  public float getE()
  {
    return (float)getAffineTransform().getTranslateX();
  }
  
  public void setE(float paramFloat)
    throws DOMException
  {
    AffineTransform localAffineTransform = getAffineTransform();
    localAffineTransform.setTransform(localAffineTransform.getScaleX(), localAffineTransform.getShearY(), localAffineTransform.getShearX(), localAffineTransform.getScaleY(), paramFloat, localAffineTransform.getTranslateY());
  }
  
  public float getF()
  {
    return (float)getAffineTransform().getTranslateY();
  }
  
  public void setF(float paramFloat)
    throws DOMException
  {
    AffineTransform localAffineTransform = getAffineTransform();
    localAffineTransform.setTransform(localAffineTransform.getScaleX(), localAffineTransform.getShearY(), localAffineTransform.getShearX(), localAffineTransform.getScaleY(), localAffineTransform.getTranslateX(), paramFloat);
  }
  
  public SVGMatrix multiply(SVGMatrix paramSVGMatrix)
  {
    AffineTransform localAffineTransform1 = new AffineTransform(paramSVGMatrix.getA(), paramSVGMatrix.getB(), paramSVGMatrix.getC(), paramSVGMatrix.getD(), paramSVGMatrix.getE(), paramSVGMatrix.getF());
    AffineTransform localAffineTransform2 = (AffineTransform)getAffineTransform().clone();
    localAffineTransform2.concatenate(localAffineTransform1);
    return new SVGOMMatrix(localAffineTransform2);
  }
  
  public SVGMatrix inverse()
    throws SVGException
  {
    try
    {
      return new SVGOMMatrix(getAffineTransform().createInverse());
    }
    catch (NoninvertibleTransformException localNoninvertibleTransformException)
    {
      throw new SVGOMException((short)2, localNoninvertibleTransformException.getMessage());
    }
  }
  
  public SVGMatrix translate(float paramFloat1, float paramFloat2)
  {
    AffineTransform localAffineTransform = (AffineTransform)getAffineTransform().clone();
    localAffineTransform.translate(paramFloat1, paramFloat2);
    return new SVGOMMatrix(localAffineTransform);
  }
  
  public SVGMatrix scale(float paramFloat)
  {
    AffineTransform localAffineTransform = (AffineTransform)getAffineTransform().clone();
    localAffineTransform.scale(paramFloat, paramFloat);
    return new SVGOMMatrix(localAffineTransform);
  }
  
  public SVGMatrix scaleNonUniform(float paramFloat1, float paramFloat2)
  {
    AffineTransform localAffineTransform = (AffineTransform)getAffineTransform().clone();
    localAffineTransform.scale(paramFloat1, paramFloat2);
    return new SVGOMMatrix(localAffineTransform);
  }
  
  public SVGMatrix rotate(float paramFloat)
  {
    AffineTransform localAffineTransform = (AffineTransform)getAffineTransform().clone();
    localAffineTransform.rotate(paramFloat);
    return new SVGOMMatrix(localAffineTransform);
  }
  
  public SVGMatrix rotateFromVector(float paramFloat1, float paramFloat2)
    throws SVGException
  {
    if ((paramFloat1 == 0.0F) || (paramFloat2 == 0.0F)) {
      throw new SVGOMException
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

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