Disable reconnection of link to a new anchor node outside an existing SDM node

Article ID: 2289
Last updated: 29 May, 2018
Article ID: 2289
Last updated: 29 May, 2018
Revision: 3
Views: 648
Posted: 07 Dec, 2012
by Dean J.
Updated: 29 May, 2018
by Gargani A.

Question

How to disable reconnecting a link to a new anchor node outside an existing SDM node?

Answer

The sample Sample.zip displays four nodes with three links between them. By default when dragging a link to a point outside a node, an anchor node is created and the link is then reconnected to the anchor node. In the program, the link endpoints can be dragged between nodes, but not to a point outside a node.

To accomplish this, a subclass of IlvSDMUtilitiesFactory is set on the SDM view. The subclass overrides the function createLinkReconnector() to return a subclass of IlvSDMLinkReconnector. This latter subclass overrides the method reconnect() so that if the node being connected to is an anchor node, the anchor node is removed and reconnect() of the superclass is not called.

Note: In order to run this sample with JViews 8.7 and later, you must call the ilog.views.util.IlvProductUtil.DeploymentLicenseRequired method with the appropriate argument (uncomment this call in the main method in Main.java). See the General information > Deployment licenses > Declaring the use of IBM ILOG JViews services section in the documentation for more information.

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


Others in this category