Exemple #1
0
        public void showLayerLayerSettingsEditor(int selectedLayerListIndex, LayerType layerType)
        {
            Layer layer = null;
            if (selectedLayerListIndex >= 0)
                layer = layerManager.getLayerFromMapping(selectedLayerListIndex);

            if (layerType == LayerType.Shape && selectedLayerListIndex >= 0)
            {
                if (layerSettingsEditor == null)
                    layerSettingsEditor = LayerSettingEditor.Instance(mainForm.VisibleDesktop, this);
                activeDialogs.Add(layerSettingsEditor);

                if (layer.Type == GravurGIS.Layers.LayerType.Shape)
                {
                    mainForm.enableInputPanel(true);
                    if (layerSettingsEditor.ShowDialog((ShapeObject)layer) == DialogResult.OK)
                    {
                        mapPanel.ScreenChanged = true;
                        mainForm.updateListView();
                    }
                }
                activeDialogs.Remove(layerSettingsEditor);
            }
            else if ((layerType == LayerType.PointCanvas
                || layerType == LayerType.PolylineCanvas
                || layerType == LayerType.PolygonCanvas) && selectedLayerListIndex == -1)
            {
                if (layerSettingsEditor == null)
                    layerSettingsEditor = LayerSettingEditor.Instance(mainForm.VisibleDesktop, this);
                        activeDialogs.Add(layerSettingsEditor);

                mainForm.enableInputPanel(true);
                if (layerSettingsEditor.ShowDialog(layerType) == DialogResult.OK)
                {
                    mapPanel.ScreenChanged = true;
                    mainForm.updateListView();
                }
                activeDialogs.Remove(layerSettingsEditor);
            }
            else if (layerType == LayerType.Image)
            {
                if (imageSettingsEditor == null)
                    imageSettingsEditor = new ImageSettingEditor(mainForm.VisibleDesktop, this);
                activeDialogs.Add(imageSettingsEditor);

                mainForm.enableInputPanel(true);
                if (imageSettingsEditor.ShowDialog((ImageLayer)layer) == DialogResult.OK)
                {
                    mapPanel.ScreenChanged = true;
                    mainForm.updateListView();
                }
                activeDialogs.Remove(imageSettingsEditor);
            }
            else if (layerType == LayerType.MapServer)
            {
                MapServerSettings mapServerDialog = new MapServerSettings(mainForm.VisibleDesktop, this);
                activeDialogs.Add(mapServerDialog);

                mainForm.enableInputPanel(true);
                if (mapServerDialog.ShowDialog((MapServerLayer)layer) == DialogResult.OK)
                {
                    mapPanel.ScreenChanged = true;
                    mainForm.updateListView();
                }
                activeDialogs.Remove(mapServerDialog);
            }

            mainForm.enableInputPanel(false);
        }
Exemple #2
0
        public static LayerSettingEditor Instance(Rectangle visibleRect, MainControler mainControler)
        {
            if (reference == null) reference = new LayerSettingEditor(visibleRect, mainControler);

            return reference;
        }