Пример #1
0
        private void Init()
        {
            InitializeComponent();

            _initState = _shapefile.Categories.Serialize();

            _noEvents = true;
            ColorSchemeProvider.SetFirstColorScheme(SchemeTarget.Vector, _shapefile);

            // updates the list
            RefreshCategoriesList();
            _noEvents = false;

            RefreshControlState();
        }
Пример #2
0
        public void Initialize()
        {
            _metadata   = SymbologyPlugin.GetMetadata(Model.Handle);
            _featureSet = Model.FeatureSet;

            var model = new CategoriesSubViewModel(Model, _metadata);

            _categoriesPresenter.Initialize(model);

            MapConfig.ForceHideLabels = true;

            Text = "Layer properties: " + Model.Name;

            _initState = SaveState();

            InitializeCore();

            ColorSchemeProvider.SetFirstColorScheme(SchemeTarget.Vector, _featureSet);

            Shown += OnFormShown;
        }
Пример #3
0
        public void Initialize()
        {
            if (icbCharts.Items.Count > 0)
            {
                icbCharts.SelectedIndex = 0;
            }

            if (icbRaster.Items.Count > 0)
            {
                icbRaster.SelectedIndex = 0;
            }

            if (icbVector.Items.Count > 1)
            {
                icbVector.SelectedIndex = 1;
            }

            txtIconPath.Text   = ResourcePathHelper.GetIconsPath();
            txtTexurePath.Text = ResourcePathHelper.GetTexturesPath();

            ColorSchemeProvider.SetFirstColorScheme(SchemeTarget.Vector, Color.Gray);
        }
Пример #4
0
        /// <summary>
        /// Generates a new instance of the GenerateCategoriesForm class
        /// </summary>
        public GenerateCategoriesForm(IAppContext context, ILayer layer) :
            base(context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            if (layer == null || layer.FeatureSet == null)
            {
                throw new ArgumentNullException("layer");
            }
            _layer = layer;

            InitializeComponent();

            _shapefile = layer.FeatureSet;

            var settings = SymbologyPlugin.GetMetadata(_layer.Handle);

            // classification
            cboClassificationType.Items.Clear();
            cboClassificationType.Items.Add("Natural breaks");
            cboClassificationType.Items.Add("Unique values");
            cboClassificationType.Items.Add("Equal intervals");
            cboClassificationType.Items.Add("Quantiles");
            cboClassificationType.SelectedIndex = (int)settings.CategoriesClassification;

            // number of categories
            cboCategoriesCount.Items.Clear();
            for (int i = 3; i <= 25; i++)
            {
                cboCategoriesCount.Items.Add(Convert.ToString(i));
            }
            cboCategoriesCount.Text = settings.CategoriesCount.ToString();

            // dummy color scheme
            ColorSchemeProvider.SetFirstColorScheme(SchemeTarget.Vector, _shapefile);

            // initializing for list of color schemes
            icbColorScheme.Target = SchemeTarget.Vector;

            // settings active color scheme
            icbColorScheme.SetSelectedItem(settings.CategoriesColorScheme);

            if (icbColorScheme.SelectedItem == null)
            {
                icbColorScheme.SelectedIndex = 0;
            }

            InitSize();

            chkRandomColors.Checked    = settings.CategoriesRandomColors;
            chkSetGradient.Checked     = settings.CategoriesUseGradient;
            chkUseVariableSize.Checked = settings.CategoriesVariableSize;

            RefreshControlsState(null, null);

            string name = settings.CategoriesFieldName.ToLower();

            for (int i = 0; i < cboField.Items.Count; i++)
            {
                if (((RealIndexComboItem)cboField.Items[i]).Text.ToLower() == name)
                {
                    cboField.SelectedIndex = i;
                    break;
                }
            }
        }