An intergraph hyperedge is a hyperedge with
its end nodes in different hypergraphs.
The end nodes must all belong to the same nested hierarchy, that
is, they must all be nested inside the same root hypergraph. The
concept of intergraph hyperedges is similar to the concept of
intergraph links. See Intergraph
links in the Advanced Features of JViews Framework user
documentation.
In the following figure, the intergraph
hyperedge is shown in red and normal hyperedges are shown in
black.
![diahyp_inter_norm_hyperedge.gif](../usrhyperdiag/_media/diahyp_inter_norm_hyperedge_default.gif)
Intergraph hyperedges and normal
hyperedges
To test whether a hyperedge in an intergraph hyperedge, call this
method of
IlvHyperEdge
:
boolean isInterGraphHyperEdge()
This test method works only when the end
nodes are already present in the hypergraphs. Since you can add
source and target nodes after a hyperedge has been added to a
hypergraph, a normal hyperedge can become an intergraph hyperedge.
See the following code example.
How a normal hyperedge can become an
intergraph hyperedge
IlvHyperGrapher rootGrapher = new IlvHyperGrapher(); ... rootGrapher.addNode(node1, false); IlvGraphicVector fromNodes = new IlvGraphicVector(); IlvGraphicVector toNodes = new IlvGraphicVector(); fromNodes.addElement(node1); toNodes.addElement(node1); IlvHyperEdge edge = new IlvHyperEdge(fromNodes, toNodes); rootGrapher.addHyperEdge(edge, false); // the edge is a normal hyperedge ... IlvHyperGrapher subGrapher = new IlvHyperGrapher(); rootGrapher.addNode(subGrapher, true); subGrapher.addNode(node2, false); grapher.applyToObject(edge, new IlvApplyObject() { public void apply(IlvGraphic obj, Object arg) { ((IlvHyperEdge)obj).addFrom(node2); } }, arg, redraw); // now, the edge is an intergraph hyperedge, since it ends at // node1 and node2 but both are in different graphers ...
Note
If the hyperedge is contained in a hypergraph, you can add source
or target nodes to the hyperedge only if these nodes belong to
the same hypergraph as the hyperedge, or to subgraphs nested
inside the hypergraph to which the hyperedge belongs. In all
other cases you should remove the hyperedge from its hypergraph
and then add the new sources and new targets. Finally, add the
hyperedge back to a hypergraph as described in Adding intergraph hyperedges.