/**
* Returns a collection of legend items for the plot.
*
* @return The legend items.
*/
public LegendItemCollection getLegendItems() {
LegendItemCollection result = getFixedLegendItems();
if (result == null) {
result = new LegendItemCollection();
if (this.subplots != null) {
Iterator iterator = this.subplots.iterator();
while (iterator.hasNext()) {
XYPlot plot = (XYPlot) iterator.next();
LegendItemCollection more = plot.getLegendItems();
result.addAll(more);
}
}
}
return result;
}
/**
* Multiplies the range on the domain axis/axes by the specified factor.
*
* @param factor the zoom factor.
* @param info the plot rendering info (<code>null</code> not permitted).
* @param source the source point (<code>null</code> not permitted).
*/
/**
* Multiplies the range on the range axis/axes by the specified factor.
*
* @param factor the zoom factor.
* @param info the plot rendering info (<code>null</code> not permitted).
* @param source the source point (<code>null</code> not permitted).
*/
public void [[#variable18b7d560]](double factor, PlotRenderingInfo info, Point2D source) {
[[#variable18b7d560]](factor, info, source, false);
}
/**
* Multiplies the range on the domain axis/axes by the specified factor.
*
* @param factor the zoom factor.
* @param info the plot rendering info (<code>null</code> not permitted).
* @param source the source point (<code>null</code> not permitted).
* @param useAnchor zoom about the anchor point?
*/
/**
* Multiplies the range on the range axis/axes by the specified factor.
*
* @param factor the zoom factor.
* @param state the plot state.
* @param source the source point (in Java2D coordinates).
* @param useAnchor use source point as zoom anchor?
*/
public void [[#variable18b7d560]](double factor, PlotRenderingInfo [[#variable18b7d620]], Point2D source, boolean useAnchor) {
// delegate 'info' and 'source' argument checks...
// delegate 'state' and 'source' argument checks...
XYPlot subplot = findSubplot( [[#variable18b7d620]], source);
if (subplot != null) {
subplot. [[#variable18b7d560]](factor, [[#variable18b7d620]], source, useAnchor);
}
else {
// if the source point doesn't fall within a subplot, we do the
// zoom on all subplots...
Iterator iterator = getSubplots().iterator();
while (iterator.hasNext()) {
subplot = (XYPlot) iterator.next();
subplot. [[#variable18b7d560]](factor, [[#variable18b7d620]], source, useAnchor);
}
}
}
/**
* Zooms in on the domain axes.
*
* @param lowerPercent the lower bound.
* @param upperPercent the upper bound.
* @param info the plot rendering info (<code>null</code> not permitted).
* @param source the source point (<code>null</code> not permitted).
*/
/**
* Zooms in on the range axes.
*
* @param lowerPercent the lower bound.
* @param upperPercent the upper bound.
* @param info the plot rendering info (<code>null</code> not permitted).
* @param source the source point (<code>null</code> not permitted).
*/
public void [[#variable18b7d560]](double lowerPercent, double upperPercent, PlotRenderingInfo info, Point2D source) {
// delegate 'info' and 'source' argument checks...
XYPlot subplot = findSubplot(info, source);
if (subplot != null) {
subplot. [[#variable18b7d560]](lowerPercent, upperPercent, info, source);
}
else {
// if the source point doesn't fall within a subplot, we do the
// zoom on all subplots...
Iterator iterator = getSubplots().iterator();
while (iterator.hasNext()) {
subplot = (XYPlot) iterator.next();
subplot. [[#variable18b7d560]](lowerPercent, upperPercent, info, source);
}
}
}
/**
* Returns the subplot (if any) that contains the (x, y) point (specified
* in Java2D space).
*
* @param info the chart rendering info (<code>null</code> not permitted).
* @param source the source point (<code>null</code> not permitted).
*
* @return A subplot (possibly <code>null</code>).
*/
public XYPlot findSubplot(PlotRenderingInfo info, Point2D source) {
if (info == null) {
throw new IllegalArgumentException("Null \'info\' argument.");
}
if (source == null) {
throw new IllegalArgumentException("Null \'source\' argument.");
}
XYPlot result = null;
int subplotIndex = info.getSubplotIndex(source);
if (subplotIndex >= 0) {
result = (XYPlot) this.subplots.get(subplotIndex);
}
return result;
}
/**
* Sets the item renderer FOR ALL SUBPLOTS. Registered listeners are
* notified that the plot has been modified.
* <P>
* Note: usually you will want to set the renderer independently for each
* subplot, which is NOT what this method does.
*
* @param renderer the new renderer.
*/
public void setRenderer(XYItemRenderer renderer) {
super.setRenderer(renderer); // not strictly necessary, since the
// renderer set for the
// parent plot is not used
Iterator iterator = this.subplots.iterator();
while (iterator.hasNext()) {
XYPlot plot = (XYPlot) iterator.next();
plot.setRenderer(renderer);
}
}
|