Java Code Examples for org.jfree.chart.plot.XYPlot#getDomainTickBandPaint()
The following examples show how to use
org.jfree.chart.plot.XYPlot#getDomainTickBandPaint() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractXYItemRenderer.java From openstock with GNU General Public License v3.0 | 6 votes |
/** * Fills a band between two values on the axis. This can be used to color * bands between the grid lines. * * @param g2 the graphics device. * @param plot the plot. * @param axis the domain axis. * @param dataArea the data area. * @param start the start value. * @param end the end value. */ @Override public void fillDomainGridBand(Graphics2D g2, XYPlot plot, ValueAxis axis, Rectangle2D dataArea, double start, double end) { double x1 = axis.valueToJava2D(start, dataArea, plot.getDomainAxisEdge()); double x2 = axis.valueToJava2D(end, dataArea, plot.getDomainAxisEdge()); Rectangle2D band; if (plot.getOrientation() == PlotOrientation.VERTICAL) { band = new Rectangle2D.Double(Math.min(x1, x2), dataArea.getMinY(), Math.abs(x2 - x1), dataArea.getHeight()); } else { band = new Rectangle2D.Double(dataArea.getMinX(), Math.min(x1, x2), dataArea.getWidth(), Math.abs(x2 - x1)); } Paint paint = plot.getDomainTickBandPaint(); if (paint != null) { g2.setPaint(paint); g2.fill(band); } }
Example 2
Source File: AbstractXYItemRenderer.java From ccu-historian with GNU General Public License v3.0 | 6 votes |
/** * Fills a band between two values on the axis. This can be used to color * bands between the grid lines. * * @param g2 the graphics device. * @param plot the plot. * @param axis the domain axis. * @param dataArea the data area. * @param start the start value. * @param end the end value. */ @Override public void fillDomainGridBand(Graphics2D g2, XYPlot plot, ValueAxis axis, Rectangle2D dataArea, double start, double end) { double x1 = axis.valueToJava2D(start, dataArea, plot.getDomainAxisEdge()); double x2 = axis.valueToJava2D(end, dataArea, plot.getDomainAxisEdge()); Rectangle2D band; if (plot.getOrientation() == PlotOrientation.VERTICAL) { band = new Rectangle2D.Double(Math.min(x1, x2), dataArea.getMinY(), Math.abs(x2 - x1), dataArea.getHeight()); } else { band = new Rectangle2D.Double(dataArea.getMinX(), Math.min(x1, x2), dataArea.getWidth(), Math.abs(x2 - x1)); } Paint paint = plot.getDomainTickBandPaint(); if (paint != null) { g2.setPaint(paint); g2.fill(band); } }
Example 3
Source File: AbstractXYItemRenderer.java From SIMVA-SoS with Apache License 2.0 | 6 votes |
/** * Fills a band between two values on the axis. This can be used to color * bands between the grid lines. * * @param g2 the graphics device. * @param plot the plot. * @param axis the domain axis. * @param dataArea the data area. * @param start the start value. * @param end the end value. */ @Override public void fillDomainGridBand(Graphics2D g2, XYPlot plot, ValueAxis axis, Rectangle2D dataArea, double start, double end) { double x1 = axis.valueToJava2D(start, dataArea, plot.getDomainAxisEdge()); double x2 = axis.valueToJava2D(end, dataArea, plot.getDomainAxisEdge()); Rectangle2D band; if (plot.getOrientation() == PlotOrientation.VERTICAL) { band = new Rectangle2D.Double(Math.min(x1, x2), dataArea.getMinY(), Math.abs(x2 - x1), dataArea.getHeight()); } else { band = new Rectangle2D.Double(dataArea.getMinX(), Math.min(x1, x2), dataArea.getWidth(), Math.abs(x2 - x1)); } Paint paint = plot.getDomainTickBandPaint(); if (paint != null) { g2.setPaint(paint); g2.fill(band); } }
Example 4
Source File: AbstractXYItemRenderer.java From ECG-Viewer with GNU General Public License v2.0 | 6 votes |
/** * Fills a band between two values on the axis. This can be used to color * bands between the grid lines. * * @param g2 the graphics device. * @param plot the plot. * @param axis the domain axis. * @param dataArea the data area. * @param start the start value. * @param end the end value. */ @Override public void fillDomainGridBand(Graphics2D g2, XYPlot plot, ValueAxis axis, Rectangle2D dataArea, double start, double end) { double x1 = axis.valueToJava2D(start, dataArea, plot.getDomainAxisEdge()); double x2 = axis.valueToJava2D(end, dataArea, plot.getDomainAxisEdge()); Rectangle2D band; if (plot.getOrientation() == PlotOrientation.VERTICAL) { band = new Rectangle2D.Double(Math.min(x1, x2), dataArea.getMinY(), Math.abs(x2 - x1), dataArea.getHeight()); } else { band = new Rectangle2D.Double(dataArea.getMinX(), Math.min(x1, x2), dataArea.getWidth(), Math.abs(x2 - x1)); } Paint paint = plot.getDomainTickBandPaint(); if (paint != null) { g2.setPaint(paint); g2.fill(band); } }
Example 5
Source File: AbstractXYItemRenderer.java From astor with GNU General Public License v2.0 | 6 votes |
/** * Fills a band between two values on the axis. This can be used to color * bands between the grid lines. * * @param g2 the graphics device. * @param plot the plot. * @param axis the domain axis. * @param dataArea the data area. * @param start the start value. * @param end the end value. */ public void fillDomainGridBand(Graphics2D g2, XYPlot plot, ValueAxis axis, Rectangle2D dataArea, double start, double end) { double x1 = axis.valueToJava2D(start, dataArea, plot.getDomainAxisEdge()); double x2 = axis.valueToJava2D(end, dataArea, plot.getDomainAxisEdge()); Rectangle2D band; if (plot.getOrientation() == PlotOrientation.VERTICAL) { band = new Rectangle2D.Double(Math.min(x1, x2), dataArea.getMinY(), Math.abs(x2 - x1), dataArea.getWidth()); } else { band = new Rectangle2D.Double(dataArea.getMinX(), Math.min(x1, x2), dataArea.getWidth(), Math.abs(x2 - x1)); } Paint paint = plot.getDomainTickBandPaint(); if (paint != null) { g2.setPaint(paint); g2.fill(band); } }
Example 6
Source File: AbstractXYItemRenderer.java From astor with GNU General Public License v2.0 | 6 votes |
/** * Fills a band between two values on the axis. This can be used to color * bands between the grid lines. * * @param g2 the graphics device. * @param plot the plot. * @param axis the domain axis. * @param dataArea the data area. * @param start the start value. * @param end the end value. */ public void fillDomainGridBand(Graphics2D g2, XYPlot plot, ValueAxis axis, Rectangle2D dataArea, double start, double end) { double x1 = axis.valueToJava2D(start, dataArea, plot.getDomainAxisEdge()); double x2 = axis.valueToJava2D(end, dataArea, plot.getDomainAxisEdge()); Rectangle2D band; if (plot.getOrientation() == PlotOrientation.VERTICAL) { band = new Rectangle2D.Double(Math.min(x1, x2), dataArea.getMinY(), Math.abs(x2 - x1), dataArea.getWidth()); } else { band = new Rectangle2D.Double(dataArea.getMinX(), Math.min(x1, x2), dataArea.getWidth(), Math.abs(x2 - x1)); } Paint paint = plot.getDomainTickBandPaint(); if (paint != null) { g2.setPaint(paint); g2.fill(band); } }
Example 7
Source File: AbstractXYItemRenderer.java From opensim-gui with Apache License 2.0 | 6 votes |
/** * Fills a band between two values on the axis. This can be used to color * bands between the grid lines. * * @param g2 the graphics device. * @param plot the plot. * @param axis the domain axis. * @param dataArea the data area. * @param start the start value. * @param end the end value. */ public void fillDomainGridBand(Graphics2D g2, XYPlot plot, ValueAxis axis, Rectangle2D dataArea, double start, double end) { double x1 = axis.valueToJava2D(start, dataArea, plot.getDomainAxisEdge()); double x2 = axis.valueToJava2D(end, dataArea, plot.getDomainAxisEdge()); // TODO: need to change the next line to take account of plot // orientation... Rectangle2D band = new Rectangle2D.Double(x1, dataArea.getMinY(), x2 - x1, dataArea.getMaxY() - dataArea.getMinY()); Paint paint = plot.getDomainTickBandPaint(); if (paint != null) { g2.setPaint(paint); g2.fill(band); } }
Example 8
Source File: AbstractXYItemRenderer.java From buffer_bci with GNU General Public License v3.0 | 6 votes |
/** * Fills a band between two values on the axis. This can be used to color * bands between the grid lines. * * @param g2 the graphics device. * @param plot the plot. * @param axis the domain axis. * @param dataArea the data area. * @param start the start value. * @param end the end value. */ @Override public void fillDomainGridBand(Graphics2D g2, XYPlot plot, ValueAxis axis, Rectangle2D dataArea, double start, double end) { double x1 = axis.valueToJava2D(start, dataArea, plot.getDomainAxisEdge()); double x2 = axis.valueToJava2D(end, dataArea, plot.getDomainAxisEdge()); Rectangle2D band; if (plot.getOrientation() == PlotOrientation.VERTICAL) { band = new Rectangle2D.Double(Math.min(x1, x2), dataArea.getMinY(), Math.abs(x2 - x1), dataArea.getHeight()); } else { band = new Rectangle2D.Double(dataArea.getMinX(), Math.min(x1, x2), dataArea.getWidth(), Math.abs(x2 - x1)); } Paint paint = plot.getDomainTickBandPaint(); if (paint != null) { g2.setPaint(paint); g2.fill(band); } }
Example 9
Source File: AbstractXYItemRenderer.java From buffer_bci with GNU General Public License v3.0 | 6 votes |
/** * Fills a band between two values on the axis. This can be used to color * bands between the grid lines. * * @param g2 the graphics device. * @param plot the plot. * @param axis the domain axis. * @param dataArea the data area. * @param start the start value. * @param end the end value. */ @Override public void fillDomainGridBand(Graphics2D g2, XYPlot plot, ValueAxis axis, Rectangle2D dataArea, double start, double end) { double x1 = axis.valueToJava2D(start, dataArea, plot.getDomainAxisEdge()); double x2 = axis.valueToJava2D(end, dataArea, plot.getDomainAxisEdge()); Rectangle2D band; if (plot.getOrientation() == PlotOrientation.VERTICAL) { band = new Rectangle2D.Double(Math.min(x1, x2), dataArea.getMinY(), Math.abs(x2 - x1), dataArea.getHeight()); } else { band = new Rectangle2D.Double(dataArea.getMinX(), Math.min(x1, x2), dataArea.getWidth(), Math.abs(x2 - x1)); } Paint paint = plot.getDomainTickBandPaint(); if (paint != null) { g2.setPaint(paint); g2.fill(band); } }