/* * $Id$ * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. * For details on use and redistribution please refer to the * LICENSE file included with these sources. */ package org.apache.fop.svg; import java.awt.Cursor; import java.awt.geom.AffineTransform; import org.apache.batik.bridge.*; import org.apache.batik.css.HiddenChildElementSupport; import org.apache.batik.gvt.CompositeGraphicsNode; import org.apache.batik.gvt.GraphicsNode; import org.apache.fop.pdf.*; import org.w3c.dom.Element; import org.w3c.dom.events.Event; import org.w3c.dom.events.EventListener; import org.w3c.dom.events.EventTarget; import org.w3c.dom.svg.SVGAElement; /** * Bridge class for the <a> element. * * @author Keiron Liddle */ public class PDFAElementBridge extends AbstractGraphicsNodeBridge { AffineTransform transform; /** * Constructs a new bridge for the <a> element. */ public PDFAElementBridge() {} public void setCurrentTransform(AffineTransform tf) { transform = tf; } /** * Returns 'a'. */ public String getLocalName() { return SVG_A_TAG; } /** * Creates a CompositeGraphicsNode. */ protected GraphicsNode instantiateGraphicsNode() { return new PDFANode(); } /** * Builds using the specified BridgeContext and element, the * specified graphics node. * * @param ctx the bridge context to use * @param e the element that describes the graphics node to build * @param node the graphics node to build */ public GraphicsNode createGraphicsNode(BridgeContext ctx, Element e) { PDFANode aNode = (PDFANode)super.createGraphicsNode(ctx, e); aNode.setDestination(((SVGAElement)e).getHref().getBaseVal()); aNode.setTransform(transform); return aNode; } /** * Returns true as the <a> element is a container. */ public boolean isComposite() { return true; } }