Integrating JViews Framework link connectors in JViews TGO

Article ID: 2372
Last updated: 29 May, 2018
Article ID: 2372
Last updated: 29 May, 2018
Revision: 3
Views: 754
Posted: 14 Sep, 2012
by Dean J.
Updated: 29 May, 2018
by Gargani A.

Question

How to use JViews Framework link connectors in JViews TGO ?

Cause

To define the following link routing in a JViews TGO equipment, you can use JViews Framework link connectors. This solution applies if you need to define several links with the same origin, that is, a card in a horizontal shelf, and with different destinations, that is, the cards in a vertical shelf, and if you want that the links overlap at the origin but not at the destination. See below a screen capture of this layout:

Answer

The link routing and layout requirement described in this document can be solved by controlling the way links connect to nodes. JViews TGO has a "link-port" feature but it only applies to certain link layouts (IltShortLinkLayout and IltLinkLayout). JViews Framework has a more flexible "link connector" feature but it is not available in JViews TGO.

The solution is to implement a customized JViews TGO link layout that makes use of JViews Framework link connectors to address a wider range of complex link routing requirements.

Here is how to proceed:

1. Subclass IltLink:

a. Extend the method postCreateGraphic(). This method is invoked when the underlying JViews TGO graphic object is created. The extension adds the JViews Framework link connector to the JViews TGO link.

b. Extend the method removeGraphic(). This method is invoked when the underlying JViews TGO graphic object is removed. The extension removes the JViews Framework link connector from the JViews TGO link before it is removed.

c. Use the legacy styling API to retrieve styling data from the style engine. This is used to fetch styling previously set in CSS. The method getLegend() is currently deprecated in favor of styling through CSS files but it will not disappear.

2. Implement subclasses of IlvGrapherPin.

Create the 'Left', 'Right', 'Top' and 'Bottom' pins.

3. In the IltLink subclass, implement the logic to create the JViews Framework link connectors.

The attached archive contains a subclass ('MyLink') that handles the link connector points. The CSS file ('equipmentMyLink.css') uses the JViews TGO 'linkPorts' CSS property to set the connection points for the two link endpoints:

#link0 {
linkPorts[0]: "Bottom";
linkPorts[1]: "Left";
}

In this implementation, the 'From' endpoint connects to the bottom of the node while the 'To' endpoint connects to the left.

One limitation in this implementation is that it does not take into account the differences between JViews TGO (Ilt link layouts) and JViews Framework (Ilv link layouts), which means that it might crash if a JViews TGO link layout is used. However, it should be possible to easily modify the implementation to support this scenario.

This article was:   Helpful | Not helpful
Report an issue
Article ID: 2372
Last updated: 29 May, 2018
Revision: 3
Views: 754
Posted: 14 Sep, 2012 by Dean J.
Updated: 29 May, 2018 by Gargani A.
Also listed in


Others in this category