Example #1
0
        private void CreateGraphLayer()
        {
            // create the graph layer and modify its styles
            graphLayer      = new NLayer();
            graphLayer.Name = "Graph Layer";

            graphLayer.Style.StrokeStyle = new NStrokeStyle(1, Color.FromArgb(0xaa, 0x00, 0x00));
            graphLayer.Style.FillStyle   = new NColorFillStyle(Color.FromArgb(0xff, 0x99, 0x77));
            graphLayer.Style.ShadowStyle = new NShadowStyle(
                ShadowType.Solid,
                Color.FromArgb(80, 0, 0, 0),
                new NPointL(3, 3),
                1,
                new NLength(1));

            // add it to the document and make it the active one
            document.Layers.AddChild(graphLayer);
            document.ActiveLayerUniqueId = graphLayer.UniqueId;

            // create an elliptical grid template with pentagrams in it
            NEllipticalGridTemplate ellipticalGrid = new NEllipticalGridTemplate();

            ellipticalGrid.VerticesShape = BasicShapes.Pentagram;
            ellipticalGrid.Origin        = new NPointF(60, 60);

            // create it
            ellipticalGrid.Create(document);
        }
        private void InitDocument()
        {
            document.Style.TextStyle = new NTextStyle(new Font("Arial", 9), Color.Black);

            NGraphTemplate template;

            // create rectangular grid template
            template               = new NRectangularGridTemplate();
            template.Origin        = new NPointF(10, 23);
            template.VerticesShape = BasicShapes.Rectangle;
            template.Create(document);

            // create tree template
            template               = new NGenericTreeTemplate();
            template.Origin        = new NPointF(250, 23);
            template.VerticesShape = BasicShapes.Triangle;
            template.Create(document);

            // create elliptical grid template
            template               = new NEllipticalGridTemplate();
            template.Origin        = new NPointF(10, 250);
            template.VerticesShape = BasicShapes.Ellipse;
            template.Create(document);

            // create a shape with a 1D shape which reflexes it
            NBasicShapesFactory factory = new NBasicShapesFactory(document);
            NShape shape = factory.CreateShape((int)BasicShapes.Rectangle);

            shape.Bounds = new NRectangleF(350, 350, 100, 100);
            document.ActiveLayer.AddChild(shape);

            NBezierCurveShape bezier = new NBezierCurveShape();

            bezier.StyleSheetName = NDR.NameConnectorsStyleSheet;
            document.ActiveLayer.AddChild(bezier);

            bezier.FromShape = shape;
            bezier.ToShape   = shape;
            bezier.Reflex();
        }
        private void InitDocument()
        {
            NGraphTemplate template;

            // create rectangular grid template
            template               = new NRectangularGridTemplate();
            template.Origin        = new NPointF(10, 23);
            template.VerticesShape = BasicShapes.Rectangle;
            template.Create(document);

            // create tree template
            template               = new NGenericTreeTemplate();
            template.Origin        = new NPointF(250, 23);
            template.VerticesShape = BasicShapes.Triangle;
            template.Create(document);

            // create elliptical grid template
            template               = new NEllipticalGridTemplate();
            template.Origin        = new NPointF(10, 250);
            template.VerticesShape = BasicShapes.Ellipse;
            template.Create(document);
        }