use of org.jfree.chart.axis.ValueTick in project SIMVA-SoS by SESoS.
the class FastScatterPlot method drawDomainGridlines.
/**
* Draws the gridlines for the plot, if they are visible.
*
* @param g2 the graphics device.
* @param dataArea the data area.
* @param ticks the ticks.
*/
protected void drawDomainGridlines(Graphics2D g2, Rectangle2D dataArea, List ticks) {
if (!isDomainGridlinesVisible()) {
return;
}
Object saved = g2.getRenderingHint(RenderingHints.KEY_STROKE_CONTROL);
g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE);
Iterator iterator = ticks.iterator();
while (iterator.hasNext()) {
ValueTick tick = (ValueTick) iterator.next();
double v = this.domainAxis.valueToJava2D(tick.getValue(), dataArea, RectangleEdge.BOTTOM);
Line2D line = new Line2D.Double(v, dataArea.getMinY(), v, dataArea.getMaxY());
g2.setPaint(getDomainGridlinePaint());
g2.setStroke(getDomainGridlineStroke());
g2.draw(line);
}
g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, saved);
}
use of org.jfree.chart.axis.ValueTick in project SIMVA-SoS by SESoS.
the class XYPlot method drawRangeTickBands.
/**
* Draws the range tick bands, if any.
*
* @param g2 the graphics device.
* @param dataArea the data area.
* @param ticks the ticks.
*
* @see #setRangeTickBandPaint(Paint)
*/
public void drawRangeTickBands(Graphics2D g2, Rectangle2D dataArea, List ticks) {
Paint bandPaint = getRangeTickBandPaint();
if (bandPaint != null) {
boolean fillBand = false;
ValueAxis axis = getRangeAxis();
double previous = axis.getLowerBound();
Iterator iterator = ticks.iterator();
while (iterator.hasNext()) {
ValueTick tick = (ValueTick) iterator.next();
double current = tick.getValue();
if (fillBand) {
getRenderer().fillRangeGridBand(g2, this, axis, dataArea, previous, current);
}
previous = current;
fillBand = !fillBand;
}
double end = axis.getUpperBound();
if (fillBand) {
getRenderer().fillRangeGridBand(g2, this, axis, dataArea, previous, end);
}
}
}
use of org.jfree.chart.axis.ValueTick in project SIMVA-SoS by SESoS.
the class XYPlot method drawDomainTickBands.
/**
* Draws the domain tick bands, if any.
*
* @param g2 the graphics device.
* @param dataArea the data area.
* @param ticks the ticks.
*
* @see #setDomainTickBandPaint(Paint)
*/
public void drawDomainTickBands(Graphics2D g2, Rectangle2D dataArea, List ticks) {
Paint bandPaint = getDomainTickBandPaint();
if (bandPaint != null) {
boolean fillBand = false;
ValueAxis xAxis = getDomainAxis();
double previous = xAxis.getLowerBound();
Iterator iterator = ticks.iterator();
while (iterator.hasNext()) {
ValueTick tick = (ValueTick) iterator.next();
double current = tick.getValue();
if (fillBand) {
getRenderer().fillDomainGridBand(g2, this, xAxis, dataArea, previous, current);
}
previous = current;
fillBand = !fillBand;
}
double end = xAxis.getUpperBound();
if (fillBand) {
getRenderer().fillDomainGridBand(g2, this, xAxis, dataArea, previous, end);
}
}
}
Aggregations