Пример #1
0
        protected void NDrawingView1_AsyncQueryCommandResult(object sender, EventArgs e)
        {
            NCallbackQueryCommandResultArgs args   = e as NCallbackQueryCommandResultArgs;
            NCallbackCommand         command       = args.Command;
            NAjaxXmlTransportBuilder resultBuilder = args.ResultBuilder;

            switch (command.Name)
            {
            case "queryPosition":
                //	build a custom response data section
                NEllipseShape rotatingEllipse = NDrawingView1.Document.ActiveLayer.GetChildByName("RotatingEllipse", 0) as NEllipseShape;
                if (rotatingEllipse != null)
                {
                    NAjaxXmlDataSection dataSection = new NAjaxXmlDataSection("position");
                    dataSection.Data = rotatingEllipse.Center.ToString();
                    resultBuilder.AddDataSection(dataSection);
                }
                break;

            case "changeColor":
                //	add a built-in data section that will enforce full image refresh at the client
                if (clientSideRedrawRequired && !resultBuilder.ContainsRedrawDataSection())
                {
                    resultBuilder.AddRedrawDataSection(NDrawingView1);
                }
                break;

            case "rotate10Degrees":
                if (resultBuilder.ContainsRedrawDataSection() == false)
                {
                    resultBuilder.AddRedrawDataSection(NDrawingView1);
                }
                break;
            }
        }
Пример #2
0
            protected virtual NDrawingDataObject AdaptMyCustomFormat(NMyDataObject myDataObject)
            {
                if (myDataObject == null)
                {
                    throw new ArgumentNullException("myDataObject");
                }

                // create the respective shape with the specified size
                NShape shape;

                if (myDataObject.shapeType == "Rectangle")
                {
                    shape = new NRectangleShape(new NPointF(0, 0), myDataObject.shapeSize);
                }
                else if (myDataObject.shapeType == "Ellipse")
                {
                    shape = new NEllipseShape(new NPointF(0, 0), myDataObject.shapeSize);
                }
                else
                {
                    return(null);
                }

                // create a drawing data object, which encapsulates the shape
                NDrawingDataObject ddo = new NDrawingDataObject(null, new INDiagramElement[] { shape });

                return(ddo);
            }
Пример #3
0
            void INAutoUpdateCallback.OnAutoUpdate(NAspNetThinWebControl control)
            {
                NThinDiagramControl diagramControl = (NThinDiagramControl)control;

                NDrawingDocument document = diagramControl.Document;

                NEllipseShape rotatingEllipse = document.ActiveLayer.GetChildByName("RotatingEllipse", 0) as NEllipseShape;

                if (rotatingEllipse == null)
                {
                    return;
                }

                NEllipseShape rotatingEllipse2 = document.ActiveLayer.GetChildByName("RotatingEllipse2", 0) as NEllipseShape;

                if (rotatingEllipse2 == null)
                {
                    return;
                }

                rotatingEllipse.Rotate(CoordinateSystem.Scene, 7, rotatingEllipse.PinPoint);
                rotatingEllipse2.Rotate(CoordinateSystem.Scene, -4, rotatingEllipse2.PinPoint);

                diagramControl.UpdateView();
            }
Пример #4
0
        private NGroup CreateStartElement(string text)
        {
            NGroup group = new NGroup();

            document.ActiveLayer.AddChild(group);

            // Create the ellipse shape
            NShape ellipseShape = new NEllipseShape(0, 0, 1, 1);

            group.Shapes.AddChild(ellipseShape);
            ellipseShape.Text = text;
            ellipseShape.SizeToText(new NMarginsF(100, 18, 10, 18));
            ellipseShape.Location = new NPointF(0, 0);

            // Create the check shape
            NBrainstormingShapesFactory brainstormingFactory = new NBrainstormingShapesFactory(document);
            NShape checkShape = brainstormingFactory.CreateShape(BrainstormingShapes.Check);

            checkShape.Bounds = new NRectangleF(26, 12, 24, 23);
            group.Shapes.AddChild(checkShape);

            // Create the ports
            CreatePorts(group, ellipseShape);

            // Set the protections
            SetProtections(group);
            group.UpdateModelBounds();

            return(group);
        }
Пример #5
0
        private void CreateCenterShape()
        {
            // create the center shape to which all other shapes connect
            NRectangleF cell = base.GetGridCell(3, 0);

            cell.Inflate(-5, -5);

            NEllipseShape shape = new NEllipseShape(cell);

            shape.Name = "Center shape";

            shape.Style.FillStyle   = new NColorFillStyle(Color.FromArgb(50, 0, 0xbb, 0));
            shape.Style.StrokeStyle = new NStrokeStyle(1, Color.FromArgb(0, 0xbb, 0));

            shape.CreateShapeElements(ShapeElementsMask.Ports);

            NDynamicPort port = new NDynamicPort(shape.UniqueId, ContentAlignment.MiddleCenter, DynamicPortGlueMode.GlueToContour);

            shape.Ports.AddChild(port);
            shape.Ports.DefaultInwardPortUniqueId = port.UniqueId;

            // add it to the active layer and store for reuse
            document.ActiveLayer.AddChild(shape);
            centerShape = shape;
        }
Пример #6
0
        private void CreateShapesLayer()
        {
            // create the shapes layer and modify its styles
            shapesLayer      = new NLayer();
            shapesLayer.Name = "Shapes Layer";

            shapesLayer.Style.StrokeStyle = new NStrokeStyle(1, Color.FromArgb(0x00, 0x00, 0xaa));
            shapesLayer.Style.FillStyle   = new NColorFillStyle(Color.FromArgb(0xaa, 0xaa, 0xff));
            shapesLayer.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(shapesLayer);
            document.ActiveLayerUniqueId = shapesLayer.UniqueId;

            // create two shapes in it
            NRectangleShape rect = new NRectangleShape(new NRectangleF(60, 60, 70, 70));

            shapesLayer.AddChild(rect);

            NEllipseShape ellipse = new NEllipseShape(new NRectangleF(120, 120, 70, 70));

            shapesLayer.AddChild(ellipse);
        }
Пример #7
0
        protected void IterateRotatingEllipse(bool boost)
        {
            NEllipseShape rotatingEllipse = NDrawingView1.Document.ActiveLayer.GetChildByName("RotatingEllipse", 0) as NEllipseShape;

            if (rotatingEllipse == null)
            {
                return;
            }

            NEllipseShape rotatingEllipse2 = NDrawingView1.Document.ActiveLayer.GetChildByName("RotatingEllipse2", 0) as NEllipseShape;

            if (rotatingEllipse2 == null)
            {
                return;
            }

            if (!boost)
            {
                rotatingEllipse.Rotate(CoordinateSystem.Scene, 7, rotatingEllipse.PinPoint);
                rotatingEllipse2.Rotate(CoordinateSystem.Scene, -4, rotatingEllipse2.PinPoint);
            }
            else
            {
                rotatingEllipse.Rotate(CoordinateSystem.Scene, 27, rotatingEllipse.PinPoint);
                rotatingEllipse2.Rotate(CoordinateSystem.Scene, -14, rotatingEllipse2.PinPoint);
            }

            NDrawingView1.Document.RefreshAllViews();
        }
        private void CreateScene(NDrawingDocument document)
        {
            document.BackgroundStyle.FrameStyle.Visible = false;
            document.Style.TextStyle.FontStyle.InitFromFont(new Font("Arial Narrow", 8));

            NNetworkShapesFactory factory = new NNetworkShapesFactory(document);

            factory.DefaultSize = new NSizeF(240, 180);

            NShape server   = factory.CreateShape(NetworkShapes.Server);
            NShape computer = factory.CreateShape(NetworkShapes.Computer);
            NShape laptop   = factory.CreateShape(NetworkShapes.Laptop);

            document.ActiveLayer.AddChild(server);
            document.ActiveLayer.AddChild(computer);
            document.ActiveLayer.AddChild(laptop);

            NRoutableConnector link1 = new NRoutableConnector();

            document.ActiveLayer.AddChild(link1);
            link1.FromShape = server;
            link1.ToShape   = computer;

            NRoutableConnector link2 = new NRoutableConnector();

            document.ActiveLayer.AddChild(link2);
            link2.FromShape = server;
            link2.ToShape   = laptop;

            // layout the shapes in the active layer using a table layout
            NLayeredGraphLayout layout = new NLayeredGraphLayout();

            // get the shapes to layout
            NNodeList shapes = document.ActiveLayer.Children(NFilters.Shape2D);

            // layout the shapes
            layout.Layout(shapes, new NDrawingLayoutContext(document));

            // resize document to fit all shapes
            document.SizeToContent();

            // add the data shape
            const float   shapeSize = 10;
            NEllipseShape data      = new NEllipseShape(link2.EndPoint.X - shapeSize / 2, link2.EndPoint.Y - shapeSize, shapeSize, shapeSize);

            document.ActiveLayer.AddChild(data);
            NStyle.SetStrokeStyle(data, new NStrokeStyle(0, KnownArgbColorValue.Transparent));
            NStyle.SetFillStyle(data, new NColorFillStyle(KnownArgbColorValue.Red));

            // set the animations style
            SetAnimationsStyle(data, link1, link2);

            // resize document to fit all shapes
            document.SizeToContent();
        }
        private void randomEllipseButton_Click(object sender, System.EventArgs e)
        {
            // create shape
            NEllipseShape shape = null;

            try
            {
                shape = new NEllipseShape(base.GetRandomPoint(view.Viewport), base.GetRandomPoint(view.Viewport));
            }
            catch
            {
                return;
            }

            // add to active layer
            document.ActiveLayer.AddChild(shape);
            document.SmartRefreshAllViews();
        }
        public void CreateEllipse()
        {
            // create ellipse
            NRectangleF   cell    = this.DocumentHelper.GetGridCell(0, 1);
            NEllipseShape ellipse = new NEllipseShape(cell);

            // set fill and stroke styles
            ellipse.Style.FillStyle   = new NGradientFillStyle(GradientStyle.Horizontal, GradientVariant.Variant1, Color.Magenta, Color.LightGreen);
            ellipse.Style.StrokeStyle = new NStrokeStyle(1, Color.Black, LinePattern.Dash);

            // add to active layer
            Document.ActiveLayer.AddChild(ellipse);

            // add description
            cell = this.DocumentHelper.GetGridCell(1, 1);
            NTextShape text = new NTextShape("Ellipse with gradient fill style and dash stroke style", cell);

            Document.ActiveLayer.AddChild(text);
        }
Пример #11
0
        protected void NDrawingView1_AsyncRefresh(object sender, EventArgs e)
        {
            NEllipseShape rotatingEllipse = NDrawingView1.Document.ActiveLayer.GetChildByName("RotatingEllipse", 0) as NEllipseShape;

            if (rotatingEllipse == null)
            {
                return;
            }
            NEllipseShape rotatingEllipse2 = NDrawingView1.Document.ActiveLayer.GetChildByName("RotatingEllipse2", 0) as NEllipseShape;

            if (rotatingEllipse2 == null)
            {
                return;
            }

            rotatingEllipse.Rotate(CoordinateSystem.Scene, 7, rotatingEllipse.PinPoint);
            rotatingEllipse2.Rotate(CoordinateSystem.Scene, -4, rotatingEllipse2.PinPoint);

            NDrawingView1.Document.RefreshAllViews();
        }
Пример #12
0
            public override void OnAsyncRefresh(string webControlId, System.Web.HttpContext context, NStateObject state, EventArgs args)
            {
                NDiagramSessionStateObject diagramState = state as NDiagramSessionStateObject;
                NEllipseShape rotatingEllipse           = diagramState.Document.ActiveLayer.GetChildByName("RotatingEllipse", 0) as NEllipseShape;

                if (rotatingEllipse == null)
                {
                    return;
                }
                NEllipseShape rotatingEllipse2 = diagramState.Document.ActiveLayer.GetChildByName("RotatingEllipse2", 0) as NEllipseShape;

                if (rotatingEllipse2 == null)
                {
                    return;
                }

                rotatingEllipse.Rotate(CoordinateSystem.Scene, 7, rotatingEllipse.PinPoint);
                rotatingEllipse2.Rotate(CoordinateSystem.Scene, -4, rotatingEllipse2.PinPoint);

                diagramState.Document.RefreshAllViews();
            }
Пример #13
0
        protected void NDrawingView1_AsyncMouseMove(object sender, EventArgs e)
        {
            //	this method is called when the web control operates in the standard Microsoft AJAX mode
            DoSimulateResponseDelay();

            NCallbackMouseEventArgs args            = e as NCallbackMouseEventArgs;
            NEllipseShape           rotatingEllipse = NDrawingView1.Document.ActiveLayer.GetChildByName("RotatingEllipse", 0) as NEllipseShape;

            if (rotatingEllipse == null)
            {
                return;
            }
            NEllipseShape rotatingEllipse2 = NDrawingView1.Document.ActiveLayer.GetChildByName("RotatingEllipse2", 0) as NEllipseShape;

            if (rotatingEllipse2 == null)
            {
                return;
            }
            NEllipseShape centerEllipse = NDrawingView1.Document.ActiveLayer.GetChildByName("CenterEllipse", 0) as NEllipseShape;

            if (centerEllipse == null)
            {
                return;
            }

            rotatingEllipse.Style.StrokeStyle  = null;
            rotatingEllipse2.Style.StrokeStyle = null;
            centerEllipse.Style.StrokeStyle    = null;

            NEllipseShape ellipse = HitTestEllipse(args);

            if (ellipse == null)
            {
                return;
            }

            ellipse.Style.StrokeStyle = new NStrokeStyle(2f, Color.Snow);

            NDrawingView1.Document.RefreshAllViews();
        }
Пример #14
0
            public override void OnAsyncMouseMove(string webControlId, System.Web.HttpContext context, NStateObject state, NCallbackMouseEventArgs args)
            {
                //	this method is called when the web control operates in the Nevron Instant Callback mode
                DoSimulateResponseDelay();

                NDiagramSessionStateObject diagramState = state as NDiagramSessionStateObject;
                NEllipseShape rotatingEllipse           = diagramState.Document.ActiveLayer.GetChildByName("RotatingEllipse", 0) as NEllipseShape;

                if (rotatingEllipse == null)
                {
                    return;
                }
                NEllipseShape rotatingEllipse2 = diagramState.Document.ActiveLayer.GetChildByName("RotatingEllipse2", 0) as NEllipseShape;

                if (rotatingEllipse2 == null)
                {
                    return;
                }
                NEllipseShape centerEllipse = diagramState.Document.ActiveLayer.GetChildByName("CenterEllipse", 0) as NEllipseShape;

                if (centerEllipse == null)
                {
                    return;
                }

                rotatingEllipse.Style.StrokeStyle  = null;
                rotatingEllipse2.Style.StrokeStyle = null;
                centerEllipse.Style.StrokeStyle    = null;

                NEllipseShape ellipse = HitTestEllipse(state, args);

                if (ellipse == null)
                {
                    return;
                }

                ellipse.Style.StrokeStyle = new NStrokeStyle(2f, Color.Snow);

                diagramState.Document.RefreshAllViews();
            }
Пример #15
0
        private void CreateCivilEngineeringDocument()
        {
            // set global document styles
            document.Style.TextStyle = new NTextStyle(new Font("Arial", 8.25f));
            document.Style.TextStyle.StringFormatStyle.HorzAlign = HorzAlign.Center;
            document.Style.TextStyle.StringFormatStyle.VertAlign = VertAlign.Center;

            // create the rim rect
            NRectangleShape rimRect = new NRectangleShape(0, 0, 150, 90);

            rimRect.Style.FillStyle = new NColorFillStyle(Color.Green);
            document.ActiveLayer.AddChild(rimRect);

            // create house rect
            NRectangleShape houseRect = new NRectangleShape(3, 3, 52, 32);

            houseRect.Style.FillStyle = new NColorFillStyle(Color.Firebrick);
            houseRect.Text            = "House";
            document.ActiveLayer.AddChild(houseRect);

            // create garage rect
            NRectangleShape garageRect = new NRectangleShape(new NRectangleF(3, 35, 26, 13));

            garageRect.Style.FillStyle = new NColorFillStyle(Color.Firebrick);
            garageRect.Text            = "Garage";
            document.ActiveLayer.AddChild(garageRect);

            // create the pool ellipse
            NEllipseShape poolEllipse = new NEllipseShape(new NRectangleF(60, 3, 75, 75));

            poolEllipse.Style.FillStyle          = new NColorFillStyle(Color.LightBlue);
            poolEllipse.Labels.DefaultLabel.Text = "Pool";
            document.ActiveLayer.AddChild(poolEllipse);

            // update the drawing bounds to size to content with some margins
            document.AutoBoundsMinSize = new NSizeF(1, 1);
            document.AutoBoundsPadding = new Nevron.Diagram.NMargins(1.5f);
            document.AutoBoundsMode    = AutoBoundsMode.AutoSizeToContent;
        }
Пример #16
0
        protected void NDrawingView1_AsyncRefresh(object sender, EventArgs e)
        {
            //	this method is called when the web control operates in the standard Microsoft AJAX mode
            DoSimulateResponseDelay();

            NEllipseShape rotatingEllipse = NDrawingView1.Document.ActiveLayer.GetChildByName("RotatingEllipse", 0) as NEllipseShape;

            if (rotatingEllipse == null)
            {
                return;
            }
            NEllipseShape rotatingEllipse2 = NDrawingView1.Document.ActiveLayer.GetChildByName("RotatingEllipse2", 0) as NEllipseShape;

            if (rotatingEllipse2 == null)
            {
                return;
            }

            rotatingEllipse.Rotate(CoordinateSystem.Scene, 7, rotatingEllipse.PinPoint);
            rotatingEllipse2.Rotate(CoordinateSystem.Scene, -4, rotatingEllipse2.PinPoint);

            NDrawingView1.Document.RefreshAllViews();
        }
Пример #17
0
            public override void OnAsyncRefresh(string webControlId, System.Web.HttpContext context, NStateObject state, EventArgs args)
            {
                //	this method is called when the web control operates in the Nevron Instant Callback mode
                DoSimulateResponseDelay();

                NDiagramSessionStateObject diagramState = state as NDiagramSessionStateObject;
                NEllipseShape rotatingEllipse           = diagramState.Document.ActiveLayer.GetChildByName("RotatingEllipse", 0) as NEllipseShape;

                if (rotatingEllipse == null)
                {
                    return;
                }
                NEllipseShape rotatingEllipse2 = diagramState.Document.ActiveLayer.GetChildByName("RotatingEllipse2", 0) as NEllipseShape;

                if (rotatingEllipse2 == null)
                {
                    return;
                }

                rotatingEllipse.Rotate(CoordinateSystem.Scene, 7, rotatingEllipse.PinPoint);
                rotatingEllipse2.Rotate(CoordinateSystem.Scene, -4, rotatingEllipse2.PinPoint);

                diagramState.Document.RefreshAllViews();
            }
        private void InitDocument()
        {
            // change the default document style
            document.Style.FillStyle   = new NColorFillStyle(Color.FromArgb(50, 0, 0xaa, 0xaa));
            document.Style.StrokeStyle = new NStrokeStyle(1, Color.FromArgb(0, 0xaa, 0xaa));

            // create the group
            NGroup group = new NGroup();

            // create ellipse1
            NEllipseShape ellipse1 = new NEllipseShape(0, 0, 100, 100);

            ellipse1.Text = "1";
            group.Shapes.AddChild(ellipse1);

            // create ellipse2
            NEllipseShape ellipse2 = new NEllipseShape(150, 0, 100, 100);

            ellipse2.Text = "2";
            group.Shapes.AddChild(ellipse2);

            // create ellipse3
            NEllipseShape ellipse3 = new NEllipseShape(0, 150, 100, 100);

            ellipse3.Text = "3";
            group.Shapes.AddChild(ellipse3);

            // update the model bounds of the group
            group.UpdateModelBounds();

            // translate the group
            group.Translate(100, 100);

            // add the group to the active layer
            document.ActiveLayer.AddChild(group);
        }
Пример #19
0
        private void InitDocument()
        {
            // modify the connectors style sheet
            NStyleSheet styleSheet = (NDrawingView1.Document.StyleSheets.GetChildByName(NDR.NameConnectorsStyleSheet, -1) as NStyleSheet);

            NTextStyle textStyle = new NTextStyle();

            textStyle.BackplaneStyle.Visible = true;
            textStyle.BackplaneStyle.StandardFrameStyle.InnerBorderWidth = new NLength(0);
            textStyle.BackplaneStyle.FillStyle = new NColorFillStyle(Color.FromArgb(200, Color.White));
            styleSheet.Style.TextStyle         = textStyle;

            styleSheet.Style.StrokeStyle = new NStrokeStyle(1, Color.Black);
            styleSheet.Style.StartArrowheadStyle.StrokeStyle = new NStrokeStyle(Color.FromArgb(0, Color.Black));
            styleSheet.Style.StartArrowheadStyle.FillStyle   = new NColorFillStyle(Color.FromArgb(0, Color.White));
            styleSheet.Style.EndArrowheadStyle.StrokeStyle   = new NStrokeStyle(1, Color.Black);

            // modify default stroke style
            NDrawingView1.Document.Style.StrokeStyle = new NStrokeStyle(Color.FromArgb(0, Color.White));

            // configure the document
            NDrawingView1.Document.Bounds = new NRectangleF(0, 0, 420, 320);
            NDrawingView1.Document.GraphicsSettings.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
            NDrawingView1.Document.GraphicsSettings.SmoothingMode     = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
            NDrawingView1.Document.GraphicsSettings.PixelOffsetMode   = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality;
            NDrawingView1.Document.MeasurementUnit  = NGraphicsUnit.Pixel;
            NDrawingView1.Document.DrawingScaleMode = DrawingScaleMode.NoScale;

            NDrawingView1.Document.BackgroundStyle.FrameStyle.Visible = false;

            //	predefined styles
            NAdvancedGradientFillStyle ag1 = new NAdvancedGradientFillStyle();

            ag1.BackgroundColor = Color.Navy;
            ag1.Points.Add(new NAdvancedGradientPoint(Color.SkyBlue, 50, 50, 0, 79, AGPointShape.Circle));

            NAdvancedGradientFillStyle ag2 = new NAdvancedGradientFillStyle();

            ag2.BackgroundColor = Color.DarkRed;
            ag2.Points.Add(new NAdvancedGradientPoint(Color.Red, 50, 50, 0, 71, AGPointShape.Circle));

            NAdvancedGradientFillStyle ag3 = new NAdvancedGradientFillStyle();

            ag3.BackgroundColor = Color.Orange;
            ag3.Points.Add(new NAdvancedGradientPoint(Color.Yellow, 50, 50, 0, 50, AGPointShape.Circle));

            //	shapes
            NBasicShapesFactory factory = new NBasicShapesFactory(NDrawingView1.Document);

            NEllipseShape centerEllipse = factory.CreateShape((int)BasicShapes.Ellipse) as NEllipseShape;

            centerEllipse.Name                     = "CenterEllipse";
            centerEllipse.Width                    = 50f;
            centerEllipse.Height                   = 50f;
            centerEllipse.Center                   = new NPointF(210, 160);
            centerEllipse.Style.StrokeStyle        = null;
            centerEllipse.Style.FillStyle          = ag3;
            centerEllipse.Style.InteractivityStyle = new NInteractivityStyle(true, centerEllipse.Name);

            NEllipseShape rotatingEllipse = factory.CreateShape((int)BasicShapes.Ellipse) as NEllipseShape;

            rotatingEllipse.Name                     = "RotatingEllipse";
            rotatingEllipse.Width                    = 35f;
            rotatingEllipse.Height                   = 35f;
            rotatingEllipse.Center                   = new NPointF(centerEllipse.Bounds.X - 100, centerEllipse.Center.Y);
            rotatingEllipse.Style.StrokeStyle        = null;
            rotatingEllipse.Style.FillStyle          = ag1;
            rotatingEllipse.PinPoint                 = new NPointF(centerEllipse.Center.X, centerEllipse.Center.Y);
            rotatingEllipse.Style.InteractivityStyle = new NInteractivityStyle(true, rotatingEllipse.Name);

            NEllipseShape rotatingEllipse2 = factory.CreateShape((int)BasicShapes.Ellipse) as NEllipseShape;

            rotatingEllipse2.Name                     = "RotatingEllipse2";
            rotatingEllipse2.Width                    = 15f;
            rotatingEllipse2.Height                   = 15f;
            rotatingEllipse2.Center                   = new NPointF(centerEllipse.Bounds.Right + 30, centerEllipse.Center.Y);
            rotatingEllipse2.Style.StrokeStyle        = null;
            rotatingEllipse2.Style.FillStyle          = ag2;
            rotatingEllipse2.PinPoint                 = new NPointF(centerEllipse.Center.X, centerEllipse.Center.Y);
            rotatingEllipse2.Style.InteractivityStyle = new NInteractivityStyle(true, rotatingEllipse2.Name);

            NEllipseShape orbit1 = factory.CreateShape((int)BasicShapes.Ellipse) as NEllipseShape;

            orbit1.Name                      = "orbit1";
            orbit1.Width                     = 2 * (centerEllipse.Center.X - rotatingEllipse.Center.X);
            orbit1.Height                    = orbit1.Width;
            orbit1.Center                    = new NPointF(centerEllipse.Center.X, centerEllipse.Center.Y);
            orbit1.Style.StrokeStyle         = new NStrokeStyle(Color.Black);
            orbit1.Style.StrokeStyle.Pattern = LinePattern.Dot;
            orbit1.Style.StrokeStyle.Factor  = 2;
            orbit1.Style.FillStyle           = new NColorFillStyle(Color.FromArgb(0, Color.White));

            NEllipseShape orbit2 = factory.CreateShape((int)BasicShapes.Ellipse) as NEllipseShape;

            orbit2.Name                      = "orbit2";
            orbit2.Width                     = 2 * (centerEllipse.Center.X - rotatingEllipse2.Center.X);
            orbit2.Height                    = orbit2.Width;
            orbit2.Center                    = new NPointF(centerEllipse.Center.X, centerEllipse.Center.Y);
            orbit2.Style.StrokeStyle         = new NStrokeStyle(Color.Black);
            orbit2.Style.StrokeStyle.Pattern = LinePattern.Dot;
            orbit2.Style.StrokeStyle.Factor  = 2;
            orbit2.Style.FillStyle           = new NColorFillStyle(Color.FromArgb(0, Color.White));

            NDrawingView1.Document.ActiveLayer.AddChild(orbit1);
            NDrawingView1.Document.ActiveLayer.AddChild(orbit2);
            NDrawingView1.Document.ActiveLayer.AddChild(centerEllipse);
            NDrawingView1.Document.ActiveLayer.AddChild(rotatingEllipse);
            NDrawingView1.Document.ActiveLayer.AddChild(rotatingEllipse2);

            // some shapes need to have extra ports
            NRotatedBoundsPort port = new NRotatedBoundsPort(centerEllipse.UniqueId, ContentAlignment.MiddleCenter);

            port.Name = "MiddleCenter";
            centerEllipse.Ports.AddChild(port);

            port      = new NRotatedBoundsPort(rotatingEllipse.UniqueId, ContentAlignment.MiddleCenter);
            port.Name = "MiddleCenter";
            rotatingEllipse.Ports.AddChild(port);

            // connect shapes in levels
            NShape connector           = base.CreateConnector(NDrawingView1.Document, centerEllipse, "MiddleCenter", rotatingEllipse, "MiddleCenter", ConnectorType.Line, "Radius");
            NInteractivityStyle istyle = connector.ComposeInteractivityStyle();
        }