Business Objects and Data Sources > Links > Link Connection Ports

Link connection ports enable you to customize the way links connect to nodes on a map. A connection port is the logical position where a link is attached to a node. Normally, this position is automatically determined by the link layout algorithm. Link connection ports provide a way to modify this behavior by forcing the links into a specific position that will be taken into account by the graph layout algorithm.

By default, connection ports are not visible on a node. However, you can display them by attaching to the view an interactor of type IltMakeLinkInteractor operating in pin mode.

Connection ports can be either directed or undirected. Links attached to a directed connection port originate from a specific direction given by the port, and are drawn either vertically or horizontally, depending on the direction. If the main segment of the link is neither horizontal nor vertical, a short segment is added to the extremity of the link to compensate for this. This is the normal behavior implemented by the direct link style of the link layout algorithm. On the other hand, links coming from an undirected connection port can go in any direction, defined randomly by the layout algorithm. In this case, no additional segment is appended to their extremities.

These two types of connection port are illustrated in the following figures:

images/directedLinks32.gif

Figure 5.19 A Node with Four Directed Connection Ports

images/undirectedLinks33.gif

Figure 5.20 A Node with an Undirected Link Connection Port (at the Center of the Cloud)

A link connection port is defined by the following:

When a link connection port is applied to a node, the target point is computed from the values of fx, fy, and the link connection rectangle.

The class IltLinkPort is an enumeration type that defines the following values: Top, Bottom, Left, Right, and Center. The first four values indicate that the link should connect to the center point of the corresponding node side. For example, Left specifies that the link will be attached to the center of the left side of the node. These values apply to directed link ports. The last value, Center, applies to undirected link ports. These values can be customized through CSS as illustrated in Customizing Link Port Configuration in the Styling documentation. You can create your own instances of IltLinkPort by providing specific values to the fx, fy, and direction parameters.

Only the IltShortLinkLayout and IltLinkLayout (when set in short link mode) layout algorithms implement link connection ports. When used in an JViews TGO network component, these layouts use the following optional information through the IltDefaultNodeSideFilter that is installed automatically:

How to Create Link Connection Ports
  1. Create an IltShortLinkLayout algorithm and attach it to the network component .
IltShortLinkLayout layout = new IltShortLinkLayout();
...
network.setLinkLayout(layout);
This layout algorithm allows you to handle link connection ports. You could also use IltLinkLayout.
  1. Create new link connection ports using IltLinkPort.
...
IltLinkPort port1=
  new IltLinkPort("Right, above middle",1.0f,0.2f,1,0,-1);

For information on how to configure the link connection ports, refer to Customizing Link Port Configuration in the Styling documentation.