use of org.netxms.client.maps.elements.NetworkMapDCIImage in project netxms by netxms.
the class PredefinedMap method fillElementContextMenu.
/*
* (non-Javadoc)
*
* @see
* org.netxms.ui.eclipse.networkmaps.views.NetworkMap#fillElementContextMenu
* (org.eclipse.jface.action.IMenuManager)
*/
protected void fillElementContextMenu(IMenuManager manager) {
if (!readOnly) {
manager.add(actionRemove);
Object o = ((IStructuredSelection) viewer.getSelection()).getFirstElement();
if (o instanceof NetworkMapDCIContainer)
manager.add(actionDCIContainerProperties);
if (o instanceof NetworkMapDCIImage)
manager.add(actionDCIImageProperties);
if (o instanceof NetworkMapTextBox)
manager.add(actionTextBoxProperties);
if (o instanceof NetworkMapDecoration)
manager.add(actionGroupBoxEdit);
manager.add(new Separator());
}
super.fillElementContextMenu(manager);
}
use of org.netxms.client.maps.elements.NetworkMapDCIImage in project netxms by netxms.
the class PredefinedMap method showDCIImageProperties.
/**
* Show DCI Image properties
*/
private void showDCIImageProperties() {
updateObjectPositions();
IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
if ((selection.size() != 1) || !(selection.getFirstElement() instanceof NetworkMapDCIImage))
return;
NetworkMapDCIImage container = (NetworkMapDCIImage) selection.getFirstElement();
PropertyDialog dlg = PropertyDialog.createDialogOn(getSite().getShell(), null, container);
if (dlg != null) {
if (dlg.open() == PropertyDialog.OK)
saveMap();
}
}
use of org.netxms.client.maps.elements.NetworkMapDCIImage in project netxms by netxms.
the class AbstractNetworkMapView 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);
}
}
}
}
use of org.netxms.client.maps.elements.NetworkMapDCIImage in project netxms by netxms.
the class PredefinedMap method addDCIImageToMap.
/**
* Add DCI image to map
*/
private void addDCIImageToMap() {
NetworkMapDCIImage dciImage = new NetworkMapDCIImage(mapPage.createElementId());
// runn property page
PropertyDialog dlg = PropertyDialog.createDialogOn(getSite().getShell(), null, dciImage);
if (dlg != null) {
if (dlg.open() == Window.OK) {
mapPage.addElement(dciImage);
saveMap();
addDciToRequestList();
}
}
}
use of org.netxms.client.maps.elements.NetworkMapDCIImage 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