Hyperlinks

One of the important features of hypergraph is navigating : a click on a node will open another URL, similar to the usual hyperlinks in html. Two question arise in this context, namely how can the URL be set and in which window or target will the browser open this URL.

Setting the URL

The URL a node links to is defined in the GraphXML file together with the node itself. This is done with the xml elements dataref and ref as follows :

<node name="1" >

<label>hypergraph</label>

<dataref><ref xlink:href="http://hypergraph.sourceforge.net"/></dataref>

</node>

This code defines a node that links to the hypergraph homepage.

Setting the target

The target of the hyperlink, i.e. the window in which the link is opened, can be defined using the xml attribute xlink:show together with the property hypergraph.applications.hexplorer.GraphPanel.target. The target property defines the default : if no xlink:show attribute is provided, the content of this property defines the target. Here is a list of the values and the corresponding behaviour :

"_self" : Show in the window and frame that contain the applet.

"_parent" : Show in the applet's parent frame. If the applet's frame has no parent frame, acts the same as "_self".

"_top" : Show in the top-level frame of the applet's window. If the applet's frame is the top-level frame, acts the same as "_self".

"_blank" : Show in a new, unnamed top-level window.

"name" : Show in the frame or window named name. If a target named name does not already exist, a new top-level window with the specified name is created, and the document is shown there.

If the node (resp. the hyperlink of the node) has a xlink:show attribute, the value of this attribute is used as well. Per definition in the xlink specification, there are only few valid values of this attribute. Hypergraph supports the values new, replace and none. The values new and replace correspond to the targets _blank and _self while none is the default and opens the target that has been defined in the property file. The above example with a xlink:show attribute to open the URL in a new window is :

<node name="1" >

<label>hypergraph</label>

<dataref><ref xlink:show="new" xlink:href="http://hypergraph.sourceforge.net"/></dataref>

</node>

If no target has been defined, the target _self is used.