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; }
public static void CreateHeatMapLayoutDiagram(Panel containerPanel, int AxesDivisionFactor, bool IncludeorExclude) { HeatMapLayout.AxesDivisionFactor = AxesDivisionFactor; containerPanel.BackColor = Color.Transparent; containerPanel.Controls.Clear(); Size regionSize = new Size(containerPanel.Size.Width / AxesDivisionFactor, containerPanel.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(IncludeorExclude); heatMapLayoutPanel.Size = regionSize; heatMapLayoutPanel.Location = new Point(regionSize.Width * i, regionSize.Height * j); heatMapLayoutPanel.BackColor = Color.White; heatMapLayoutPanel.BorderStyle = BorderStyle.FixedSingle; heatMapLayoutPanel.BackgroundImageLayout = ImageLayout.Zoom; heatMapLayoutPanel.Visible = false; heatMapLayoutPanel.Parent = containerPanel; heatMapLayoutPanels[i][j] = heatMapLayoutPanel; } } for (int i = 0; i < AxesDivisionFactor; ++i) { for (int j = 0; j < AxesDivisionFactor; ++j) { heatMapLayoutPanels[i][j].Show(); } } }