Class LinkTool

java.lang.Object
  |
  +--LinkTool

public class LinkTool
extends java.lang.Object

The LinkTool is responsible for managing links between XML texts. N.B. that IDs in XML are case-sensitive.

Version:
$03/03/25 08:08:55 mdh$
Author:
Malcolm D. Hyman

Constructor Summary
LinkTool(ArborPanel panel, org.w3c.dom.Document linkDoc)
           
 
Method Summary
 void clearNodes()
          Resets (clears) the list of displayed nodes.
 void getLinkages(org.w3c.dom.Element e)
          Obtains linkages for a node.
 org.w3c.dom.Node getLinkedNode(XLink xlink, org.w3c.dom.Document doc, boolean cacheOther)
          Returns the node (we assume that the node set contains only a single node) referred to by xlink; if the DOM is cached, it can be passed in as doc.
 LinkedText getLinkedText()
          Returns the cached LinkedText object.
 org.w3c.dom.Node[] getLinkingNodes()
          Returns an array consisting of the nodes that link to the displayed nodesl
 org.w3c.dom.Node[] getNodes()
          Returns an array of the nodes that are to be displayed.
static java.lang.String getXPath(java.lang.String s)
          Creates an XPath-compliant expression from the supplied XPTR expression.
 void setLanguage(java.lang.String lang)
          Sets the language presumed for linked nodes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinkTool

public LinkTool(ArborPanel panel,
                org.w3c.dom.Document linkDoc)
Method Detail

getLinkages

public void getLinkages(org.w3c.dom.Element e)
Obtains linkages for a node.
Parameters:
e - DOM element

getLinkedNode

public org.w3c.dom.Node getLinkedNode(XLink xlink,
                                      org.w3c.dom.Document doc,
                                      boolean cacheOther)
Returns the node (we assume that the node set contains only a single node) referred to by xlink; if the DOM is cached, it can be passed in as doc.
Parameters:
xlink - xlink to XML fragment (single node)
doc - cached DOM document (or null)
cacheOther - cache all other links from linkDoc to doc

getLinkedText

public LinkedText getLinkedText()
Returns the cached LinkedText object.
Returns:
LinkedText

getXPath

public static java.lang.String getXPath(java.lang.String s)
Creates an XPath-compliant expression from the supplied XPTR expression. This is somewhat quick-and-dirty.
Parameters:
s - source (XPTR) expression
Returns:
XPath expression

clearNodes

public void clearNodes()
Resets (clears) the list of displayed nodes.

getNodes

public org.w3c.dom.Node[] getNodes()
Returns an array of the nodes that are to be displayed.
Returns:
nodes to be displayed

getLinkingNodes

public org.w3c.dom.Node[] getLinkingNodes()
Returns an array consisting of the nodes that link to the displayed nodesl
Returns:
linking nodes

setLanguage

public void setLanguage(java.lang.String lang)
Sets the language presumed for linked nodes.
Parameters:
lang - language code as per ISO 639