use of org.netxms.client.maps.elements.NetworkMapElement in project netxms by netxms.
the class ExtendedGraphViewer method inputChanged.
/* (non-Javadoc)
* @see org.eclipse.gef4.zest.core.viewers.GraphViewer#inputChanged(java.lang.Object, java.lang.Object)
*/
@Override
protected void inputChanged(Object input, Object oldInput) {
boolean dynamicLayoutEnabled = graph.isDynamicLayoutEnabled();
graph.setDynamicLayout(false);
super.inputChanged(input, oldInput);
graph.setDynamicLayout(dynamicLayoutEnabled);
decorationLayer.removeAll();
decorationFigures.clear();
if ((getContentProvider() instanceof MapContentProvider) && (getLabelProvider() instanceof MapLabelProvider)) {
mapDecorations = ((MapContentProvider) getContentProvider()).getDecorations(input);
if (mapDecorations != null) {
MapLabelProvider lp = (MapLabelProvider) getLabelProvider();
for (NetworkMapElement d : mapDecorations) {
DecorationLayerAbstractFigure figure = (DecorationLayerAbstractFigure) lp.getFigure(d);
figure.setLocation(new org.eclipse.draw2d.geometry.Point(d.getX(), d.getY()));
decorationLayer.add(figure);
decorationFigures.put(d.getId(), figure);
}
}
}
}
use of org.netxms.client.maps.elements.NetworkMapElement 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;
}
}
use of org.netxms.client.maps.elements.NetworkMapElement in project netxms by netxms.
the class NetworkMapWidget method addDciToRequestList.
/**
* Goes thought all links and trys to add to request list required DCIs.
*/
protected void addDciToRequestList() {
Collection<NetworkMapLink> linkList = mapPage.getLinks();
for (NetworkMapLink item : linkList) {
if (item.hasDciData()) {
for (SingleDciConfig value : item.getDciAsList()) {
if (value.type == SingleDciConfig.ITEM) {
dciValueProvider.addDci(value.getNodeId(), value.dciId, mapPage);
} else {
dciValueProvider.addDci(value.getNodeId(), value.dciId, value.column, value.instance, mapPage);
}
}
}
}
Collection<NetworkMapElement> mapElements = mapPage.getElements();
for (NetworkMapElement element : mapElements) {
if (element instanceof NetworkMapDCIContainer) {
NetworkMapDCIContainer item = (NetworkMapDCIContainer) element;
if (item.hasDciData()) {
for (SingleDciConfig value : item.getObjectDCIArray()) {
if (value.type == SingleDciConfig.ITEM) {
dciValueProvider.addDci(value.getNodeId(), value.dciId, mapPage);
} else {
dciValueProvider.addDci(value.getNodeId(), value.dciId, value.column, value.instance, mapPage);
}
}
}
}
if (element instanceof NetworkMapDCIImage) {
NetworkMapDCIImage item = (NetworkMapDCIImage) element;
DCIImageConfiguration config = item.getImageOptions();
SingleDciConfig value = config.getDci();
if (value.type == SingleDciConfig.ITEM) {
dciValueProvider.addDci(value.getNodeId(), value.dciId, mapPage);
} else {
dciValueProvider.addDci(value.getNodeId(), value.dciId, value.column, value.instance, mapPage);
}
}
}
}
Aggregations