@Test public void testFindRangeBounds() { HighLowRenderer renderer = new HighLowRenderer(); OHLCDataItem item1 = new OHLCDataItem(new Date(1L), 2.0, 4.0, 1.0, 3.0, 100); OHLCDataset dataset = new DefaultOHLCDataset("S1", new OHLCDataItem[] {item1}); Range range = renderer.findRangeBounds(dataset); assertEquals(new Range(1.0, 4.0), range); OHLCDataItem item2 = new OHLCDataItem(new Date(1L), -1.0, 3.0, -1.0, 3.0, 100); dataset = new DefaultOHLCDataset("S1", new OHLCDataItem[] {item1, item2}); range = renderer.findRangeBounds(dataset); assertEquals(new Range(-1.0, 4.0), range); dataset = new DefaultOHLCDataset("S1", new OHLCDataItem[] {}); range = renderer.findRangeBounds(dataset); assertNull(range); range = renderer.findRangeBounds(null); assertNull(range); }
@Override public Range findRangeBounds(XYDataset dataset) { if (dataset != null) { return DatasetUtilities.findRangeBounds(dataset, true); } else { return null; } }
HighLowRenderer extends AbstractXYItemRenderer implements XYItemRenderer, Cloneable, PublicCloneable, Serializable { @Override public Range findRangeBounds(XYDataset dataset) { if (dataset != null) { return DatasetUtilities.findRangeBounds(dataset, true); } else { return null; } } }
HighLowRenderer extends AbstractXYItemRenderer implements XYItemRenderer, Cloneable, PublicCloneable, Serializable { @Override public Range findRangeBounds(XYDataset dataset) { if (dataset != null) { return DatasetUtilities.findRangeBounds(dataset, true); } else { return null; } } HighLowRenderer(); }
HighLowRenderer extends AbstractXYItemRenderer implements XYItemRenderer, Cloneable, PublicCloneable, Serializable { @Override public Range findRangeBounds(XYDataset dataset) { if (dataset != null) { return DatasetUtilities.findRangeBounds(dataset, true); } else { return null; } } HighLowRenderer(); boolean getDrawOpenTicks(); void setDrawOpenTicks(boolean draw); boolean getDrawCloseTicks(); void setDrawCloseTicks(boolean draw); Paint getOpenTickPaint(); void setOpenTickPaint(Paint paint); Paint getCloseTickPaint(); void setCloseTickPaint(Paint paint); double getTickLength(); void setTickLength(double length); @Override Range findRangeBounds(XYDataset dataset); @Override void drawItem(Graphics2D g2,
                         XYItemRendererState state,
                         Rectangle2D dataArea,
                         PlotRenderingInfo info,
                         XYPlot plot,
                         ValueAxis domainAxis,
                         ValueAxis rangeAxis,
                         XYDataset dataset,
                         int series,
                         int item,
                         CrosshairState crosshairState,
                         int pass); @Override Object clone(); @Override boolean equals(Object obj); }
HighLowRenderer extends AbstractXYItemRenderer implements XYItemRenderer, Cloneable, PublicCloneable, Serializable { @Override public Range findRangeBounds(XYDataset dataset) { if (dataset != null) { return DatasetUtilities.findRangeBounds(dataset, true); } else { return null; } } HighLowRenderer(); boolean getDrawOpenTicks(); void setDrawOpenTicks(boolean draw); boolean getDrawCloseTicks(); void setDrawCloseTicks(boolean draw); Paint getOpenTickPaint(); void setOpenTickPaint(Paint paint); Paint getCloseTickPaint(); void setCloseTickPaint(Paint paint); double getTickLength(); void setTickLength(double length); @Override Range findRangeBounds(XYDataset dataset); @Override void drawItem(Graphics2D g2,
                         XYItemRendererState state,
                         Rectangle2D dataArea,
                         PlotRenderingInfo info,
                         XYPlot plot,
                         ValueAxis domainAxis,
                         ValueAxis rangeAxis,
                         XYDataset dataset,
                         int series,
                         int item,
                         CrosshairState crosshairState,
                         int pass); @Override Object clone(); @Override boolean equals(Object obj);  }