Search in sources :

Example 6 with NetworkMapPage

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

the class ClusterTab method objectChanged.

/* (non-Javadoc)
	 * @see org.netxms.ui.eclipse.objectview.objecttabs.ObjectTab#objectChanged(org.netxms.client.objects.AbstractObject)
	 */
@Override
public void objectChanged(AbstractObject object) {
    if (object instanceof Cluster) {
        cluster = (Cluster) object;
        resourceList.setInput(cluster.getResources().toArray());
        clusterMap.setContent(buildClusterMap());
    } else {
        cluster = null;
        resourceList.setInput(new ClusterResource[0]);
        clusterMap.setContent(new NetworkMapPage(pluginId + id));
    }
    getClientArea().layout(true);
}
Also used : NetworkMapPage(org.netxms.client.maps.NetworkMapPage) Cluster(org.netxms.client.objects.Cluster)

Example 7 with NetworkMapPage

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

the class IPNeighbors method buildMapPage.

/**
 * Build map page
 */
protected void buildMapPage() {
    // $NON-NLS-1$
    mapPage = new NetworkMapPage(ID + "." + this.toString());
    long rootElementId = mapPage.createElementId();
    mapPage.addElement(new NetworkMapObject(rootElementId, rootObject.getObjectId()));
    addSubnets(rootObject, rootElementId);
    for (long objectId : rootObject.getChildIdList()) {
        AbstractObject object = session.findObjectById(objectId);
        if ((object != null) && (object instanceof VPNConnector)) {
            AbstractObject peer = session.findObjectById(((VPNConnector) object).getPeerGatewayId());
            if (peer != null) {
                long elementId = mapPage.createElementId();
                mapPage.addElement(new NetworkMapObject(elementId, peer.getObjectId()));
                NetworkMapLink link = new NetworkMapLink(NetworkMapLink.VPN, rootElementId, elementId);
                link.setName(object.getObjectName());
                mapPage.addLink(link);
                addSubnets(peer, elementId);
            }
        }
    }
    addDciToRequestList();
}
Also used : NetworkMapPage(org.netxms.client.maps.NetworkMapPage) AbstractObject(org.netxms.client.objects.AbstractObject) VPNConnector(org.netxms.client.objects.VPNConnector) NetworkMapObject(org.netxms.client.maps.elements.NetworkMapObject) NetworkMapLink(org.netxms.client.maps.NetworkMapLink)

Example 8 with NetworkMapPage

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

the class IPRouteMap method getRoute.

/**
 * Get route between objects and build map page
 *
 * @throws Exception
 */
private void getRoute(Display display) throws Exception {
    final NetworkPath path = session.getNetworkPath(rootObject.getObjectId(), targetObject.getObjectId());
    // $NON-NLS-1$ //$NON-NLS-2$
    final NetworkMapPage page = new NetworkMapPage(ID + "@" + rootObject.getObjectName() + "@" + targetObject.getObjectName());
    long prevElementId = 0;
    HopInfo prevHop = null;
    for (final HopInfo h : path.getPath()) {
        final long elementId = page.createElementId();
        page.addElement(new NetworkMapObject(elementId, h.getNodeId()));
        if (prevElementId != 0) {
            NetworkMapLink link = new NetworkMapLink(prevHop.isVpn() ? NetworkMapLink.VPN : NetworkMapLink.NORMAL, prevElementId, elementId);
            if (!prevHop.getName().isEmpty())
                link.setName(prevHop.getName());
            page.addLink(link);
        }
        prevElementId = elementId;
        prevHop = h;
    }
    replaceMapPage(page, display);
}
Also used : HopInfo(org.netxms.client.topology.HopInfo) NetworkMapPage(org.netxms.client.maps.NetworkMapPage) NetworkMapObject(org.netxms.client.maps.elements.NetworkMapObject) NetworkMapLink(org.netxms.client.maps.NetworkMapLink) NetworkPath(org.netxms.client.topology.NetworkPath)

Example 9 with NetworkMapPage

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

the class ServiceDependency method buildMapPage.

/* (non-Javadoc)
	 * @see org.netxms.ui.eclipse.networkmaps.views.NetworkMap#buildMapPage()
	 */
@Override
protected void buildMapPage() {
    mapPage = new NetworkMapPage(ID + rootObject.getObjectId());
    long elementId = mapPage.createElementId();
    mapPage.addElement(new NetworkMapObject(elementId, rootObject.getObjectId()));
    addParentServices(rootObject, elementId);
    addDciToRequestList();
}
Also used : NetworkMapPage(org.netxms.client.maps.NetworkMapPage) NetworkMapObject(org.netxms.client.maps.elements.NetworkMapObject)

Example 10 with NetworkMapPage

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

the class MapContentProvider method inputChanged.

/* (non-Javadoc)
	 * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
	 */
@Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
    synchronized (cachedDciValues) {
        cachedDciValues.clear();
    }
    if (newInput instanceof NetworkMapPage) {
        page = (NetworkMapPage) newInput;
        synchronized (cachedDciValues) {
            for (NetworkMapElement e : page.getElements()) {
                if (e instanceof NetworkMapObject) {
                    long id = ((NetworkMapObject) e).getObjectId();
                    AbstractObject object = session.findObjectById(id);
                    if ((object != null) && (object instanceof AbstractNode)) {
                        cachedDciValues.put(id, null);
                    }
                }
            }
        }
    } else {
        page = null;
    }
}
Also used : NetworkMapPage(org.netxms.client.maps.NetworkMapPage) AbstractNode(org.netxms.client.objects.AbstractNode) NetworkMapElement(org.netxms.client.maps.elements.NetworkMapElement) AbstractObject(org.netxms.client.objects.AbstractObject) NetworkMapObject(org.netxms.client.maps.elements.NetworkMapObject)

Aggregations

NetworkMapPage (org.netxms.client.maps.NetworkMapPage)11 NetworkMapObject (org.netxms.client.maps.elements.NetworkMapObject)8 NetworkMapLink (org.netxms.client.maps.NetworkMapLink)6 AbstractObject (org.netxms.client.objects.AbstractObject)3 NXCPMessage (org.netxms.base.NXCPMessage)2 NetworkMapElement (org.netxms.client.maps.elements.NetworkMapElement)2 AccessPoint (org.netxms.client.objects.AccessPoint)2 ConnectionPoint (org.netxms.client.topology.ConnectionPoint)2 AbstractNode (org.netxms.client.objects.AbstractNode)1 Cluster (org.netxms.client.objects.Cluster)1 VPNConnector (org.netxms.client.objects.VPNConnector)1 HopInfo (org.netxms.client.topology.HopInfo)1 NetworkPath (org.netxms.client.topology.NetworkPath)1