Search in sources :

Example 1 with NetworkMapDCIImage

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);
}
Also used : NetworkMapTextBox(org.netxms.client.maps.elements.NetworkMapTextBox) NetworkMapDCIImage(org.netxms.client.maps.elements.NetworkMapDCIImage) NetworkMapDecoration(org.netxms.client.maps.elements.NetworkMapDecoration) AbstractObject(org.netxms.client.objects.AbstractObject) NetworkMapObject(org.netxms.client.maps.elements.NetworkMapObject) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) NetworkMapDCIContainer(org.netxms.client.maps.elements.NetworkMapDCIContainer) Separator(org.eclipse.jface.action.Separator)

Example 2 with NetworkMapDCIImage

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();
    }
}
Also used : PropertyDialog(org.eclipse.ui.internal.dialogs.PropertyDialog) NetworkMapDCIImage(org.netxms.client.maps.elements.NetworkMapDCIImage) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection)

Example 3 with NetworkMapDCIImage

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);
            }
        }
    }
}
Also used : NetworkMapDCIImage(org.netxms.client.maps.elements.NetworkMapDCIImage) NetworkMapElement(org.netxms.client.maps.elements.NetworkMapElement) DCIImageConfiguration(org.netxms.client.maps.configs.DCIImageConfiguration) NetworkMapDCIContainer(org.netxms.client.maps.elements.NetworkMapDCIContainer) NetworkMapLink(org.netxms.client.maps.NetworkMapLink) SingleDciConfig(org.netxms.client.maps.configs.SingleDciConfig)

Example 4 with NetworkMapDCIImage

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();
        }
    }
}
Also used : PropertyDialog(org.eclipse.ui.internal.dialogs.PropertyDialog) NetworkMapDCIImage(org.netxms.client.maps.elements.NetworkMapDCIImage)

Example 5 with NetworkMapDCIImage

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);
            }
        }
    }
}
Also used : NetworkMapDCIImage(org.netxms.client.maps.elements.NetworkMapDCIImage) NetworkMapElement(org.netxms.client.maps.elements.NetworkMapElement) DCIImageConfiguration(org.netxms.client.maps.configs.DCIImageConfiguration) NetworkMapDCIContainer(org.netxms.client.maps.elements.NetworkMapDCIContainer) NetworkMapLink(org.netxms.client.maps.NetworkMapLink) SingleDciConfig(org.netxms.client.maps.configs.SingleDciConfig)

Aggregations

NetworkMapDCIImage (org.netxms.client.maps.elements.NetworkMapDCIImage)5 NetworkMapDCIContainer (org.netxms.client.maps.elements.NetworkMapDCIContainer)3 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)2 PropertyDialog (org.eclipse.ui.internal.dialogs.PropertyDialog)2 NetworkMapLink (org.netxms.client.maps.NetworkMapLink)2 DCIImageConfiguration (org.netxms.client.maps.configs.DCIImageConfiguration)2 SingleDciConfig (org.netxms.client.maps.configs.SingleDciConfig)2 NetworkMapElement (org.netxms.client.maps.elements.NetworkMapElement)2 Separator (org.eclipse.jface.action.Separator)1 NetworkMapDecoration (org.netxms.client.maps.elements.NetworkMapDecoration)1 NetworkMapObject (org.netxms.client.maps.elements.NetworkMapObject)1 NetworkMapTextBox (org.netxms.client.maps.elements.NetworkMapTextBox)1 AbstractObject (org.netxms.client.objects.AbstractObject)1