/** * 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 CategoryPlot findSubplot(PlotRenderingInfo info, Point2D source) { if (info == null) { throw new IllegalArgumentException("Null 'info' argument."); } if (source == null) { throw new IllegalArgumentException("Null 'source' argument."); } CategoryPlot result = null; int subplotIndex = info.getSubplotIndex(source); if (subplotIndex >= 0) { result = (CategoryPlot) this.subplots.get(subplotIndex); } return result; }
/** * 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; }
/** * 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; }
/** * Returns the subplot (if any) that contains the (x, y) point (specified * in Java2D space). * * @param info the chart rendering info ({@code null} not permitted). * @param source the source point ({@code null} not permitted). * * @return A subplot (possibly {@code null}). */ public XYPlot findSubplot(PlotRenderingInfo info, Point2D source) { Args.nullNotPermitted(info, "info"); Args.nullNotPermitted(source, "source"); XYPlot result = null; int subplotIndex = info.getSubplotIndex(source); if (subplotIndex >= 0) { result = (XYPlot) this.subplots.get(subplotIndex); } return result; }
/** * Returns the subplot (if any) that contains the (x, y) point (specified * in Java2D space). * * @param info the chart rendering info ({@code null} not permitted). * @param source the source point ({@code null} not permitted). * * @return A subplot (possibly {@code null}). */ public CategoryPlot findSubplot(PlotRenderingInfo info, Point2D source) { Args.nullNotPermitted(info, "info"); Args.nullNotPermitted(source, "source"); CategoryPlot result = null; int subplotIndex = info.getSubplotIndex(source); if (subplotIndex >= 0) { result = (CategoryPlot) this.subplots.get(subplotIndex); } return result; }
/** * Returns the subplot (if any) that contains the (x, y) point (specified * in Java2D space). * * @param info the chart rendering info ({@code null} not permitted). * @param source the source point ({@code null} not permitted). * * @return A subplot (possibly {@code null}). */ public XYPlot findSubplot(PlotRenderingInfo info, Point2D source) { Args.nullNotPermitted(info, "info"); Args.nullNotPermitted(source, "source"); XYPlot result = null; int subplotIndex = info.getSubplotIndex(source); if (subplotIndex >= 0) { result = (XYPlot) this.subplots.get(subplotIndex); } return result; }
/** * Returns the data area (the area inside the axes) for the plot or subplot, * with the current scaling applied. * * @param x the x-coordinate (for subplot selection). * @param y the y-coordinate (for subplot selection). * * @return The scaled data area. */ public Rectangle2D getScreenDataArea(int x, int y) { PlotRenderingInfo plotInfo = this.info.getPlotInfo(); Rectangle2D result; if (plotInfo.getSubplotCount() == 0) { result = getScreenDataArea(); } else { // get the origin of the zoom selection in the Java2D space used for // drawing the chart (that is, before any scaling to fit the panel) Point2D selectOrigin = translateScreenToJava2D(new Point(x, y)); int subplotIndex = plotInfo.getSubplotIndex(selectOrigin); if (subplotIndex == -1) { return null; } result = scale(plotInfo.getSubplotInfo(subplotIndex).getDataArea()); } return result; }
/** * Returns the data area (the area inside the axes) for the plot or subplot, * with the current scaling applied. * * @param x the x-coordinate (for subplot selection). * @param y the y-coordinate (for subplot selection). * * @return The scaled data area. */ public Rectangle2D getScreenDataArea(int x, int y) { PlotRenderingInfo plotInfo = this.info.getPlotInfo(); Rectangle2D result; if (plotInfo.getSubplotCount() == 0) { result = getScreenDataArea(); } else { // get the origin of the zoom selection in the Java2D space used for // drawing the chart (that is, before any scaling to fit the panel) Point2D selectOrigin = translateScreenToJava2D(new Point(x, y)); int subplotIndex = plotInfo.getSubplotIndex(selectOrigin); if (subplotIndex == -1) { return null; } result = scale(plotInfo.getSubplotInfo(subplotIndex).getDataArea()); } return result; }
info.getSubplotIndex(source)); if (subplotInfo == null) { return;
info.getSubplotIndex(source)); if (subplotInfo == null) { return;