Search in sources :

Example 1 with NetworkMapDecoration

use of org.netxms.client.maps.elements.NetworkMapDecoration in project netxms by netxms.

the class PredefinedMap method editGroupBox.

/**
 * Edit group box
 */
private void editGroupBox() {
    IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
    if ((selection.size() != 1) || !(selection.getFirstElement() instanceof NetworkMapDecoration))
        return;
    NetworkMapDecoration groupBox = (NetworkMapDecoration) selection.getFirstElement();
    EditGroupBoxDialog dlg = new EditGroupBoxDialog(getSite().getShell(), groupBox);
    if (dlg.open() == Window.OK) {
        mapPage.addElement(groupBox);
        saveMap();
    }
}
Also used : EditGroupBoxDialog(org.netxms.ui.eclipse.networkmaps.dialogs.EditGroupBoxDialog) NetworkMapDecoration(org.netxms.client.maps.elements.NetworkMapDecoration) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection)

Example 2 with NetworkMapDecoration

use of org.netxms.client.maps.elements.NetworkMapDecoration 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 3 with NetworkMapDecoration

use of org.netxms.client.maps.elements.NetworkMapDecoration in project netxms by netxms.

the class PredefinedMap method addGroupBoxDecoration.

/**
 * Add group box decoration
 */
private void addGroupBoxDecoration() {
    NetworkMapDecoration element = new NetworkMapDecoration(mapPage.createElementId(), NetworkMapDecoration.GROUP_BOX);
    EditGroupBoxDialog dlg = new EditGroupBoxDialog(getSite().getShell(), element);
    if (dlg.open() != Window.OK)
        return;
    mapPage.addElement(element);
    saveMap();
}
Also used : EditGroupBoxDialog(org.netxms.ui.eclipse.networkmaps.dialogs.EditGroupBoxDialog) NetworkMapDecoration(org.netxms.client.maps.elements.NetworkMapDecoration)

Example 4 with NetworkMapDecoration

use of org.netxms.client.maps.elements.NetworkMapDecoration in project netxms by netxms.

the class PredefinedMap method addImageDecoration.

/**
 * Add image decoration
 */
private void addImageDecoration() {
    ImageSelectionDialog dlg = new ImageSelectionDialog(getSite().getShell());
    if (dlg.open() != Window.OK)
        return;
    UUID imageGuid = dlg.getLibraryImage().getGuid();
    Rectangle imageBounds = dlg.getImage().getBounds();
    NetworkMapDecoration element = new NetworkMapDecoration(mapPage.createElementId(), NetworkMapDecoration.IMAGE);
    element.setSize(imageBounds.width, imageBounds.height);
    element.setTitle(imageGuid.toString());
    mapPage.addElement(element);
    saveMap();
}
Also used : Rectangle(org.eclipse.swt.graphics.Rectangle) NetworkMapDecoration(org.netxms.client.maps.elements.NetworkMapDecoration) UUID(java.util.UUID) ImageSelectionDialog(org.netxms.ui.eclipse.imagelibrary.dialogs.ImageSelectionDialog)

Aggregations

NetworkMapDecoration (org.netxms.client.maps.elements.NetworkMapDecoration)4 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)2 EditGroupBoxDialog (org.netxms.ui.eclipse.networkmaps.dialogs.EditGroupBoxDialog)2 UUID (java.util.UUID)1 Separator (org.eclipse.jface.action.Separator)1 Rectangle (org.eclipse.swt.graphics.Rectangle)1 NetworkMapDCIContainer (org.netxms.client.maps.elements.NetworkMapDCIContainer)1 NetworkMapDCIImage (org.netxms.client.maps.elements.NetworkMapDCIImage)1 NetworkMapObject (org.netxms.client.maps.elements.NetworkMapObject)1 NetworkMapTextBox (org.netxms.client.maps.elements.NetworkMapTextBox)1 AbstractObject (org.netxms.client.objects.AbstractObject)1 ImageSelectionDialog (org.netxms.ui.eclipse.imagelibrary.dialogs.ImageSelectionDialog)1