Пример #1
0
        private void defineShapes()
        {
            #region Shapes definition

            Statics.ShapeLibrary = new Dictionary <string, MyShape>();

            Color color1 = Color.FromArgb(255, 31, 73, 125);
            Color color2 = Color.FromArgb(255, 247, 150, 70);
            Color color3 = Colors.White;

            MyShape shape = ShapeFactory.CreateEllipse();
            new ShapeButton(shape, this, color1, Colors.Black, BackgroundColorStyle.Radial, MainShapesWrapPanel);
            new ShapeButton(shape, this, color1, Colors.Black, BackgroundColorStyle.Radial, FlowchartWrapPanel);
            new ShapeButton(shape, this, color1, Colors.Black, BackgroundColorStyle.Radial, ERDWrapPanel);

            shape = ShapeFactory.CreateRectangle();
            new ShapeButton(shape, this, color1, Colors.White, BackgroundColorStyle.Solid, MainShapesWrapPanel);
            new ShapeButton(shape, this, color1, Colors.White, BackgroundColorStyle.Solid, FlowchartWrapPanel);
            new ShapeButton(shape, this, color2, Colors.Black, BackgroundColorStyle.Solid, DFDWrapPanel);
            new ShapeButton(shape, this, color1, Colors.White, BackgroundColorStyle.Solid, ERDWrapPanel);

            shape = ShapeFactory.CreateRhombus();
            new ShapeButton(shape, this, color1, Colors.White, BackgroundColorStyle.Solid, MainShapesWrapPanel);
            new ShapeButton(shape, this, color1, Colors.White, BackgroundColorStyle.Solid, FlowchartWrapPanel);
            new ShapeButton(shape, this, color1, Colors.White, BackgroundColorStyle.Solid, ERDWrapPanel);

            shape = ShapeFactory.CreateText();
            new ShapeButton(shape, this, Colors.White, Colors.Black, BackgroundColorStyle.Solid, MainShapesWrapPanel);

            shape = ShapeFactory.CreateTriangle();
            new ShapeButton(shape, this, color1, Colors.White, BackgroundColorStyle.Solid, MainShapesWrapPanel);
            new ShapeButton(shape, this, color1, Colors.White, BackgroundColorStyle.Solid, FlowchartWrapPanel);

            shape = ShapeFactory.CreateParallelogram();
            new ShapeButton(shape, this, color1, Colors.White, BackgroundColorStyle.Solid, MainShapesWrapPanel);
            new ShapeButton(shape, this, color1, Colors.White, BackgroundColorStyle.Solid, FlowchartWrapPanel);

            shape = ShapeFactory.CreateDFDSymbol1();
            new ShapeButton(shape, this, color2, Colors.Black, BackgroundColorStyle.Solid, DFDWrapPanel);

            shape = ShapeFactory.CreateDFDSymbol2();
            new ShapeButton(shape, this, color2, Colors.Black, BackgroundColorStyle.Radial, DFDWrapPanel);

            shape = ShapeFactory.CreateFlowchartSymbol1();
            new ShapeButton(shape, this, color1, Colors.White, BackgroundColorStyle.Solid, FlowchartWrapPanel);

            shape = ShapeFactory.CreateFlowchartSymbol2();
            new ShapeButton(shape, this, color3, Colors.Black, BackgroundColorStyle.Solid, FlowchartWrapPanel);

            shape = ShapeFactory.CreateFlowchartSymbol3();
            new ShapeButton(shape, this, color1, Colors.White, BackgroundColorStyle.Solid, FlowchartWrapPanel);

            shape = ShapeFactory.CreateFlowchartSymbol4();
            new ShapeButton(shape, this, color3, Colors.Black, BackgroundColorStyle.Solid, FlowchartWrapPanel);

            shape = ShapeFactory.CreateFlowchartSymbol5();
            new ShapeButton(shape, this, color1, Colors.White, BackgroundColorStyle.Solid, FlowchartWrapPanel);

            shape = ShapeFactory.CreateFlowchartSymbol6();
            new ShapeButton(shape, this, color3, Colors.Black, BackgroundColorStyle.Solid, FlowchartWrapPanel);

            shape = ShapeFactory.CreateFlowchartSymbol7();
            new ShapeButton(shape, this, color1, Colors.White, BackgroundColorStyle.Solid, FlowchartWrapPanel);

            shape = ShapeFactory.CreateFlowchartSymbol8();
            new ShapeButton(shape, this, color1, Colors.White, BackgroundColorStyle.Solid, FlowchartWrapPanel);

            shape = ShapeFactory.CreateFlowchartSymbol9();
            new ShapeButton(shape, this, color1, Colors.White, BackgroundColorStyle.Solid, FlowchartWrapPanel);

            shape = ShapeFactory.CreateFlowchartSymbol10();
            new ShapeButton(shape, this, color1, Colors.White, BackgroundColorStyle.Solid, FlowchartWrapPanel);

            shape = ShapeFactory.CreateFlowchartSymbol11();
            new ShapeButton(shape, this, color1, Colors.White, BackgroundColorStyle.Solid, FlowchartWrapPanel);

            shape = ShapeFactory.CreateFlowchartSymbol12();
            new ShapeButton(shape, this, color1, Colors.White, BackgroundColorStyle.Solid, FlowchartWrapPanel);

            shape = ShapeFactory.CreateFlowchartSymbol13();
            new ShapeButton(shape, this, color1, Colors.White, BackgroundColorStyle.Solid, FlowchartWrapPanel);

            shape = ShapeFactory.CreateFlowchartSymbol14();
            new ShapeButton(shape, this, color1, Colors.White, BackgroundColorStyle.Solid, FlowchartWrapPanel);

            shape = ShapeFactory.CreateFlowchartSymbol15();
            new ShapeButton(shape, this, color1, Colors.White, BackgroundColorStyle.Solid, FlowchartWrapPanel);

            shape = ShapeFactory.CreateFlowchartSymbol16();
            new ShapeButton(shape, this, color1, Colors.White, BackgroundColorStyle.Solid, FlowchartWrapPanel);

            shape = ShapeFactory.CreatePieChart();
            new ShapeButton(shape, this, color1, Colors.White, BackgroundColorStyle.Solid, ChartsWrapPanel);

            shape = ShapeFactory.CreateBarChart();
            new ShapeButton(shape, this, color1, Colors.White, BackgroundColorStyle.Solid, ChartsWrapPanel);

            shape = ShapeFactory.CreateHorizontalLine();
            new ShapeButton(shape, this, color1, Colors.White, BackgroundColorStyle.Solid, MainShapesWrapPanel);

            shape = ShapeFactory.CreateVerticalLine();
            new ShapeButton(shape, this, color1, Colors.White, BackgroundColorStyle.Solid, MainShapesWrapPanel);

            shape = ShapeFactory.CreateSimpleConnector();
            new ShapeButton(shape, this, color1, Colors.White, BackgroundColorStyle.Solid, MainShapesWrapPanel);

            shape = ShapeFactory.CreateUMLClass();
            new ShapeButton(shape, this, Colors.White, Colors.Black, BackgroundColorStyle.Solid, UMLWrapPanel);

            shape = ShapeFactory.CreateUMLPackage();
            new ShapeButton(shape, this, Colors.White, Colors.Black, BackgroundColorStyle.Solid, UMLWrapPanel);

            shape = ShapeFactory.CreateUMLActor();
            new ShapeButton(shape, this, Colors.White, Colors.Black, BackgroundColorStyle.Solid, UMLWrapPanel);

            shape = ShapeFactory.CreateUMLUseCase();
            new ShapeButton(shape, this, Colors.White, Colors.Black, BackgroundColorStyle.Radial, UMLWrapPanel);

            shape = ShapeFactory.CreateUMLNote();
            new ShapeButton(shape, this, Colors.White, Colors.Black, BackgroundColorStyle.Solid, UMLWrapPanel);

            shape = ShapeFactory.CreateUMLComponent();
            new ShapeButton(shape, this, Colors.White, Colors.Black, BackgroundColorStyle.Solid, UMLWrapPanel);

            shape = ShapeFactory.CreateUMLNode();
            new ShapeButton(shape, this, Colors.White, Colors.Black, BackgroundColorStyle.Solid, UMLWrapPanel);

            shape = ShapeFactory.CreateERDSymbol1();
            new ShapeButton(shape, this, color1, Colors.Black, BackgroundColorStyle.Radial, ERDWrapPanel);

            shape = ShapeFactory.CreateERDSymbol2();
            new ShapeButton(shape, this, color1, Colors.White, BackgroundColorStyle.Solid, ERDWrapPanel);

            shape = ShapeFactory.CreateERDSymbol3();
            new ShapeButton(shape, this, color1, Colors.White, BackgroundColorStyle.Solid, ERDWrapPanel);

            #endregion
        }