@Test public void drawVerticalReferenceLines() throws Exception { GraphBuffer graphBuffer = new GraphBuffer(300, 200); graphBuffer.drawBackground(Color.WHITE); ArrayInt positions = new ArrayInt(10, 150, 289); graphBuffer.drawVerticalReferenceLines(positions, Color.BLACK, 5, 194); ImageAssert.compareImages("graphBuffer.drawVerticalReferenceLines", graphBuffer.getImage()); }
void drawVerticalReferenceLines(ListInt referencePixels, Color lineColor, int graphBottomPixel, int graphTopPixel) { g.setColor(lineColor); g.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE); for (int i = 0; i < referencePixels.size(); i++) { g.drawLine(referencePixels.getInt(i), graphTopPixel, referencePixels.getInt(i), graphBottomPixel); } }
GraphBuffer { void drawVerticalReferenceLines(ListInt referencePixels, Color lineColor, int graphBottomPixel, int graphTopPixel) { g.setColor(lineColor); g.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE); for (int i = 0; i < referencePixels.size(); i++) { g.drawLine(referencePixels.getInt(i), graphTopPixel, referencePixels.getInt(i), graphBottomPixel); } } }
GraphBuffer { void drawVerticalReferenceLines(ListInt referencePixels, Color lineColor, int graphBottomPixel, int graphTopPixel) { g.setColor(lineColor); g.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE); for (int i = 0; i < referencePixels.size(); i++) { g.drawLine(referencePixels.getInt(i), graphTopPixel, referencePixels.getInt(i), graphBottomPixel); } } private  GraphBuffer(BufferedImage image);  GraphBuffer(int width, int height);  GraphBuffer(Graph2DRenderer<?> renderer); }
GraphBuffer { void drawVerticalReferenceLines(ListInt referencePixels, Color lineColor, int graphBottomPixel, int graphTopPixel) { g.setColor(lineColor); g.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE); for (int i = 0; i < referencePixels.size(); i++) { g.drawLine(referencePixels.getInt(i), graphTopPixel, referencePixels.getInt(i), graphBottomPixel); } } private  GraphBuffer(BufferedImage image);  GraphBuffer(int width, int height);  GraphBuffer(Graph2DRenderer<?> renderer); void setPixel(int x, int y, int color); BufferedImage getImage(); Graphics2D getGraphicsContext(); void drawDataImage(int xStartPoint, int yStartPoint,
                        int[] xPointToDataMap, int[] yPointToDataMap,
                        Cell2DDataset data, NumberColorMapInstance colorMap); void setXScaleAsCell(Range range, int xMinPixel, int xMaxPixel, ValueScale xValueScale); void setXScaleAsPoint(Range range, int xMinPixel, int xMaxPixel, ValueScale xValueScale); int xValueToPixel(double value); double xPixelLeftToValue(int pixelValue); double xPixelRightToValue(int pixelValue); double xPixelCenterToValue(int pixelValue); void setYScaleAsCell(Range range, int yMinPixel, int yMaxPixel, ValueScale yValueScale); void setYScaleAsPoint(Range range, int yMinPixel, int yMaxPixel, ValueScale yValueScale); int yValueToPixel(double value); double yPixelTopToValue(int pixelValue); double yPixelCenterToValue(int pixelValue); double yPixelBottomToValue(int pixelValue); void drawValueLine(ListNumber xValues, ListNumber yValues, InterpolationScheme interpolation, ProcessValue pv); void drawValueExplicitLine(Point2DDataset data, InterpolationScheme interpolation, ReductionScheme reduction,ProcessValue pv); }
GraphBuffer { void drawVerticalReferenceLines(ListInt referencePixels, Color lineColor, int graphBottomPixel, int graphTopPixel) { g.setColor(lineColor); g.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE); for (int i = 0; i < referencePixels.size(); i++) { g.drawLine(referencePixels.getInt(i), graphTopPixel, referencePixels.getInt(i), graphBottomPixel); } } private  GraphBuffer(BufferedImage image);  GraphBuffer(int width, int height);  GraphBuffer(Graph2DRenderer<?> renderer); void setPixel(int x, int y, int color); BufferedImage getImage(); Graphics2D getGraphicsContext(); void drawDataImage(int xStartPoint, int yStartPoint,
                        int[] xPointToDataMap, int[] yPointToDataMap,
                        Cell2DDataset data, NumberColorMapInstance colorMap); void setXScaleAsCell(Range range, int xMinPixel, int xMaxPixel, ValueScale xValueScale); void setXScaleAsPoint(Range range, int xMinPixel, int xMaxPixel, ValueScale xValueScale); int xValueToPixel(double value); double xPixelLeftToValue(int pixelValue); double xPixelRightToValue(int pixelValue); double xPixelCenterToValue(int pixelValue); void setYScaleAsCell(Range range, int yMinPixel, int yMaxPixel, ValueScale yValueScale); void setYScaleAsPoint(Range range, int yMinPixel, int yMaxPixel, ValueScale yValueScale); int yValueToPixel(double value); double yPixelTopToValue(int pixelValue); double yPixelCenterToValue(int pixelValue); double yPixelBottomToValue(int pixelValue); void drawValueLine(ListNumber xValues, ListNumber yValues, InterpolationScheme interpolation, ProcessValue pv); void drawValueExplicitLine(Point2DDataset data, InterpolationScheme interpolation, ReductionScheme reduction,ProcessValue pv);  }