void INMouseEventCallback.OnMouseEvent(NAspNetThinWebControl control, NBrowserMouseEventArgs e)
            {
                NThinDiagramControl diagramControl = (NThinDiagramControl)control;
                NNodeList           nodes          = diagramControl.HitTest(new NPointF(e.X, e.Y));
                NNodeList           shapes         = nodes.Filter(TableShapeFilter);

                if (shapes.Count == 0)
                {
                    diagramControl.Document.Tag = null;
                    return;
                }

                NNodeList decorators = nodes.Filter(DecoratorFilter);

                if (decorators.Count > 0)
                {
                    // Toggle the clicked show/hide subtree decorator and update the view
                    ((NShowHideSubtreeDecorator)decorators[0]).ToggleState();
                    diagramControl.UpdateView();
                }

                // Send a custom command
                NTableShape table    = (NTableShape)shapes[0];
                NEmployee   employee = (NEmployee)table.Tag;

                diagramControl.AddCustomClientCommand(employee.GetData());
            }
            void INMouseEventCallback.OnMouseEvent(NAspNetThinWebControl control, NBrowserMouseEventArgs e)
            {
                NThinDiagramControl diagramControl = (NThinDiagramControl)control;
                NNodeList           nodes          = diagramControl.HitTest(new NPointF(e.X, e.Y));
                NNodeList           shapes         = nodes.Filter(CellFilter);

                if (shapes.Count == 0)
                {
                    return;
                }

                NClickomaniaGame game = (NClickomaniaGame)diagramControl.Document.Tag;
                NTableCell       cell = (NTableCell)shapes[0];

                if (cell.ParentNode.ParentNode != game.BoardShape)
                {
                    return;
                }

                if (String.IsNullOrEmpty(cell.StyleSheetName))
                {
                    return;
                }

                if (game.OnCellClicked(cell) == false)
                {
                    return;
                }

                // The user has clicked on a cell that is part of a region
                diagramControl.ServerSettings.EnableAutoUpdate = true;
                diagramControl.Update();
            }
Пример #3
0
            public void OnMouseEvent(NAspNetThinWebControl control, NBrowserMouseEventArgs e)
            {
                NThinChartControl chartControl = (NThinChartControl)control;

                NPieChart      pieChart      = (NPieChart)chartControl.Charts[0];
                NHitTestResult hitTestResult = chartControl.HitTest(e.X, e.Y);

                int dataPointIndex = hitTestResult.DataPointIndex;

                // collapse all pie slices
                NPieSeries pieSeries = (NPieSeries)pieChart.Series[0];

                for (int i = 0; i < pieSeries.Values.Count; i++)
                {
                    pieSeries.Detachments[i] = 0;
                }

                // expand the one that's hit
                if (dataPointIndex != -1)
                {
                    pieSeries.Detachments[dataPointIndex] = 5.0f;
                }

                chartControl.UpdateView();
            }
Пример #4
0
            void INMouseEventCallback.OnMouseEvent(NAspNetThinWebControl control, NBrowserMouseEventArgs e)
            {
                NThinDiagramControl diagramControl = (NThinDiagramControl)control;
                NNodeList           nodes          = diagramControl.HitTest(new NPointF(e.X, e.Y));
                NNodeList           decorators     = nodes.Filter(ExpandCollapseDecoratorFilter);

                if (decorators.Count > 0)
                {
                    ((NExpandCollapseDecorator)decorators[0]).ToggleState();
                    diagramControl.UpdateView();
                }
            }
            void INMouseEventCallback.OnMouseEvent(NAspNetThinWebControl control, NBrowserMouseEventArgs e)
            {
                NThinDiagramControl diagramControl = (NThinDiagramControl)control;
                NNodeList           allShapes      = diagramControl.Document.ActiveLayer.Children(Nevron.Diagram.Filters.NFilters.Shape2D);

                NNodeList affectedNodes  = diagramControl.HitTest(new NPointF(e.X, e.Y));
                NNodeList affectedShapes = affectedNodes.Filter(Nevron.Diagram.Filters.NFilters.Shape2D);

                int  length;
                bool fillChanged = false;

                length = allShapes.Count;
                for (int i = 0; i < length; i++)
                {
                    NShape shape = allShapes[i] as NShape;
                    shape.Style.ShadowStyle = null;
                    if (shape.Tag != null)
                    {
                        NColorFillStyle newFill = new NColorFillStyle((Color)shape.Tag);
                        fillChanged           = fillChanged || !shape.Style.FillStyle.Equals(newFill);
                        shape.Style.FillStyle = newFill;
                    }
                }

                length = affectedShapes.Count;
                for (int i = 0; i < length; i++)
                {
                    NShape shape = affectedShapes[i] as NShape;
                    shape.Style.ShadowStyle = new NShadowStyle(ShadowType.GaussianBlur, Color.FromArgb(96, Color.Black), new NPointL(3, 3), 1, new NLength(10));

                    NColorFillStyle fs = shape.Style.FillStyle as NColorFillStyle;
                    if (fs != null && fs.Color != Color.White)
                    {
                        shape.Tag = fs.Color;
                        NColorFillStyle newFill = new NColorFillStyle(Color.YellowGreen);
                        fillChanged = fillChanged || !shape.Style.FillStyle.Equals(newFill);

                        shape.Style.FillStyle = newFill;
                    }
                }

                if (fillChanged)
                {
                    diagramControl.UpdateView();
                }
                else
                {
                    diagramControl.ClearResponse();
                }
            }
            void INMouseEventCallback.OnMouseEvent(NAspNetThinWebControl control, NBrowserMouseEventArgs e)
            {
                NThinChartControl chartControl = (NThinChartControl)control;

                NPieChart  pieChart  = (NPieChart)chartControl.Charts[0];
                NPieSeries pieSeries = (NPieSeries)pieChart.Series[0];

                for (int i = 0; i < pieSeries.Values.Count; i++)
                {
                    pieSeries.Detachments[i] = 5.0f;
                }

                chartControl.UpdateView();
            }
Пример #7
0
            void INMouseEventCallback.OnMouseEvent(NAspNetThinWebControl control, NBrowserMouseEventArgs e)
            {
                NThinDiagramControl diagramControl = (NThinDiagramControl)control;
                NNodeList           nodes          = diagramControl.HitTest(new NPointF(e.X, e.Y));
                NNodeList           shapes         = nodes.Filter(NFilters.Shape2D);
                NDrawingDocument    document       = diagramControl.Document;

                if (String.IsNullOrEmpty(m_MapRenderer.CurrentState))
                {
                    if (shapes.Count == 0)
                    {
                        return;
                    }

                    // The user has clicked a state
                    NShape shape = (NShape)shapes[0];
                    m_MapRenderer.LoadStateMap(document, shape.Name);
                }
                else
                {
                    if (shapes.Count == 0)
                    {
                        // Return to the States map
                        m_MapRenderer.LoadUsaMap(document);
                    }
                    else
                    {
                        // The user has clicked a county
                        NShape shape = (NShape)shapes[0];
                        if (shape.StyleSheetName == "ClickedCounty")
                        {
                            // The user has clicked a selected county - unselect it
                            shape.StyleSheetName = String.Empty;
                            shape.Text           = String.Empty;
                        }
                        else
                        {
                            // The user has clicked a non selected county - select it (make it red)
                            shape.StyleSheetName = "ClickedCounty";
                            shape.Text           = shape.Name;
                        }
                    }
                }

                diagramControl.UpdateView();
            }