public HeatMapLayoutRegionPanel(int indexI, int indexJ, float rangeStart, float rangeStop, int divisionFactor,
                                 IHeatMapTestCaseRunListener heatMapTestCaseRunListener)
 {
     this.heatMapLayoutRegionType = HeatMapLayoutRegionTypeEnum.Neutral;
     this.rangeStart                 = rangeStart;
     this.rangeStop                  = rangeStop;
     this.indexI                     = indexI;
     this.indexJ                     = indexJ;
     this.divisionFactor             = divisionFactor;
     this.heatMapTestCaseRunListener = heatMapTestCaseRunListener;
 }
Ejemplo n.º 2
0
        public static void CreateHeatMapLayoutDiagram(Panel newContainerPanel, int AxesDivisionFactor,
                                                      HeatMap heatMapDiagram, string selectedRequirement, float rangeStart, float rangeStop,
                                                      IHeatMapTestCaseRunListener heatMapTestCaseRunListener)
        {
            HeatMapLayout.AxesDivisionFactor = AxesDivisionFactor;
            newContainerPanel.BackColor      = Color.White;
            newContainerPanel.Controls.Clear();
            Size regionSize = new Size(newContainerPanel.Size.Width / AxesDivisionFactor,
                                       newContainerPanel.Size.Width / AxesDivisionFactor);

            heatMapLayoutPanels = new HeatMapLayoutRegionPanel[AxesDivisionFactor][];
            for (int i = 0; i < AxesDivisionFactor; ++i)
            {
                heatMapLayoutPanels[i] = new HeatMapLayoutRegionPanel[AxesDivisionFactor];
            }
            for (int i = 0; i < AxesDivisionFactor; ++i)
            {
                for (int j = 0; j < AxesDivisionFactor; ++j)
                {
                    HeatMapLayoutRegionPanel heatMapLayoutPanel = new HeatMapLayoutRegionPanel(
                        i, j, rangeStart, rangeStop, AxesDivisionFactor, heatMapTestCaseRunListener);

                    heatMapLayoutPanel.Size     = regionSize;
                    heatMapLayoutPanel.Location = new Point(regionSize.Width * i,
                                                            regionSize.Height * j);
                    heatMapLayoutPanel.BackColor = HeatMapLayout.GenerateGrayColorBasedOnTheRatio(
                        heatMapDiagram.GetGrayColorRatio(i, AxesDivisionFactor - 1 - j, AxesDivisionFactor, selectedRequirement));
                    heatMapLayoutPanel.BorderStyle           = BorderStyle.None;
                    heatMapLayoutPanel.BackgroundImageLayout = ImageLayout.Zoom;
                    heatMapLayoutPanel.Visible = false;
                    heatMapLayoutPanel.Parent  = newContainerPanel;
                    heatMapLayoutPanels[i][j]  = heatMapLayoutPanel;
                }
            }
            for (int i = 0; i < AxesDivisionFactor; ++i)
            {
                for (int j = 0; j < AxesDivisionFactor; ++j)
                {
                    heatMapLayoutPanels[i][j].Show();
                }
            }
            containerPanel           = newContainerPanel;
            highlightingImage        = new Panel();
            highlightingImage.Size   = new Size(regionSize.Width / 3, regionSize.Height / 3);
            highlightingImage.Parent = newContainerPanel;
            highlightingImage.BackgroundImageLayout = ImageLayout.Zoom;
            highlightingImage.BackColor             = Color.Yellow;
            highlightingImage.DoubleClick          += heatMapTestCaseRunListener.RunSelectedTestCase;
            highlightingImage.BorderStyle           = BorderStyle.None;
            highlightingImage.Visible = false;
        }