public void handleEvent(Event evt) { if (!(evt instanceof AbstractEvent)) return; final AbstractEvent ae = (AbstractEvent)evt; List l = ae.getDefaultActions(); if (l != null) { Iterator i = l.iterator(); while (i.hasNext()) { Object o = i.next(); if (o instanceof AnchorDefaultActionable) return; // only one anchor in default list... } } SVGAElement elt = (SVGAElement)evt.getCurrentTarget(); ae.addDefaultAction(new AnchorDefaultActionable (elt, userAgent, holder)); }
public void handleEvent(Event evt) { if (!(evt instanceof AbstractEvent)) return; final AbstractEvent ae = (AbstractEvent)evt; List l = ae.getDefaultActions(); if (l != null) { Iterator i = l.iterator(); while (i.hasNext()) { Object o = i.next(); if (o instanceof MouseOverDefaultActionable) return; // only one anchor in default list... } } Element target = (Element)ae.getTarget(); SVGAElement elt = (SVGAElement)ae.getCurrentTarget(); ae.addDefaultAction(new MouseOverDefaultActionable (target, elt, userAgent, holder)); }
public void handleEvent(Event evt) { if (!(evt instanceof AbstractEvent)) return; final AbstractEvent ae = (AbstractEvent)evt; List l = ae.getDefaultActions(); if (l != null) { Iterator i = l.iterator(); while (i.hasNext()) { Object o = i.next(); if (o instanceof MouseOutDefaultActionable) return; // only one anchor in default list... } } SVGAElement elt = (SVGAElement)evt.getCurrentTarget(); ae.addDefaultAction(new MouseOutDefaultActionable (elt, userAgent, holder)); }
public AnchorDefaultActionable(SVGAElement e, UserAgent ua, CursorHolder ch) { elt = (SVGOMAElement) e; userAgent = ua; holder = ch; }
public MouseOverDefaultActionable(Element t, SVGAElement e, UserAgent ua, CursorHolder ch) { target = t; elt = e; userAgent = ua; holder = ch; }
public MouseOutDefaultActionable(SVGAElement e, UserAgent ua, CursorHolder ch) { elt = e; userAgent = ua; holder = ch; }
/** * Opens a link. * @param elt The activated link element. */ public void openLink(final SVGAElement elt) { if (EventQueue.isDispatchThread()) { userAgent.openLink(elt); } else { EventQueue.invokeLater(new Runnable() { public void run() { userAgent.openLink(elt); } }); } }
/** * Fires a LinkActivatedEvent. */ protected void fireLinkActivatedEvent(SVGAElement elt, String href) { Object[] ll = linkActivationListeners.toArray(); if (ll.length > 0) { LinkActivationEvent ev; ev = new LinkActivationEvent(JSVGComponent.this, elt, href); for (int i = 0; i < ll.length; i++) { LinkActivationListener l = (LinkActivationListener)ll[i]; l.linkActivated(ev); } } }
/** * Unsupported operation. */ public final void openLink(SVGAElement elt) { }
/** * 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 * @return node the new graphics node */ 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; }
/** * Opens a link. * @param elt The activated link element. */ void openLink(SVGAElement elt);
/** * Unsupported operation. */ public void openLink(SVGAElement elt) { }
/** * Creates a new LinkActivationEvent. * @param source the object that originated the event, ie. the * GVTTreeBuilder. * @param link the link element. * @param uri the URI of the document loaded. */ public LinkActivationEvent(Object source, SVGAElement link, String uri) { super(source); referencedURI = uri; }