@Test public void testProcessPoint() { System.out.println("processPoint"); Graphics2DEmul g2d = new Graphics2DEmul(); Color color = Color.red; int granulation = 100; testRow.setGranulationValue(granulation); BarRowPlotter instance = new BarRowPlotter(new ChartSettings(), new NumberRenderer()); instance.setBoundsValues(g2d.getBounds(), minXVal, maxXVal, minYVal, maxYVal); instance.paintRow(g2d, testRow, color, 1, 1); String expResult = "setStroke|setColor: java.awt.Color[r=255,g=0,b=0]|setComposite: java.awt.AlphaComposite|fillRect: (10;9) - w:79 h:601|setComposite: java.awt.AlphaComposite|setComposite: java.awt.AlphaComposite|fillRect: (250;189) - w:79 h:421|setComposite: java.awt.AlphaComposite|setComposite: java.awt.AlphaComposite|fillRect: (410;69) - w:79 h:541|setComposite: java.awt.AlphaComposite|setStroke|"; String result = g2d.getResult(); Assert.assertEquals(expResult, result); }
@Override protected void processPoint(Graphics2D g2d, int granulation) { if (y < chartRect.y) { y = chartRect.y; } if (isChartPointValid(x + 1, y)) { int x2 = chartRect.x + (int) ((calcPointX + granulation - minXVal) * dxForDVal) - x - 1; Composite oldComposite = g2d.getComposite(); g2d.setComposite(chartSettings.getBarComposite()); int yHeight = chartRect.y + chartRect.height - y; g2d.fillRect(x, y - 1, x2, yHeight + 1); g2d.setComposite(oldComposite); } }
BarRowPlotter extends AbstractRowPlotter { @Override protected void processPoint(Graphics2D g2d, int granulation) { if (y < chartRect.y) { y = chartRect.y; } if (isChartPointValid(x + 1, y)) { int x2 = chartRect.x + (int) ((calcPointX + granulation - minXVal) * dxForDVal) - x - 1; Composite oldComposite = g2d.getComposite(); g2d.setComposite(chartSettings.getBarComposite()); int yHeight = chartRect.y + chartRect.height - y; g2d.fillRect(x, y - 1, x2, yHeight + 1); g2d.setComposite(oldComposite); } } }
BarRowPlotter extends AbstractRowPlotter { @Override protected void processPoint(Graphics2D g2d, int granulation) { if (y < chartRect.y) { y = chartRect.y; } if (isChartPointValid(x + 1, y)) { int x2 = chartRect.x + (int) ((calcPointX + granulation - minXVal) * dxForDVal) - x - 1; Composite oldComposite = g2d.getComposite(); g2d.setComposite(chartSettings.getBarComposite()); int yHeight = chartRect.y + chartRect.height - y; g2d.fillRect(x, y - 1, x2, yHeight + 1); g2d.setComposite(oldComposite); } } BarRowPlotter(ChartSettings chartSettings, NumberRenderer labelRenderer); }
BarRowPlotter extends AbstractRowPlotter { @Override protected void processPoint(Graphics2D g2d, int granulation) { if (y < chartRect.y) { y = chartRect.y; } if (isChartPointValid(x + 1, y)) { int x2 = chartRect.x + (int) ((calcPointX + granulation - minXVal) * dxForDVal) - x - 1; Composite oldComposite = g2d.getComposite(); g2d.setComposite(chartSettings.getBarComposite()); int yHeight = chartRect.y + chartRect.height - y; g2d.fillRect(x, y - 1, x2, yHeight + 1); g2d.setComposite(oldComposite); } } BarRowPlotter(ChartSettings chartSettings, NumberRenderer labelRenderer);  }
BarRowPlotter extends AbstractRowPlotter { @Override protected void processPoint(Graphics2D g2d, int granulation) { if (y < chartRect.y) { y = chartRect.y; } if (isChartPointValid(x + 1, y)) { int x2 = chartRect.x + (int) ((calcPointX + granulation - minXVal) * dxForDVal) - x - 1; Composite oldComposite = g2d.getComposite(); g2d.setComposite(chartSettings.getBarComposite()); int yHeight = chartRect.y + chartRect.height - y; g2d.fillRect(x, y - 1, x2, yHeight + 1); g2d.setComposite(oldComposite); } } BarRowPlotter(ChartSettings chartSettings, NumberRenderer labelRenderer);   }