Interactors that allow you to create or manipulate hyperedges
typically call the following methods of IlvHyperEdgeConnector to connect a hyperedge
end to or disconnect it from a node:
To implement a new hyperedge connector:
-
Call the methods:This method is called when a hyperedge end needs to be connected to a node at position p. This position might be unsuitable for the connector. Therefore, the method
getClosestConnectionPoint
can return the closest suitable connection point. It can be useful to store this connection point internally in the connector, so that it can be retrieved quickly.-- or --This method is called when a hyperedge end is already connected. It returns the connection point for the hyperedge end. This can be the connection point that was previously stored. If no connection point was previously stored, the method must calculate an appropriate connection point for the end.
When the
disconnect
method is called, the storage of the connection point can
finally be cleared to avoid memory leaks.
Note
The class IlvHyperEdgeConnectorWithCache implements
hyperedge connectors with a cache storage for connection points
that handles the storing and cleaning up of the cache
automatically.
To retrieve the end points of a
hyperedge:
-
Call the method:
See Hyperedge ends.
If the flag
checkConnector
is true, this method asks the connector for the position by
calling
getConnectionPoint
at
IlvHyperEdgeConnector
.
If the flag
checkConnector
is false, the method does not ask the connector for the
position.
Usually, when a hyperedge is drawn or manipulated, the value
true is always passed for the parameter
checkConnector
. Therefore, the hyperedge ends at the point returned by
getConnectionPoint
from the connector.