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);
}
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();
}
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);
}
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();
}
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;
}
}
Aggregations