Example usage for org.jfree.chart.plot PlotRenderingInfo getSubplotCount

List of usage examples for org.jfree.chart.plot PlotRenderingInfo getSubplotCount

Introduction

In this page you can find the example usage for org.jfree.chart.plot PlotRenderingInfo getSubplotCount.

Prototype

public int getSubplotCount() 

Source Link

Document

Returns the number of subplots (possibly zero).

Usage

From source file:de.hs.mannheim.modUro.controller.diagram.fx.ChartCanvas.java

/**
 * Returns the data area (the area inside the axes) for the plot or subplot.
 *
 * @param point  the selection point (for subplot selection).
 *
 * @return The data area./*from   w ww . j  av a 2  s  .  c  o m*/
 */
public Rectangle2D findDataArea(Point2D point) {
    PlotRenderingInfo plotInfo = this.info.getPlotInfo();
    Rectangle2D result;
    if (plotInfo.getSubplotCount() == 0) {
        result = plotInfo.getDataArea();
    } else {
        int subplotIndex = plotInfo.getSubplotIndex(point);
        if (subplotIndex == -1) {
            return null;
        }
        result = plotInfo.getSubplotInfo(subplotIndex).getDataArea();
    }
    return result;
}

From source file:org.gvsig.remotesensing.scatterplot.chart.ScatterPlotDiagram.java

/**
 * Returns the data area (the area inside the axes) for the plot or subplot,
 * with the current scaling applied.//from w w w.  j  a va 2  s  .  c om
 *
 * @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 {
        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;
}

From source file:de.xirp.ui.widgets.custom.XChartComposite.java

/**
 * Returns the data area (the area inside the axes) for the plot
 * or subplot, with the current scaling applied.
 * /*  ww w. j  a va 2 s  .  co m*/
 * @param x
 *            the x-coordinate (for subplot selection).
 * @param y
 *            the y-coordinate (for subplot selection).
 * @return The scaled data area.
 */
public Rectangle getScreenDataArea(int x, int y) {
    PlotRenderingInfo plotInfo = this.info.getPlotInfo();
    Rectangle 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;
}

From source file:com.munch.exchange.ExchangeChartComposite.java

/**
 * Returns the data area (the area inside the axes) for the plot or subplot,
 * with the current scaling applied.//  w w w . j a  v a  2  s. c  om
 *
 * @param x  the x-coordinate (for subplot selection).
 * @param y  the y-coordinate (for subplot selection).
 *
 * @return The scaled data area.
 */
public Rectangle getScreenDataArea(int x, int y) {
    PlotRenderingInfo plotInfo = this.info.getPlotInfo();
    Rectangle 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;
}

From source file:org.mwc.cmap.grideditor.chart.FixedChartComposite.java

/**
 * Returns the data area (the area inside the axes) for the plot or subplot,
 * with the current scaling applied./*from   www  .  j  a va 2  s  .  co  m*/
 * 
 * @param x
 *          the x-coordinate (for subplot selection).
 * @param y
 *          the y-coordinate (for subplot selection).
 * 
 * @return The scaled data area.
 */
public Rectangle getScreenDataArea(final int x, final int y) {
    final PlotRenderingInfo plotInfo = this.info.getPlotInfo();
    Rectangle 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)
        final Point2D selectOrigin = translateScreenToJava2D(new Point(x, y));
        final int subplotIndex = plotInfo.getSubplotIndex(selectOrigin);
        if (subplotIndex == -1) {
            return null;
        }
        result = scale(plotInfo.getSubplotInfo(subplotIndex).getDataArea());
    }
    return result;
}

From source file:com.isti.traceview.common.TraceViewChartPanel.java

/**
 * Returns the data area (the area inside the axes) for the plot or subplot, with the current
 * scaling applied.//from   w w w .j a va 2  s  . com
 * 
 * @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;
}

From source file:com.rapidminer.gui.plotter.charts.AbstractChartPanel.java

/**
 * Returns the data area (the area inside the axes) for the plot or subplot, with the current
 * scaling applied.//from   w  w  w  . j a v  a2s  .c o m
 * 
 * @param x
 *            the x-coordinate (for subplot selection).
 * @param y
 *            the y-coordinate (for subplot selection).
 * 
 * @return The scaled data area.
 */

@Override
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;
}