String href = XLinkSupport.getXLinkHref(elt);
if (show.equals("new")) {
fireLinkActivatedEvent(elt, href);
if (svgUserAgent != null) {
String oldURI = svgDocument.getURL();
ParsedURL newURI = null;
// if the anchor element is in an external resource
if (elt.getOwnerDocument() != svgDocument) {
SVGDocument doc = (SVGDocument)elt.getOwnerDocument();
href = new ParsedURL(doc.getURL(), href).toString();
}
newURI = new ParsedURL(oldURI, href);
href = newURI.toString();
svgUserAgent.openLink(href, true);
} else {
JSVGComponent.this.loadSVGDocument(href);
}
return;
}
// Avoid reloading if possible.
if (svgDocument != null) {
// if the anchor element is in an external resource
if (elt.getOwnerDocument() != svgDocument) {
SVGDocument doc = (SVGDocument)elt.getOwnerDocument();
href = new ParsedURL(doc.getURL(), href).toString();
}
ParsedURL oldURI = new ParsedURL(svgDocument.getURL());
ParsedURL newURI = new ParsedURL(oldURI, href);
String s = newURI.getRef();
if (newURI.sameFile(oldURI)) {
if ((fragmentIdentifier == null && s != null) ||
(s == null && fragmentIdentifier != null) ||
(s != null && !s.equals(fragmentIdentifier))) {
fragmentIdentifier = s;
computeRenderingTransform();
}
fireLinkActivatedEvent(elt, newURI.toString());
return;
}
}
fireLinkActivatedEvent(elt, href);
if (svgUserAgent != null) {