Search in sources :

Example 26 with NetworkMapLink

use of org.netxms.client.maps.NetworkMapLink in project netxms by netxms.

the class LinkEditor method update.

/**
 * Update network map link
 */
public void update() {
    mapPage.removeLink(link);
    long[] bp = link.getBendPoints();
    link = new NetworkMapLink(name, type, link.getElement1(), link.getElement2(), connectorName1, connectorName2, dciList.toArray(new SingleDciConfig[dciList.size()]), link.getFlags(), link.isLocked());
    link.setColor(color);
    link.setStatusObject(statusObject);
    link.setRouting(routingAlgorithm);
    link.setBendPoints(bp);
    link.getConfig().setUseActiveThresholds(useActiveThresholds);
    mapPage.addLink(link);
    modified = true;
}
Also used : NetworkMapLink(org.netxms.client.maps.NetworkMapLink)

Example 27 with NetworkMapLink

use of org.netxms.client.maps.NetworkMapLink in project netxms by netxms.

the class ServiceComponentsElement method addServiceComponents.

/**
 * Add parent services for given object
 *
 * @param object
 */
private void addServiceComponents(AbstractObject object, long parentElementId) {
    Iterator<Long> it = object.getChildren();
    while (it.hasNext()) {
        long objectId = it.next();
        AbstractObject child = session.findObjectById(objectId);
        if ((child != null) && ((child instanceof Container) || (child instanceof Cluster) || (child instanceof Node) || (child instanceof Condition))) {
            long elementId = mapPage.createElementId();
            mapPage.addElement(new NetworkMapObject(elementId, objectId));
            mapPage.addLink(new NetworkMapLink(NetworkMapLink.NORMAL, parentElementId, elementId));
            addServiceComponents(child, elementId);
        }
    }
}
Also used : Condition(org.netxms.client.objects.Condition) Container(org.netxms.client.objects.Container) AbstractObject(org.netxms.client.objects.AbstractObject) Node(org.netxms.client.objects.Node) Cluster(org.netxms.client.objects.Cluster) NetworkMapObject(org.netxms.client.maps.elements.NetworkMapObject) NetworkMapLink(org.netxms.client.maps.NetworkMapLink)

Aggregations

NetworkMapLink (org.netxms.client.maps.NetworkMapLink)27 NetworkMapObject (org.netxms.client.maps.elements.NetworkMapObject)16 AbstractObject (org.netxms.client.objects.AbstractObject)12 NetworkMapPage (org.netxms.client.maps.NetworkMapPage)6 NetworkMapElement (org.netxms.client.maps.elements.NetworkMapElement)6 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)3 NXCPMessage (org.netxms.base.NXCPMessage)3 AccessPoint (org.netxms.client.objects.AccessPoint)3 Cluster (org.netxms.client.objects.Cluster)3 Container (org.netxms.client.objects.Container)3 Node (org.netxms.client.objects.Node)3 CoreException (org.eclipse.core.runtime.CoreException)2 Point (org.eclipse.draw2d.geometry.Point)2 PartInitException (org.eclipse.ui.PartInitException)2 ObjectStatus (org.netxms.client.constants.ObjectStatus)2 DCIImageConfiguration (org.netxms.client.maps.configs.DCIImageConfiguration)2 SingleDciConfig (org.netxms.client.maps.configs.SingleDciConfig)2 NetworkMapDCIContainer (org.netxms.client.maps.elements.NetworkMapDCIContainer)2 NetworkMapDCIImage (org.netxms.client.maps.elements.NetworkMapDCIImage)2 ClusterResource (org.netxms.client.objects.ClusterResource)2