Using hyperedge connectors

The purpose of the class IlvHyperEdgeConnector is comparable to that of the class IlvLinkConnector for links. The class IlvHyperEdgeConnector is the base class of all hyperedge connectors. It computes the connection points of IlvHyperEdge objects at nodes. Subclasses of the abstract base class IlvHyperEdgeConnector can be implemented to obtain different contact points.
A hyperedge connector can be attached to a hyperedge or to a node.
If it is attached to a hyperedge, it will control all connection points of this hyperedge at the nodes.
If it is attached to a node, it will control all connection points of hyperedges at the node, except for those hyperedges that do not have their own connector.
To specify that a hyperedge connector is to be used:
  1. Allocate the connector.
  2. Attach it to the node (see the following code example).
    Attaching a hyperedge connector to a node
    IlvHyperEdgeConnector connector = new IlvHyperEdgeCenterConnector();
    connector.attach(node, redraw);
    
-- or --
  • Attach it to the hyperedge (see the following code example).
    Attaching a hyperedge connector to a hyperedge
    IlvHyperEdgeConnector connector = new IlvHyperEdgeCenterConnector();
    connector.attach(hyperedge, redraw);
    
The same hyperedge connector cannot be shared between several nodes or hyperedges. You need to allocate a new connector for each node or each hyperedge.
If you want to stop using a hyperedge connector, detach it:
connector.detach(redraw);
When you attach or detach a hyperedge connector, the end points of the hyperedges can change. Therefore, you must specify by using the redraw flag whether the hyperedges are to be redrawn.
To access a hyperedge connector that is responsible for a specific hyperedge end:
  • Use the call shown in the following code example:
    Accessing the hyperedge connector for a specific hyperedge end
    IlvHyperEdgeEnd hyperEdgeEnd = ...
    IlvHyperEdgeConnector connector = IlvHyperEdgeConnector.Get(hyperEdgeEnd);
    
The call to this method returns the connector of the hyperedge that has the specified end or, if the edge has no connector, it will return the connector of the node connected to that end. If it returns null, no connector at all is used.
To access the connector attached to a specific node or hyperedge:
  • Use the call shown in the following code example:
    Accessing the hyperedge connector for a specific node or hyperedge
    IlvHyperEdgeConnector connector =
        IlvHyperEdgeConnector.GetAttached(nodeOrHyperEdge);
    
The call to this method returns the hyperedge connector of the node or of the hyperedge, even if this hyperedge connector is not currently responsible for the calculation of the end points of any hyperedge.