org.apache.batik.bridge_1.6.0.v201011041432

16:40:49.481 INFO  jd.cli.Main - Decompiling org.apache.batik.bridge_1.6.0.v201011041432.jar
package org.apache.batik.bridge;

import java.awt.Shape;
import java.awt.geom.AffineTransform;
import java.awt.geom.Rectangle2D;
import java.lang.ref.SoftReference;
import org.apache.batik.css.engine.CSSEngine;
import org.apache.batik.css.engine.CSSEngineEvent;
import org.apache.batik.css.engine.value.Value;
import org.apache.batik.dom.svg.SVGContext;
import org.apache.batik.dom.svg.SVGOMElement;
import org.apache.batik.ext.awt.geom.SegmentList;
import org.apache.batik.gvt.CanvasGraphicsNode;
import org.apache.batik.gvt.CompositeGraphicsNode;
import org.apache.batik.gvt.GraphicsNode;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.events.Event;
import org.w3c.dom.events.MutationEvent;
import org.w3c.dom.svg.SVGFitToViewBox;

public abstract class AbstractGraphicsNodeBridge
  extends AbstractSVGBridge
  implements SVGContext, BridgeUpdateHandler, GraphicsNodeBridge, ErrorConstants
{
  protected Element e;
  protected GraphicsNode node;
  protected BridgeContext ctx;
  protected SoftReference bboxShape = null;
  protected Rectangle2D bbox = null;
  
  public GraphicsNode createGraphicsNode(BridgeContext paramBridgeContext, Element paramElement)
  {
    if (!SVGUtilities.matchUserAgent(paramElement, paramBridgeContext.getUserAgent())) {
      return null;
    }
    GraphicsNode localGraphicsNode = instantiateGraphicsNode();
    String str = paramElement.getAttributeNS(null, "transform");
    if (str.length() != 0) {
      localGraphicsNode.setTransform(SVGUtilities.convertTransform(paramElement, "transform", str));
    }
    localGraphicsNode.setVisible(CSSUtilities.convertVisibility(paramElement));
    return localGraphicsNode;
  }
  
  protected abstract GraphicsNode instantiateGraphicsNode();
  
  public void buildGraphicsNode(BridgeContext paramBridgeContext, Element paramElement, GraphicsNode paramGraphicsNode)
  {
    paramGraphicsNode.setComposite(CSSUtilities.convertOpacity(paramElement));
    paramGraphicsNode.setFilter(CSSUtilities.convertFilter(paramElement, paramGraphicsNode, paramBridgeContext));
    paramGraphicsNode.setMask(CSSUtilities.convertMask(paramElement, paramGraphicsNode, paramBridgeContext));
    paramGraphicsNode.setClip(CSSUtilities.convertClipPath(paramElement, paramGraphicsNode, paramBridgeContext));
    paramGraphicsNode.setPointerEventType(CSSUtilities.convertPointerEvents(paramElement));
    initializeDynamicSupport(paramBridgeContext, paramElement, paramGraphicsNode);
  }
  
  public boolean getDisplay(Element paramElement)
  {
    return CSSUtilities.convertDisplay(paramElement);
  }
  
  protected void initializeDynamicSupport(BridgeContext paramBridgeContext, Element paramElement, GraphicsNode paramGraphicsNode)
  {
    if (!paramBridgeContext.isInteractive()) {
      return;
    }
    paramBridgeContext.bind(paramElement, paramGraphicsNode);
    if (paramBridgeContext.isDynamic())
    {
      e = paramElement;
      node = paramGraphicsNode;
      ctx = paramBridgeContext;
      ((SVGOMElement)paramElement).setSVGContext(this);
    }
  }
  
  public void handleDOMAttrModifiedEvent(MutationEvent paramMutationEvent)
  {
    String str1 = paramMutationEvent.getAttrName();
    if (str1.equals("transform"))
    {
      String str2 = paramMutationEvent.getNewValue();
      AffineTransform localAffineTransform = GraphicsNode.IDENTITY;
      if (str2.length() != 0) {
        localAffineTransform = SVGUtilities.convertTransform(e, "transform", str2);
      }
      node.setTransform(localAffineTransform);
      handleGeometryChanged();
    }
  }
  
  protected void handleGeometryChanged()
  {
    node.setFilter(CSSUtilities.convertFilter(e, node, ctx));
    node.setMask(CSSUtilities.convertMask(e, node, ctx));
    node.setClip(CSSUtilities.convertClipPath(e, node, ctx));
  }
  
  public void handleDOMNodeInsertedEvent(MutationEvent paramMutationEvent)
  {
    if ((paramMutationEvent.getTarget() instanceof Element))
    {
      Element localElement = (Element)paramMutationEvent.getTarget();
      Bridge localBridge = ctx.getBridge(localElement);
      if ((localBridge instanceof GenericBridge)) {
        ((GenericBridge)localBridge).handleElement(ctx, localElement);
      }
    }
  }
  
  public void handleDOMNodeRemovedEvent(MutationEvent paramMutationEvent)
  {
    CompositeGraphicsNode localCompositeGraphicsNode = node.getParent();
    localCompositeGraphicsNode.remove(node);
    disposeTree(e);
  }
  
  public void handleDOMCharacterDataModified(MutationEvent paramMutationEvent) {}
  
  public void dispose()
  {
    SVGOMElement localSVGOMElement = (SVGOMElement)e;
    localSVGOMElement.setSVGContext(null);
    ctx.unbind(e);
  }
  
  static void disposeTree(Node paramNode)
  {
    if ((paramNode instanceof SVGOMElement))
    {
      localObject = (SVGOMElement)paramNode;
      BridgeUpdateHandler localBridgeUpdateHandler = (BridgeUpdateHandler)((SVGOMElement)localObject).getSVGContext();
      if (localBridgeUpdateHandler != null) {
        localBridgeUpdateHandler.dispose();
      }
    }
    for (Object localObject = paramNode.getFirstChild(); localObject != null; localObject = ((Node)localObject).getNextSibling()) {
      disposeTree((Node)localObject);
    }
  }
  
  public void handleCSSEngineEvent(CSSEngineEvent paramCSSEngineEvent)
  {
    try
    {
      int[] arrayOfInt = paramCSSEngineEvent.getProperties();
      for (int i = 0; i < arrayOfInt.length; i++) {
        handleCSSPropertyChanged(arrayOfInt[i]);
      }
    }
    catch (Exception localException)
    {
      ctx.getUserAgent().displayError(localException);
    }
  }
  
  protected void handleCSSPropertyChanged(int paramInt)
  {
    switch (paramInt)
    {
    case 57: 
      node.setVisible(CSSUtilities.convertVisibility(e));
      break;
    case 38: 
      node.setComposite(CSSUtilities.convertOpacity(e));
      break;
    case 18: 
      node.setFilter(CSSUtilities.convertFilter(e, node, ctx));
      break;
    case 37: 
      node.setMask(CSSUtilities.convertMask(e, node, ctx));
      break;
    case 3: 
      node.setClip(CSSUtilities.convertClipPath(e, node, ctx));
      break;
    case 40: 
      node.setPointerEventType(CSSUtilities.convertPointerEvents(e));
      break;
    case 12: 
      if (!getDisplay(e))
      {
        CompositeGraphicsNode localCompositeGraphicsNode = node.getParent();
        int i = localCompositeGraphicsNode.indexOf(node);
        localCompositeGraphicsNode.remove(node);
        disposeTree(e);
      }
      break;
    }
  }
  
  public float getPixelUnitToMillimeter()
  {
    return ctx.getUserAgent().getPixelUnitToMillimeter();
  }
  
  public float getPixelToMM()
  {
    return getPixelUnitToMillimeter();
  }
  
  public Rectangle2D getBBox()
  {
    Shape localShape = node.getOutline();
    if ((bboxShape != null) && (localShape == bboxShape.get())) {
      return bbox;
    }
    bboxShape = new SoftReference(localShape);
    bbox = null;
    if (localShape == null) {
      return bbox;
    }
    SegmentList localSegmentList = new SegmentList(localShape);
    bbox = localSegmentList.getBounds2D();
    return bbox;
  }
  
  public AffineTransform getCTM()
  {
    Object localObject1 = node;
    AffineTransform localAffineTransform1 = new AffineTransform();
    Object localObject2 = e;
    while (localObject2 != null)
    {
      if ((localObject2 instanceof SVGFitToViewBox))
      {
        if ((localObject1 instanceof CanvasGraphicsNode)) {
          localAffineTransform2 = ((CanvasGraphicsNode)localObject1).getViewingTransform();
        } else {
          localAffineTransform2 = ((GraphicsNode)localObject1).getTransform();
        }
        if (localAffineTransform2 == null) {
          break;
        }
        localAffineTransform1.preConcatenate(localAffineTransform2);
        break;
      }
      AffineTransform localAffineTransform2 = ((GraphicsNode)localObject1).getTransform();
      if (localAffineTransform2 != null) {
        localAffineTransform1.preConcatenate(localAffineTransform2);
      }
      localObject2 = CSSEngine.getParentCSSStylableElement((Element)localObject2);
      localObject1 = ((GraphicsNode)localObject1).getParent();
    }
    return localAffineTransform1;
  }
  
  public AffineTransform getScreenTransform()
  {
    return ctx.getUserAgent().getTransform();
  }
  
  public void setScreenTransform(AffineTransform paramAffineTransform)
  {
    ctx.getUserAgent().setTransform(paramAffineTransform);
  }
  
  public AffineTransform getGlobalTransform()
  {
    return node.getGlobalTransform();
  }
  
  public float getViewportWidth()
  {
    return ctx.getBlockWidth(e);
  }
  
  public float getViewportHeight()
  {
    return ctx.getBlockHeight(e);
  }
  
  public float getFontSize()
  {
    return CSSUtilities.getComputedStyle(e, 22).getFloatValue();
  }
  
  public abstract boolean isComposite();
}

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

import org.apache.batik.util.SVGConstants;

public abstract class AbstractSVGBridge
  implements Bridge, SVGConstants
{
  public String getNamespaceURI()
  {
    return "http://www.w3.org/2000/svg";
  }
  
  public Bridge getInstance()
  {
    return this;
  }
  
  public abstract String getLocalName();
}

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

import java.awt.Color;
import java.awt.Paint;
import java.awt.geom.Rectangle2D;
import java.awt.geom.Rectangle2D.Float;
import java.util.Map;
import org.apache.batik.ext.awt.image.PadMode;
import org.apache.batik.ext.awt.image.renderable.Filter;
import org.apache.batik.ext.awt.image.renderable.FilterAlphaRable;
import org.apache.batik.ext.awt.image.renderable.FilterColorInterpolation;
import org.apache.batik.ext.awt.image.renderable.FloodRable8Bit;
import org.apache.batik.ext.awt.image.renderable.PadRable8Bit;
import org.apache.batik.gvt.GraphicsNode;
import org.apache.batik.gvt.filter.BackgroundRable8Bit;
import org.w3c.dom.Element;

public abstract class AbstractSVGFilterPrimitiveElementBridge
  extends AbstractSVGBridge
  implements FilterPrimitiveBridge, ErrorConstants
{
  static final Rectangle2D INFINITE_FILTER_REGION = new Rectangle2D.Float(-1.7014117E38F, -1.7014117E38F, Float.MAX_VALUE, Float.MAX_VALUE);
  
  protected static Filter getIn(Element paramElement1, Element paramElement2, GraphicsNode paramGraphicsNode, Filter paramFilter, Map paramMap, BridgeContext paramBridgeContext)
  {
    String str = paramElement1.getAttributeNS(null, "in");
    if (str.length() == 0) {
      return paramFilter;
    }
    return getFilterSource(paramElement1, str, paramElement2, paramGraphicsNode, paramMap, paramBridgeContext);
  }
  
  protected static Filter getIn2(Element paramElement1, Element paramElement2, GraphicsNode paramGraphicsNode, Filter paramFilter, Map paramMap, BridgeContext paramBridgeContext)
  {
    String str = paramElement1.getAttributeNS(null, "in2");
    if (str.length() == 0) {
      throw new BridgeException(paramElement1, "attribute.missing", new Object[] { "in2" });
    }
    return getFilterSource(paramElement1, str, paramElement2, paramGraphicsNode, paramMap, paramBridgeContext);
  }
  
  protected static void updateFilterMap(Element paramElement, Filter paramFilter, Map paramMap)
  {
    String str = paramElement.getAttributeNS(null, "result");
    if ((str.length() != 0) && (str.trim().length() != 0)) {
      paramMap.put(str, paramFilter);
    }
  }
  
  protected static void handleColorInterpolationFilters(Filter paramFilter, Element paramElement)
  {
    if ((paramFilter instanceof FilterColorInterpolation))
    {
      boolean bool = CSSUtilities.convertColorInterpolationFilters(paramElement);
      ((FilterColorInterpolation)paramFilter).setColorSpaceLinear(bool);
    }
  }
  
  static Filter getFilterSource(Element paramElement1, String paramString, Element paramElement2, GraphicsNode paramGraphicsNode, Map paramMap, BridgeContext paramBridgeContext)
  {
    Filter localFilter = (Filter)paramMap.get("SourceGraphic");
    Rectangle2D localRectangle2D = localFilter.getBounds2D();
    int i = paramString.length();
    Object localObject1 = null;
    Object localObject2;
    switch (i)
    {
    case 13: 
      if ("SourceGraphic".equals(paramString)) {
        localObject1 = localFilter;
      }
      break;
    case 11: 
      if (paramString.charAt(1) == "SourceAlpha".charAt(1))
      {
        if ("SourceAlpha".equals(paramString))
        {
          localObject1 = localFilter;
          localObject1 = new FilterAlphaRable((Filter)localObject1);
        }
      }
      else if ("StrokePaint".equals(paramString))
      {
        localObject2 = PaintServer.convertStrokePaint(paramElement2, paramGraphicsNode, paramBridgeContext);
        localObject1 = new FloodRable8Bit(localRectangle2D, (Paint)localObject2);
      }
      break;
    case 15: 
      if (paramString.charAt(10) == "BackgroundImage".charAt(10))
      {
        if ("BackgroundImage".equals(paramString))
        {
          localObject1 = new BackgroundRable8Bit(paramGraphicsNode);
          localObject1 = new PadRable8Bit((Filter)localObject1, localRectangle2D, PadMode.ZERO_PAD);
        }
      }
      else if ("BackgroundAlpha".equals(paramString))
      {
        localObject1 = new BackgroundRable8Bit(paramGraphicsNode);
        localObject1 = new FilterAlphaRable((Filter)localObject1);
        localObject1 = new PadRable8Bit((Filter)localObject1, localRectangle2D, PadMode.ZERO_PAD);
      }
      break;
    case 9: 
      if ("FillPaint".equals(paramString))
      {
        localObject2 = PaintServer.convertFillPaint(paramElement2, paramGraphicsNode, paramBridgeContext);
        if (localObject2 == null) {
          localObject2 = new Color(0, 0, 0, 0);
        }
        localObject1 = new FloodRable8Bit(localRectangle2D, (Paint)localObject2);
      }
      break;
    }
    if (localObject1 == null) {
      localObject1 = (Filter)paramMap.get(paramString);
    }
    return (Filter)localObject1;
  }
  
  protected static int convertInteger(Element paramElement, String paramString, int paramInt)
  {
    String str = paramElement.getAttributeNS(null, paramString);
    if (str.length() == 0) {
      return paramInt;
    }
    try
    {
      return SVGUtilities.convertSVGInteger(str);
    }
    catch (NumberFormatException localNumberFormatException)
    {
      throw new BridgeException(paramElement, "attribute.malformed", new Object[] { paramString, str });
    }
  }
  
  protected static float convertNumber(Element paramElement, String paramString, float paramFloat)
  {
    String str = paramElement.getAttributeNS(null, paramString);
    if (str.length() == 0) {
      return paramFloat;
    }
    try
    {
      return SVGUtilities.convertSVGNumber(str);
    }
    catch (NumberFormatException localNumberFormatException)
    {
      throw new BridgeException(paramElement, "attribute.malformed", new Object[] { paramString, str, localNumberFormatException });
    }
  }
  
  public abstract Filter createFilter(BridgeContext paramBridgeContext, Element paramElement1, Element paramElement2, GraphicsNode paramGraphicsNode, Filter paramFilter, Rectangle2D paramRectangle2D, Map paramMap);
}

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

import java.awt.Color;
import org.w3c.dom.Element;

public class AbstractSVGGradientElementBridge$SVGStopElementBridge
  extends AbstractSVGBridge
  implements Bridge
{
  public String getLocalName()
  {
    return "stop";
  }
  
  public AbstractSVGGradientElementBridge.Stop createStop(BridgeContext paramBridgeContext, Element paramElement1, Element paramElement2, float paramFloat)
  {
    String str = paramElement2.getAttributeNS(null, "offset");
    if (str.length() == 0) {
      throw new BridgeException(paramElement2, "attribute.missing", new Object[] { "offset" });
    }
    float f;
    try
    {
      f = SVGUtilities.convertRatio(str);
    }
    catch (NumberFormatException localNumberFormatException)
    {
      throw new BridgeException(paramElement2, "attribute.malformed", new Object[] { "offset", str, localNumberFormatException });
    }
    Color localColor = CSSUtilities.convertStopColor(paramElement2, paramFloat, paramBridgeContext);
    return new AbstractSVGGradientElementBridge.Stop(localColor, f);
  }
}

/* Location:
 * Qualified Name:     org.apache.batik.bridge.AbstractSVGGradientElementBridge.SVGStopElementBridge
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.bridge;

import java.awt.Color;

public class AbstractSVGGradientElementBridge$Stop
{
  public Color color;
  public float offset;
  
  public AbstractSVGGradientElementBridge$Stop(Color paramColor, float paramFloat)
  {
    color = paramColor;
    offset = paramFloat;
  }
}

/* Location:
 * Qualified Name:     org.apache.batik.bridge.AbstractSVGGradientElementBridge.Stop
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.bridge;

import java.awt.Color;
import java.awt.Paint;
import java.awt.geom.AffineTransform;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import org.apache.batik.dom.svg.SVGOMDocument;
import org.apache.batik.dom.util.XLinkSupport;
import org.apache.batik.ext.awt.MultipleGradientPaint;
import org.apache.batik.ext.awt.MultipleGradientPaint.ColorSpaceEnum;
import org.apache.batik.ext.awt.MultipleGradientPaint.CycleMethodEnum;
import org.apache.batik.gvt.GraphicsNode;
import org.apache.batik.util.ParsedURL;
import org.w3c.dom.Element;
import org.w3c.dom.Node;

public abstract class AbstractSVGGradientElementBridge
  extends AbstractSVGBridge
  implements PaintBridge, ErrorConstants
{
  public Paint createPaint(BridgeContext paramBridgeContext, Element paramElement1, Element paramElement2, GraphicsNode paramGraphicsNode, float paramFloat)
  {
    List localList = extractStop(paramElement1, paramFloat, paramBridgeContext);
    if (localList == null) {
      return null;
    }
    int i = localList.size();
    if (i == 1) {
      return get0color;
    }
    float[] arrayOfFloat = new float[i];
    Color[] arrayOfColor = new Color[i];
    Iterator localIterator = localList.iterator();
    for (int j = 0; localIterator.hasNext(); j++)
    {
      localObject = (Stop)localIterator.next();
      arrayOfFloat[j] = offset;
      arrayOfColor[j] = color;
    }
    Object localObject = MultipleGradientPaint.NO_CYCLE;
    String str = SVGUtilities.getChainableAttributeNS(paramElement1, null, "spreadMethod", paramBridgeContext);
    if (str.length() != 0) {
      localObject = convertSpreadMethod(paramElement1, str);
    }
    MultipleGradientPaint.ColorSpaceEnum localColorSpaceEnum = CSSUtilities.convertColorInterpolation(paramElement1);
    str = SVGUtilities.getChainableAttributeNS(paramElement1, null, "gradientTransform", paramBridgeContext);
    AffineTransform localAffineTransform;
    if (str.length() != 0) {
      localAffineTransform = SVGUtilities.convertTransform(paramElement1, "gradientTransform", str);
    } else {
      localAffineTransform = new AffineTransform();
    }
    Paint localPaint = buildGradient(paramElement1, paramElement2, paramGraphicsNode, (MultipleGradientPaint.CycleMethodEnum)localObject, localColorSpaceEnum, localAffineTransform, arrayOfColor, arrayOfFloat, paramBridgeContext);
    return localPaint;
  }
  
  protected abstract Paint buildGradient(Element paramElement1, Element paramElement2, GraphicsNode paramGraphicsNode, MultipleGradientPaint.CycleMethodEnum paramCycleMethodEnum, MultipleGradientPaint.ColorSpaceEnum paramColorSpaceEnum, AffineTransform paramAffineTransform, Color[] paramArrayOfColor, float[] paramArrayOfFloat, BridgeContext paramBridgeContext);
  
  protected static MultipleGradientPaint.CycleMethodEnum convertSpreadMethod(Element paramElement, String paramString)
  {
    if ("repeat".equals(paramString)) {
      return MultipleGradientPaint.REPEAT;
    }
    if ("reflect".equals(paramString)) {
      return MultipleGradientPaint.REFLECT;
    }
    if ("pad".equals(paramString)) {
      return MultipleGradientPaint.NO_CYCLE;
    }
    throw new BridgeException(paramElement, "attribute.malformed", new Object[] { "spreadMethod", paramString });
  }
  
  protected static List extractStop(Element paramElement, float paramFloat, BridgeContext paramBridgeContext)
  {
    LinkedList localLinkedList = new LinkedList();
    for (;;)
    {
      List localList = extractLocalStop(paramElement, paramFloat, paramBridgeContext);
      if (localList != null) {
        return localList;
      }
      String str = XLinkSupport.getXLinkHref(paramElement);
      if (str.length() == 0) {
        return null;
      }
      SVGOMDocument localSVGOMDocument = (SVGOMDocument)paramElement.getOwnerDocument();
      ParsedURL localParsedURL = new ParsedURL(localSVGOMDocument.getURL(), str);
      if (!localParsedURL.complete()) {
        throw new BridgeException(paramElement, "uri.malformed", new Object[] { str });
      }
      if (contains(localLinkedList, localParsedURL)) {
        throw new BridgeException(paramElement, "xlink.href.circularDependencies", new Object[] { str });
      }
      localLinkedList.add(localParsedURL);
      paramElement = paramBridgeContext.getReferencedElement(paramElement, str);
    }
  }
  
  protected static List extractLocalStop(Element paramElement, float paramFloat, BridgeContext paramBridgeContext)
  {
    LinkedList localLinkedList = null;
    Object localObject = null;
    for (Node localNode = paramElement.getFirstChild(); localNode != null; localNode = localNode.getNextSibling()) {
      if (localNode.getNodeType() == 1)
      {
        Element localElement = (Element)localNode;
        Bridge localBridge = paramBridgeContext.getBridge(localElement);
        if ((localBridge != null) && ((localBridge instanceof SVGStopElementBridge)))
        {
          Stop localStop = ((SVGStopElementBridge)localBridge).createStop(paramBridgeContext, paramElement, localElement, paramFloat);
          if (localLinkedList == null) {
            localLinkedList = new LinkedList();
          }
          if ((localObject != null) && (offset < offset)) {
            offset = offset;
          }
          localLinkedList.add(localStop);
          localObject = localStop;
        }
      }
    }
    return localLinkedList;
  }
  
  private static boolean contains(List paramList, ParsedURL paramParsedURL)
  {
    Iterator localIterator = paramList.iterator();
    while (localIterator.hasNext()) {
      if (paramParsedURL.equals(localIterator.next())) {
        return true;
      }
    }
    return false;
  }
  
  public static class SVGStopElementBridge
    extends AbstractSVGBridge
    implements Bridge
  {
    public String getLocalName()
    {
      return "stop";
    }
    
    public AbstractSVGGradientElementBridge.Stop createStop(BridgeContext paramBridgeContext, Element paramElement1, Element paramElement2, float paramFloat)
    {
      String str = paramElement2.getAttributeNS(null, "offset");
      if (str.length() == 0) {
        throw new BridgeException(paramElement2, "attribute.missing", new Object[] { "offset" });
      }
      float f;
      try
      {
        f = SVGUtilities.convertRatio(str);
      }
      catch (NumberFormatException localNumberFormatException)
      {
        throw new BridgeException(paramElement2, "attribute.malformed", new Object[] { "offset", str, localNumberFormatException });
      }
      Color localColor = CSSUtilities.convertStopColor(paramElement2, paramFloat, paramBridgeContext);
      return new AbstractSVGGradientElementBridge.Stop(localColor, f);
    }
  }
  
  public static class Stop
  {
    public Color color;
    public float offset;
    
    public Stop(Color paramColor, float paramFloat)
    {
      color = paramColor;
      offset = paramFloat;
    }
  }
}

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

import java.awt.Color;
import org.apache.batik.ext.awt.image.Light;
import org.w3c.dom.Element;

public abstract class AbstractSVGLightingElementBridge$AbstractSVGLightElementBridge
  extends AbstractSVGBridge
{
  public abstract Light createLight(BridgeContext paramBridgeContext, Element paramElement1, Element paramElement2, Color paramColor);
}

/* Location:
 * Qualified Name:     org.apache.batik.bridge.AbstractSVGLightingElementBridge.AbstractSVGLightElementBridge
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.bridge;

import java.awt.Color;
import org.apache.batik.ext.awt.image.DistantLight;
import org.apache.batik.ext.awt.image.Light;
import org.w3c.dom.Element;

public class AbstractSVGLightingElementBridge$SVGFeDistantLightElementBridge
  extends AbstractSVGLightingElementBridge.AbstractSVGLightElementBridge
{
  public String getLocalName()
  {
    return "feDistantLight";
  }
  
  public Light createLight(BridgeContext paramBridgeContext, Element paramElement1, Element paramElement2, Color paramColor)
  {
    double d1 = AbstractSVGFilterPrimitiveElementBridge.convertNumber(paramElement2, "azimuth", 0.0F);
    double d2 = AbstractSVGFilterPrimitiveElementBridge.convertNumber(paramElement2, "elevation", 0.0F);
    return new DistantLight(d1, d2, paramColor);
  }
}

/* Location:
 * Qualified Name:     org.apache.batik.bridge.AbstractSVGLightingElementBridge.SVGFeDistantLightElementBridge
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.bridge;

import java.awt.Color;
import org.apache.batik.ext.awt.image.Light;
import org.apache.batik.ext.awt.image.PointLight;
import org.w3c.dom.Element;

public class AbstractSVGLightingElementBridge$SVGFePointLightElementBridge
  extends AbstractSVGLightingElementBridge.AbstractSVGLightElementBridge
{
  public String getLocalName()
  {
    return "fePointLight";
  }
  
  public Light createLight(BridgeContext paramBridgeContext, Element paramElement1, Element paramElement2, Color paramColor)
  {
    double d1 = AbstractSVGFilterPrimitiveElementBridge.convertNumber(paramElement2, "x", 0.0F);
    double d2 = AbstractSVGFilterPrimitiveElementBridge.convertNumber(paramElement2, "y", 0.0F);
    double d3 = AbstractSVGFilterPrimitiveElementBridge.convertNumber(paramElement2, "z", 0.0F);
    return new PointLight(d1, d2, d3, paramColor);
  }
}

/* Location:
 * Qualified Name:     org.apache.batik.bridge.AbstractSVGLightingElementBridge.SVGFePointLightElementBridge
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.bridge;

import java.awt.Color;
import org.apache.batik.ext.awt.image.Light;
import org.apache.batik.ext.awt.image.SpotLight;
import org.w3c.dom.Element;

public class AbstractSVGLightingElementBridge$SVGFeSpotLightElementBridge
  extends AbstractSVGLightingElementBridge.AbstractSVGLightElementBridge
{
  public String getLocalName()
  {
    return "feSpotLight";
  }
  
  public Light createLight(BridgeContext paramBridgeContext, Element paramElement1, Element paramElement2, Color paramColor)
  {
    double d1 = AbstractSVGFilterPrimitiveElementBridge.convertNumber(paramElement2, "x", 0.0F);
    double d2 = AbstractSVGFilterPrimitiveElementBridge.convertNumber(paramElement2, "y", 0.0F);
    double d3 = AbstractSVGFilterPrimitiveElementBridge.convertNumber(paramElement2, "z", 0.0F);
    double d4 = AbstractSVGFilterPrimitiveElementBridge.convertNumber(paramElement2, "pointsAtX", 0.0F);
    double d5 = AbstractSVGFilterPrimitiveElementBridge.convertNumber(paramElement2, "pointsAtY", 0.0F);
    double d6 = AbstractSVGFilterPrimitiveElementBridge.convertNumber(paramElement2, "pointsAtZ", 0.0F);
    double d7 = AbstractSVGFilterPrimitiveElementBridge.convertNumber(paramElement2, "specularExponent", 1.0F);
    double d8 = AbstractSVGFilterPrimitiveElementBridge.convertNumber(paramElement2, "limitingConeAngle", 90.0F);
    return new SpotLight(d1, d2, d3, d4, d5, d6, d7, d8, paramColor);
  }
}

/* Location:
 * Qualified Name:     org.apache.batik.bridge.AbstractSVGLightingElementBridge.SVGFeSpotLightElementBridge
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.bridge;

import java.awt.Color;
import java.util.StringTokenizer;
import org.apache.batik.ext.awt.image.DistantLight;
import org.apache.batik.ext.awt.image.Light;
import org.apache.batik.ext.awt.image.PointLight;
import org.apache.batik.ext.awt.image.SpotLight;
import org.w3c.dom.Element;
import org.w3c.dom.Node;

public abstract class AbstractSVGLightingElementBridge
  extends AbstractSVGFilterPrimitiveElementBridge
{
  protected static Light extractLight(Element paramElement, BridgeContext paramBridgeContext)
  {
    Color localColor = CSSUtilities.convertLightingColor(paramElement, paramBridgeContext);
    for (Node localNode = paramElement.getFirstChild(); localNode != null; localNode = localNode.getNextSibling()) {
      if (localNode.getNodeType() == 1)
      {
        Element localElement = (Element)localNode;
        Bridge localBridge = paramBridgeContext.getBridge(localElement);
        if ((localBridge != null) && ((localBridge instanceof AbstractSVGLightElementBridge))) {
          return ((AbstractSVGLightElementBridge)localBridge).createLight(paramBridgeContext, paramElement, localElement, localColor);
        }
      }
    }
    return null;
  }
  
  protected static double[] convertKernelUnitLength(Element paramElement)
  {
    String str = paramElement.getAttributeNS(null, "kernelUnitLength");
    if (str.length() == 0) {
      return null;
    }
    double[] arrayOfDouble = new double[2];
    StringTokenizer localStringTokenizer = new StringTokenizer(str, " ,");
    try
    {
      arrayOfDouble[0] = SVGUtilities.convertSVGNumber(localStringTokenizer.nextToken());
      if (localStringTokenizer.hasMoreTokens()) {
        arrayOfDouble[1] = SVGUtilities.convertSVGNumber(localStringTokenizer.nextToken());
      } else {
        arrayOfDouble[1] = arrayOfDouble[0];
      }
    }
    catch (NumberFormatException localNumberFormatException)
    {
      throw new BridgeException(paramElement, "attribute.malformed", new Object[] { "kernelUnitLength", str });
    }
    if ((localStringTokenizer.hasMoreTokens()) || (arrayOfDouble[0] <= 0.0D) || (arrayOfDouble[1] <= 0.0D)) {
      throw new BridgeException(paramElement, "attribute.malformed", new Object[] { "kernelUnitLength", str });
    }
    return arrayOfDouble;
  }
  
  protected static abstract class AbstractSVGLightElementBridge
    extends AbstractSVGBridge
  {
    public abstract Light createLight(BridgeContext paramBridgeContext, Element paramElement1, Element paramElement2, Color paramColor);
  }
  
  public static class SVGFeDistantLightElementBridge
    extends AbstractSVGLightingElementBridge.AbstractSVGLightElementBridge
  {
    public String getLocalName()
    {
      return "feDistantLight";
    }
    
    public Light createLight(BridgeContext paramBridgeContext, Element paramElement1, Element paramElement2, Color paramColor)
    {
      double d1 = AbstractSVGFilterPrimitiveElementBridge.convertNumber(paramElement2, "azimuth", 0.0F);
      double d2 = AbstractSVGFilterPrimitiveElementBridge.convertNumber(paramElement2, "elevation", 0.0F);
      return new DistantLight(d1, d2, paramColor);
    }
  }
  
  public static class SVGFePointLightElementBridge
    extends AbstractSVGLightingElementBridge.AbstractSVGLightElementBridge
  {
    public String getLocalName()
    {
      return "fePointLight";
    }
    
    public Light createLight(BridgeContext paramBridgeContext, Element paramElement1, Element paramElement2, Color paramColor)
    {
      double d1 = AbstractSVGFilterPrimitiveElementBridge.convertNumber(paramElement2, "x", 0.0F);
      double d2 = AbstractSVGFilterPrimitiveElementBridge.convertNumber(paramElement2, "y", 0.0F);
      double d3 = AbstractSVGFilterPrimitiveElementBridge.convertNumber(paramElement2, "z", 0.0F);
      return new PointLight(d1, d2, d3, paramColor);
    }
  }
  
  public static class SVGFeSpotLightElementBridge
    extends AbstractSVGLightingElementBridge.AbstractSVGLightElementBridge
  {
    public String getLocalName()
    {
      return "feSpotLight";
    }
    
    public Light createLight(BridgeContext paramBridgeContext, Element paramElement1, Element paramElement2, Color paramColor)
    {
      double d1 = AbstractSVGFilterPrimitiveElementBridge.convertNumber(paramElement2, "x", 0.0F);
      double d2 = AbstractSVGFilterPrimitiveElementBridge.convertNumber(paramElement2, "y", 0.0F);
      double d3 = AbstractSVGFilterPrimitiveElementBridge.convertNumber(paramElement2, "z", 0.0F);
      double d4 = AbstractSVGFilterPrimitiveElementBridge.convertNumber(paramElement2, "pointsAtX", 0.0F);
      double d5 = AbstractSVGFilterPrimitiveElementBridge.convertNumber(paramElement2, "pointsAtY", 0.0F);
      double d6 = AbstractSVGFilterPrimitiveElementBridge.convertNumber(paramElement2, "pointsAtZ", 0.0F);
      double d7 = AbstractSVGFilterPrimitiveElementBridge.convertNumber(paramElement2, "specularExponent", 1.0F);
      double d8 = AbstractSVGFilterPrimitiveElementBridge.convertNumber(paramElement2, "limitingConeAngle", 90.0F);
      return new SpotLight(d1, d2, d3, d4, d5, d6, d7, d8, paramColor);
    }
  }
}

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

import java.io.IOException;
import java.io.StringReader;
import org.apache.batik.script.Interpreter;
import org.apache.batik.script.InterpreterException;
import org.w3c.dom.events.Event;
import org.w3c.dom.events.EventListener;

class BaseScriptingEnvironment$1
  implements EventListener
{
  private final Interpreter val$interp;
  private final String val$s;
  private final String val$desc;
  private final BaseScriptingEnvironment this$0;
  
  BaseScriptingEnvironment$1(BaseScriptingEnvironment paramBaseScriptingEnvironment, Interpreter paramInterpreter, String paramString1, String paramString2)
  {
    this$0 = paramBaseScriptingEnvironment;
    val$interp = paramInterpreter;
    val$s = paramString1;
    val$desc = paramString2;
  }
  
  public void handleEvent(Event paramEvent)
  {
    try
    {
      val$interp.bindObject("event", paramEvent);
      val$interp.bindObject("evt", paramEvent);
      val$interp.evaluate(new StringReader(val$s), val$desc);
    }
    catch (IOException localIOException) {}catch (InterpreterException localInterpreterException)
    {
      this$0.handleInterpreterException(localInterpreterException);
    }
  }
}

/* Location:
 * Qualified Name:     org.apache.batik.bridge.BaseScriptingEnvironment.1
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.bridge;

import org.apache.batik.script.Interpreter;
import org.apache.batik.script.Window;
import org.apache.batik.script.Window.URLResponseHandler;
import org.w3c.dom.Document;
import org.w3c.dom.Node;

public class BaseScriptingEnvironment$Window
  implements Window
{
  protected Interpreter interpreter;
  protected String language;
  private final BaseScriptingEnvironment this$0;
  
  public BaseScriptingEnvironment$Window(BaseScriptingEnvironment paramBaseScriptingEnvironment, Interpreter paramInterpreter, String paramString)
  {
    this$0 = paramBaseScriptingEnvironment;
    interpreter = paramInterpreter;
    language = paramString;
  }
  
  public Object setInterval(String paramString, long paramLong)
  {
    return null;
  }
  
  public Object setInterval(Runnable paramRunnable, long paramLong)
  {
    return null;
  }
  
  public void clearInterval(Object paramObject) {}
  
  public Object setTimeout(String paramString, long paramLong)
  {
    return null;
  }
  
  public Object setTimeout(Runnable paramRunnable, long paramLong)
  {
    return null;
  }
  
  public void clearTimeout(Object paramObject) {}
  
  public Node parseXML(String paramString, Document paramDocument)
  {
    return null;
  }
  
  public void getURL(String paramString, Window.URLResponseHandler paramURLResponseHandler)
  {
    getURL(paramString, paramURLResponseHandler, "UTF8");
  }
  
  public void getURL(String paramString1, Window.URLResponseHandler paramURLResponseHandler, String paramString2) {}
  
  public void postURL(String paramString1, String paramString2, Window.URLResponseHandler paramURLResponseHandler)
  {
    postURL(paramString1, paramString2, paramURLResponseHandler, "text/plain", null);
  }
  
  public void postURL(String paramString1, String paramString2, Window.URLResponseHandler paramURLResponseHandler, String paramString3)
  {
    postURL(paramString1, paramString2, paramURLResponseHandler, paramString3, null);
  }
  
  public void postURL(String paramString1, String paramString2, Window.URLResponseHandler paramURLResponseHandler, String paramString3, String paramString4) {}
  
  public void alert(String paramString) {}
  
  public boolean confirm(String paramString)
  {
    return false;
  }
  
  public String prompt(String paramString)
  {
    return null;
  }
  
  public String prompt(String paramString1, String paramString2)
  {
    return null;
  }
  
  public BridgeContext getBridgeContext()
  {
    return this$0.bridgeContext;
  }
  
  public Interpreter getInterpreter()
  {
    return interpreter;
  }
}

/* Location:
 * Qualified Name:     org.apache.batik.bridge.BaseScriptingEnvironment.Window
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.bridge;

import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.io.Reader;
import java.io.StringReader;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.jar.Attributes;
import java.util.jar.Manifest;
import org.apache.batik.dom.svg.XMLBaseSupport;
import org.apache.batik.dom.util.XLinkSupport;
import org.apache.batik.script.Interpreter;
import org.apache.batik.script.InterpreterException;
import org.apache.batik.script.ScriptHandler;
import org.apache.batik.script.Window;
import org.apache.batik.script.Window.URLResponseHandler;
import org.apache.batik.util.ParsedURL;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.w3c.dom.events.DocumentEvent;
import org.w3c.dom.events.Event;
import org.w3c.dom.events.EventListener;
import org.w3c.dom.events.EventTarget;
import org.w3c.dom.svg.EventListenerInitializer;
import org.w3c.dom.svg.SVGDocument;
import org.w3c.dom.svg.SVGSVGElement;

public class BaseScriptingEnvironment
{
  public static final String INLINE_SCRIPT_DESCRIPTION = "BaseScriptingEnvironment.constant.inline.script.description";
  public static final String EVENT_SCRIPT_DESCRIPTION = "BaseScriptingEnvironment.constant.event.script.description";
  protected static final String EVENT_NAME = "event";
  protected static final String ALTERNATE_EVENT_NAME = "evt";
  protected BridgeContext bridgeContext;
  protected UserAgent userAgent;
  protected Document document;
  protected ParsedURL docPURL;
  protected Set languages = new HashSet();
  protected Interpreter interpreter;
  
  public static boolean isDynamicDo
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37

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