Ejemplo n.º 1
0
 /// <summary>
 /// Creates a point symbolizer with one member, and that member is constructed
 /// based on the values specified.
 /// </summary>
 /// <param name="color"></param>
 /// <param name="shape"></param>
 /// <param name="size"></param>
 public PointSymbolizer(Color color, PointShapes shape, double size)
 {
     base.Smoothing = true;
     _symbols = new CopyList<ISymbol>();
     ISimpleSymbol ss = new SimpleSymbol(color, shape, size);
     _symbols.Add(ss);
 }
Ejemplo n.º 2
0
 private void Configure()
 {
     _symbols = new CopyList<ISymbol>();
     ISimpleSymbol ss = new SimpleSymbol();
     ss.Color = Global.RandomColor();
     ss.Opacity = 1F;
     ss.PointShape = PointShapes.Rectangle;
     Smoothing = true;
     ScaleMode = ScaleModes.Symbolic;
     _symbols.Add(ss);
   
 }
 void ccSymbols_AddClicked(object sender, EventArgs e)
 {
     ISymbol s = null;
     string type = cmbSymbolType.SelectedItem.ToString();
     switch (type)
     {
         case "Simple": s = new SimpleSymbol(); break;
         case "Character": s = new CharacterSymbol(); break;
         case "Picture": s = new PictureSymbol(); break;
     }
     if (s != null) ccSymbols.Symbols.Add(s);
     ccSymbols.RefreshList();
     UpdatePreview();
 }
        private void cmbSymbolType_SelectedIndexChanged(object sender, EventArgs e)
        {
            
            if (cmbSymbolType.SelectedItem.ToString() == "Simple")
            {
                if (tabSymbolProperties.TabPages.Contains(tabPicture))
                {
                    tabSymbolProperties.TabPages.Remove(tabPicture);
                }
                if (tabSymbolProperties.TabPages.Contains(tabCharacter))
                {
                    tabSymbolProperties.TabPages.Remove(tabCharacter);
                }
                if (tabSymbolProperties.TabPages.Contains(tabSimple) == false)
                {
                    tabSymbolProperties.TabPages.Insert(0, tabSimple);
                    tabSymbolProperties.SelectedTab = tabSimple;
                    
                }
            }
            if (cmbSymbolType.SelectedItem.ToString() == "Character")
            {
                if (tabSymbolProperties.TabPages.Contains(tabPicture))
                {
                    tabSymbolProperties.TabPages.Remove(tabPicture);
                }
                if (tabSymbolProperties.TabPages.Contains(tabSimple))
                {
                    tabSymbolProperties.TabPages.Remove(tabSimple);
                }
                if (tabSymbolProperties.TabPages.Contains(tabCharacter) == false)
                {
                    tabSymbolProperties.TabPages.Insert(0, tabCharacter);
                    tabSymbolProperties.SelectedTab = tabCharacter;
                }
            }
            if (cmbSymbolType.SelectedItem.ToString() == "Picture")
            {
                if (tabSymbolProperties.TabPages.Contains(tabSimple))
                {
                    tabSymbolProperties.TabPages.Remove(tabSimple);
                }
                if (tabSymbolProperties.TabPages.Contains(tabCharacter))
                {
                    tabSymbolProperties.TabPages.Remove(tabCharacter);
                }
                if (tabSymbolProperties.TabPages.Contains(tabPicture) == false)
                {
                    tabSymbolProperties.TabPages.Insert(0, tabPicture);
                    tabSymbolProperties.SelectedTab = tabPicture;
                }
            }

            if (_ignoreChanges) return;
            
            int index = ccSymbols.Symbols.IndexOf(ccSymbols.SelectedSymbol);
            if (index == -1) return;
            ISymbol oldSymbol = ccSymbols.SelectedSymbol;
            
            if (cmbSymbolType.SelectedItem.ToString() == "Simple")
            {

                SimpleSymbol ss = new SimpleSymbol();
                if (oldSymbol != null) ss.CopyPlacement(oldSymbol);
                ccSymbols.Symbols[index] = ss;
                ccSymbols.RefreshList();
                ccSymbols.SelectedSymbol = ss;
            }
            if (cmbSymbolType.SelectedItem.ToString() == "Character")
            {
                CharacterSymbol cs = new CharacterSymbol();
                if (oldSymbol != null) cs.CopyPlacement(oldSymbol);
                ccSymbols.Symbols[index] = cs;
                ccSymbols.RefreshList();
                ccSymbols.SelectedSymbol = cs;
            }
            if (cmbSymbolType.SelectedItem.ToString() == "Picture")
            {
                PictureSymbol ps = new PictureSymbol();
                if (oldSymbol != null) ps.CopyPlacement(oldSymbol);
                ccSymbols.Symbols[index] = ps;
                ccSymbols.RefreshList();
                ccSymbols.SelectedSymbol = ps;
            }
        }
Ejemplo n.º 5
0
        private void SetInnerSymbol(SymbolTypes type)
        {
            ISymbol newSymbol = null;
            // If this class is acting as a wrapper class, then it should update the internal IStroke.
            switch (type)
            {
                case SymbolTypes.Character:
                    newSymbol = new CharacterSymbol();
                    break;
                case SymbolTypes.Picture:
                    newSymbol = new PictureSymbol();
                    break;
                case SymbolTypes.Simple:
                    newSymbol = new SimpleSymbol();
                    break;
            }
            if (newSymbol != null)
            {
                if (_innerSymbol != null) newSymbol.CopyPlacement(_innerSymbol);
            }
            _innerSymbol = newSymbol;

        }