use of org.jfree.chart.axis.ValueAxis in project SIMVA-SoS by SESoS.
the class StandardChartTheme method applyToThermometerPlot.
/**
* Applies the attributes for this theme to a {@link ThermometerPlot}.
* This method is called from the {@link #applyToPlot(Plot)} method.
*
* @param plot the plot.
*/
protected void applyToThermometerPlot(ThermometerPlot plot) {
plot.setValueFont(this.largeFont);
plot.setThermometerPaint(this.thermometerPaint);
ValueAxis axis = plot.getRangeAxis();
if (axis != null) {
applyToValueAxis(axis);
}
}
use of org.jfree.chart.axis.ValueAxis in project SIMVA-SoS by SESoS.
the class CategoryPlot method drawRangeGridlines.
/**
* Draws the range gridlines for the plot, if they are visible.
*
* @param g2 the graphics device ({@code null} not permitted).
* @param dataArea the area inside the axes ({@code null} not permitted).
* @param ticks the ticks.
*
* @see #drawDomainGridlines(Graphics2D, Rectangle2D)
*/
protected void drawRangeGridlines(Graphics2D g2, Rectangle2D dataArea, List ticks) {
// draw the range grid lines, if any...
if (!isRangeGridlinesVisible() && !isRangeMinorGridlinesVisible()) {
return;
}
// no axis, no gridlines...
ValueAxis axis = getRangeAxis();
if (axis == null) {
return;
}
// no renderer, no gridlines...
CategoryItemRenderer r = getRenderer();
if (r == null) {
return;
}
Stroke gridStroke = null;
Paint gridPaint = null;
boolean paintLine;
Iterator iterator = ticks.iterator();
while (iterator.hasNext()) {
paintLine = false;
ValueTick tick = (ValueTick) iterator.next();
if ((tick.getTickType() == TickType.MINOR) && isRangeMinorGridlinesVisible()) {
gridStroke = getRangeMinorGridlineStroke();
gridPaint = getRangeMinorGridlinePaint();
paintLine = true;
} else if ((tick.getTickType() == TickType.MAJOR) && isRangeGridlinesVisible()) {
gridStroke = getRangeGridlineStroke();
gridPaint = getRangeGridlinePaint();
paintLine = true;
}
if (((tick.getValue() != 0.0) || !isRangeZeroBaselineVisible()) && paintLine) {
// interface...
if (r instanceof AbstractCategoryItemRenderer) {
AbstractCategoryItemRenderer aci = (AbstractCategoryItemRenderer) r;
aci.drawRangeLine(g2, this, axis, dataArea, tick.getValue(), gridPaint, gridStroke);
} else {
// we'll have to use the method in the interface, but
// this doesn't have the paint and stroke settings...
r.drawRangeGridline(g2, this, axis, dataArea, tick.getValue());
}
}
}
}
use of org.jfree.chart.axis.ValueAxis in project SIMVA-SoS by SESoS.
the class CategoryPlot method panRangeAxes.
/**
* Pans the range axes by the specified percentage.
*
* @param percent the distance to pan (as a percentage of the axis length).
* @param info the plot info
* @param source the source point where the pan action started.
*
* @since 1.0.13
*/
@Override
public void panRangeAxes(double percent, PlotRenderingInfo info, Point2D source) {
if (!isRangePannable()) {
return;
}
for (ValueAxis axis : this.rangeAxes.values()) {
if (axis == null) {
continue;
}
double length = axis.getRange().getLength();
double adj = percent * length;
if (axis.isInverted()) {
adj = -adj;
}
axis.setRange(axis.getLowerBound() + adj, axis.getUpperBound() + adj);
}
}
use of org.jfree.chart.axis.ValueAxis in project SIMVA-SoS by SESoS.
the class CategoryPlot method setRangeAxis.
/**
* Sets a range axis and, if requested, sends a {@link PlotChangeEvent} to
* all registered listeners.
*
* @param index the axis index.
* @param axis the axis.
* @param notify notify listeners?
*/
public void setRangeAxis(int index, ValueAxis axis, boolean notify) {
ValueAxis existing = this.rangeAxes.get(index);
if (existing != null) {
existing.removeChangeListener(this);
}
if (axis != null) {
axis.setPlot(this);
}
this.rangeAxes.put(index, axis);
if (axis != null) {
axis.configure();
axis.addChangeListener(this);
}
if (notify) {
fireChangeEvent();
}
}
use of org.jfree.chart.axis.ValueAxis in project SIMVA-SoS by SESoS.
the class CategoryPlot method drawRangeMarkers.
/**
* Draws the range markers (if any) for an axis and layer. This method is
* typically called from within the draw() method.
*
* @param g2 the graphics device.
* @param dataArea the data area.
* @param index the renderer index.
* @param layer the layer (foreground or background).
*
* @see #drawDomainMarkers(Graphics2D, Rectangle2D, int, Layer)
*/
protected void drawRangeMarkers(Graphics2D g2, Rectangle2D dataArea, int index, Layer layer) {
CategoryItemRenderer r = getRenderer(index);
if (r == null) {
return;
}
Collection markers = getRangeMarkers(index, layer);
ValueAxis axis = getRangeAxisForDataset(index);
if (markers != null && axis != null) {
Iterator iterator = markers.iterator();
while (iterator.hasNext()) {
Marker marker = (Marker) iterator.next();
r.drawRangeMarker(g2, this, axis, marker, dataArea);
}
}
}
Aggregations