@Test public void testFindRangeBounds() { WaterfallBarRenderer r = new WaterfallBarRenderer(); assertNull(r.findRangeBounds(null)); }
@Override public Range findRangeBounds(CategoryDataset dataset) { if (dataset == null) { return null; } boolean allItemsNull = true; double minimum = 0.0; double maximum = 0.0; int columnCount = dataset.getColumnCount(); for (int row = 0; row < dataset.getRowCount(); row++) { double runningTotal = 0.0; for (int column = 0; column <= columnCount - 1; column++) { Number n = dataset.getValue(row, column); if (n != null) { allItemsNull = false; double value = n.doubleValue(); if (column == columnCount - 1) { runningTotal = value; } else { runningTotal = runningTotal + value; } minimum = Math.min(minimum, runningTotal); maximum = Math.max(maximum, runningTotal); } } } if (!allItemsNull) { return new Range(minimum, maximum); } else { return null; } }
WaterfallBarRenderer extends BarRenderer { @Override public Range findRangeBounds(CategoryDataset dataset) { if (dataset == null) { return null; } boolean allItemsNull = true; double minimum = 0.0; double maximum = 0.0; int columnCount = dataset.getColumnCount(); for (int row = 0; row < dataset.getRowCount(); row++) { double runningTotal = 0.0; for (int column = 0; column <= columnCount - 1; column++) { Number n = dataset.getValue(row, column); if (n != null) { allItemsNull = false; double value = n.doubleValue(); if (column == columnCount - 1) { runningTotal = value; } else { runningTotal = runningTotal + value; } minimum = Math.min(minimum, runningTotal); maximum = Math.max(maximum, runningTotal); } } } if (!allItemsNull) { return new Range(minimum, maximum); } else { return null; } } }
WaterfallBarRenderer extends BarRenderer { @Override public Range findRangeBounds(CategoryDataset dataset) { if (dataset == null) { return null; } boolean allItemsNull = true; double minimum = 0.0; double maximum = 0.0; int columnCount = dataset.getColumnCount(); for (int row = 0; row < dataset.getRowCount(); row++) { double runningTotal = 0.0; for (int column = 0; column <= columnCount - 1; column++) { Number n = dataset.getValue(row, column); if (n != null) { allItemsNull = false; double value = n.doubleValue(); if (column == columnCount - 1) { runningTotal = value; } else { runningTotal = runningTotal + value; } minimum = Math.min(minimum, runningTotal); maximum = Math.max(maximum, runningTotal); } } } if (!allItemsNull) { return new Range(minimum, maximum); } else { return null; } } WaterfallBarRenderer();  WaterfallBarRenderer(Paint firstBarPaint, Paint positiveBarPaint,
            Paint negativeBarPaint, Paint lastBarPaint); }
WaterfallBarRenderer extends BarRenderer { @Override public Range findRangeBounds(CategoryDataset dataset) { if (dataset == null) { return null; } boolean allItemsNull = true; double minimum = 0.0; double maximum = 0.0; int columnCount = dataset.getColumnCount(); for (int row = 0; row < dataset.getRowCount(); row++) { double runningTotal = 0.0; for (int column = 0; column <= columnCount - 1; column++) { Number n = dataset.getValue(row, column); if (n != null) { allItemsNull = false; double value = n.doubleValue(); if (column == columnCount - 1) { runningTotal = value; } else { runningTotal = runningTotal + value; } minimum = Math.min(minimum, runningTotal); maximum = Math.max(maximum, runningTotal); } } } if (!allItemsNull) { return new Range(minimum, maximum); } else { return null; } } WaterfallBarRenderer();  WaterfallBarRenderer(Paint firstBarPaint, Paint positiveBarPaint,
            Paint negativeBarPaint, Paint lastBarPaint); Paint getFirstBarPaint(); void setFirstBarPaint(Paint paint); Paint getLastBarPaint(); void setLastBarPaint(Paint paint); Paint getPositiveBarPaint(); void setPositiveBarPaint(Paint paint); Paint getNegativeBarPaint(); void setNegativeBarPaint(Paint paint); @Override Range findRangeBounds(CategoryDataset dataset); @Override void drawItem(Graphics2D g2, CategoryItemRendererState state,
            Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis,
            ValueAxis rangeAxis, CategoryDataset dataset, int row, int column,
            int pass); @Override boolean equals(Object obj); }
WaterfallBarRenderer extends BarRenderer { @Override public Range findRangeBounds(CategoryDataset dataset) { if (dataset == null) { return null; } boolean allItemsNull = true; double minimum = 0.0; double maximum = 0.0; int columnCount = dataset.getColumnCount(); for (int row = 0; row < dataset.getRowCount(); row++) { double runningTotal = 0.0; for (int column = 0; column <= columnCount - 1; column++) { Number n = dataset.getValue(row, column); if (n != null) { allItemsNull = false; double value = n.doubleValue(); if (column == columnCount - 1) { runningTotal = value; } else { runningTotal = runningTotal + value; } minimum = Math.min(minimum, runningTotal); maximum = Math.max(maximum, runningTotal); } } } if (!allItemsNull) { return new Range(minimum, maximum); } else { return null; } } WaterfallBarRenderer();  WaterfallBarRenderer(Paint firstBarPaint, Paint positiveBarPaint,
            Paint negativeBarPaint, Paint lastBarPaint); Paint getFirstBarPaint(); void setFirstBarPaint(Paint paint); Paint getLastBarPaint(); void setLastBarPaint(Paint paint); Paint getPositiveBarPaint(); void setPositiveBarPaint(Paint paint); Paint getNegativeBarPaint(); void setNegativeBarPaint(Paint paint); @Override Range findRangeBounds(CategoryDataset dataset); @Override void drawItem(Graphics2D g2, CategoryItemRendererState state,
            Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis,
            ValueAxis rangeAxis, CategoryDataset dataset, int row, int column,
            int pass); @Override boolean equals(Object obj);  }