Tabnine Logo
PlotRenderingInfo.getDataArea
Code IndexAdd Tabnine to your IDE (free)

How to use
getDataArea
method
in
org.jfree.chart.plot.PlotRenderingInfo

Best Java code snippets using org.jfree.chart.plot.PlotRenderingInfo.getDataArea (Showing top 20 results out of 315)

origin: org.codehaus.jtstand/jtstand-chart

/**
 * Returns the data area for the chart (the area inside the axes) with the
 * current scaling applied (that is, the area as it appears on screen).
 *
 * @return The scaled data area.
 */
public Rectangle2D getScreenDataArea() {
  Rectangle2D dataArea = this.info.getPlotInfo().getDataArea();
  Insets insets = getInsets();
  double x = dataArea.getX() * this.scaleX + insets.left;
  double y = dataArea.getY() * this.scaleY + insets.top;
  double w = dataArea.getWidth() * this.scaleX;
  double h = dataArea.getHeight() * this.scaleY;
  return new Rectangle2D.Double(x, y, w, h);
}
origin: jfree/jfreechart

/**
 * Returns the data area for the chart (the area inside the axes) with the
 * current scaling applied (that is, the area as it appears on screen).
 *
 * @return The scaled data area.
 */
public Rectangle2D getScreenDataArea() {
  Rectangle2D dataArea = this.info.getPlotInfo().getDataArea();
  Insets insets = getInsets();
  double x = dataArea.getX() * this.scaleX + insets.left;
  double y = dataArea.getY() * this.scaleY + insets.top;
  double w = dataArea.getWidth() * this.scaleX;
  double h = dataArea.getHeight() * this.scaleY;
  return new Rectangle2D.Double(x, y, w, h);
}
origin: jfree/jfreechart

/**
 * Handles a 'click' on the plot by updating the anchor values.
 *
 * @param x  x-coordinate, where the click occurred.
 * @param y  y-coordinate, where the click occurred.
 * @param info  object containing information about the plot dimensions.
 */
@Override
public void handleClick(int x, int y, PlotRenderingInfo info) {
  Rectangle2D dataArea = info.getDataArea();
  if (dataArea.contains(x, y)) {
    for (int i = 0; i < this.subplots.size(); i++) {
      XYPlot subplot = (XYPlot) this.subplots.get(i);
      PlotRenderingInfo subplotInfo = info.getSubplotInfo(i);
      subplot.handleClick(x, y, subplotInfo);
    }
  }
}
origin: org.codehaus.jtstand/jtstand-chart

/**
 * Handles a 'click' on the plot by updating the anchor values.
 *
 * @param x  x-coordinate, where the click occured.
 * @param y  y-coordinate, where the click occured.
 * @param info  object containing information about the plot dimensions.
 */
public void handleClick(int x, int y, PlotRenderingInfo info) {
  Rectangle2D dataArea = info.getDataArea();
  if (dataArea.contains(x, y)) {
    for (int i = 0; i < this.subplots.size(); i++) {
      XYPlot subplot = (XYPlot) this.subplots.get(i);
      PlotRenderingInfo subplotInfo = info.getSubplotInfo(i);
      subplot.handleClick(x, y, subplotInfo);
    }
  }
}
origin: org.codehaus.jtstand/jtstand-chart

/**
 * Handles a 'click' on the plot.
 *
 * @param x  x-coordinate of the click.
 * @param y  y-coordinate of the click.
 * @param info  information about the plot's dimensions.
 *
 */
public void handleClick(int x, int y, PlotRenderingInfo info) {
  Rectangle2D dataArea = info.getDataArea();
  if (dataArea.contains(x, y)) {
    for (int i = 0; i < this.subplots.size(); i++) {
      CategoryPlot subplot = (CategoryPlot) this.subplots.get(i);
      PlotRenderingInfo subplotInfo = info.getSubplotInfo(i);
      subplot.handleClick(x, y, subplotInfo);
    }
  }
}
origin: org.codehaus.jtstand/jtstand-chart

/**
 * Handles a 'click' on the plot by updating the anchor values...
 *
 * @param x  x-coordinate, where the click occured.
 * @param y  y-coordinate, where the click occured.
 * @param info  object containing information about the plot dimensions.
 */
public void handleClick(int x, int y, PlotRenderingInfo info) {
  Rectangle2D dataArea = info.getDataArea();
  if (dataArea.contains(x, y)) {
    for (int i = 0; i < this.subplots.size(); i++) {
      XYPlot subplot = (XYPlot) this.subplots.get(i);
      PlotRenderingInfo subplotInfo = info.getSubplotInfo(i);
      subplot.handleClick(x, y, subplotInfo);
    }
  }
}
origin: jfree/jfreechart

/**
 * Handles a 'click' on the plot.
 *
 * @param x  x-coordinate of the click.
 * @param y  y-coordinate of the click.
 * @param info  information about the plot's dimensions.
 *
 */
@Override
public void handleClick(int x, int y, PlotRenderingInfo info) {
  Rectangle2D dataArea = info.getDataArea();
  if (dataArea.contains(x, y)) {
    for (int i = 0; i < this.subplots.size(); i++) {
      CategoryPlot subplot = (CategoryPlot) this.subplots.get(i);
      PlotRenderingInfo subplotInfo = info.getSubplotInfo(i);
      subplot.handleClick(x, y, subplotInfo);
    }
  }
}
origin: jfree/jfreechart

/**
 * Handles a 'click' on the plot by updating the anchor values...
 *
 * @param x  x-coordinate, where the click occured.
 * @param y  y-coordinate, where the click occured.
 * @param info  object containing information about the plot dimensions.
 */
@Override
public void handleClick(int x, int y, PlotRenderingInfo info) {
  Rectangle2D dataArea = info.getDataArea();
  if (dataArea.contains(x, y)) {
    for (int i = 0; i < this.subplots.size(); i++) {
      XYPlot subplot = (XYPlot) this.subplots.get(i);
      PlotRenderingInfo subplotInfo = info.getSubplotInfo(i);
      subplot.handleClick(x, y, subplotInfo);
    }
  }
}
origin: jfree/jfreechart

/**
 * Handles a 'click' on the plot by updating the anchor value.
 *
 * @param x  x-coordinate of the click.
 * @param y  y-coordinate of the click.
 * @param info  information about the plot's dimensions.
 *
 */
@Override
public void handleClick(int x, int y, PlotRenderingInfo info) {
  Rectangle2D dataArea = info.getDataArea();
  if (dataArea.contains(x, y)) {
    for (int i = 0; i < this.subplots.size(); i++) {
      CategoryPlot subplot = (CategoryPlot) this.subplots.get(i);
      PlotRenderingInfo subplotInfo = info.getSubplotInfo(i);
      subplot.handleClick(x, y, subplotInfo);
    }
  }
}
origin: org.codehaus.jtstand/jtstand-chart

/**
 * Handles a 'click' on the plot by updating the anchor value.
 *
 * @param x  x-coordinate of the click.
 * @param y  y-coordinate of the click.
 * @param info  information about the plot's dimensions.
 *
 */
public void handleClick(int x, int y, PlotRenderingInfo info) {
  Rectangle2D dataArea = info.getDataArea();
  if (dataArea.contains(x, y)) {
    for (int i = 0; i < this.subplots.size(); i++) {
      CategoryPlot subplot = (CategoryPlot) this.subplots.get(i);
      PlotRenderingInfo subplotInfo = info.getSubplotInfo(i);
      subplot.handleClick(x, y, subplotInfo);
    }
  }
}
origin: jfree/jfreechart

/**
 * 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.
 * @param useAnchor  a flag that controls whether or not the source point
 *         is used for the zoom anchor.
 *
 * @since 1.0.7
 */
@Override
public void zoomRangeAxes(double factor, PlotRenderingInfo state,
             Point2D source, boolean useAnchor) {
  double anchorY = this.getRangeAxis().java2DToValue(source.getY(),
      state.getDataArea(), RectangleEdge.LEFT);
  this.rangeAxis.resizeRange(factor, anchorY);
}
origin: org.codehaus.jtstand/jtstand-chart

/**
 * 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.
 * @param useAnchor  a flag that controls whether or not the source point
 *         is used for the zoom anchor.
 *
 * @since 1.0.7
 */
public void zoomRangeAxes(double factor, PlotRenderingInfo state,
             Point2D source, boolean useAnchor) {
  double anchorY = this.getRangeAxis().java2DToValue(source.getY(),
      state.getDataArea(), RectangleEdge.LEFT);
  this.rangeAxis.resizeRange(factor, anchorY);
}
origin: jfree/jfreechart

/**
 * Multiplies the range on the range axis by the specified factor.
 *
 * @param factor  the zoom factor.
 * @param info  the plot rendering info.
 * @param source  the source point (in Java2D space).
 * @param useAnchor  use source point as zoom anchor?
 *
 * @see #zoomDomainAxes(double, PlotRenderingInfo, Point2D, boolean)
 *
 * @since 1.0.7
 */
@Override
public void zoomRangeAxes(double factor, PlotRenderingInfo info,
             Point2D source, boolean useAnchor) {
  if (useAnchor) {
    // get the source coordinate - this plot has always a VERTICAL
    // orientation
    double sourceY = source.getY();
    double anchorY = this.rangeAxis.java2DToValue(sourceY,
        info.getDataArea(), RectangleEdge.LEFT);
    this.rangeAxis.resizeRange2(factor, anchorY);
  }
  else {
    this.rangeAxis.resizeRange(factor);
  }
}
origin: org.codehaus.jtstand/jtstand-chart

/**
 * Multiplies the range on the range axis by the specified factor.
 *
 * @param factor  the zoom factor.
 * @param info  the plot rendering info.
 * @param source  the source point (in Java2D space).
 * @param useAnchor  use source point as zoom anchor?
 *
 * @see #zoomDomainAxes(double, PlotRenderingInfo, Point2D, boolean)
 *
 * @since 1.0.7
 */
public void zoomRangeAxes(double factor, PlotRenderingInfo info,
             Point2D source, boolean useAnchor) {
  if (useAnchor) {
    // get the source coordinate - this plot has always a VERTICAL
    // orientation
    double sourceX = source.getX();
    double anchorX = this.axis.java2DToValue(sourceX,
        info.getDataArea(), RectangleEdge.BOTTOM);
    this.axis.resizeRange(factor, anchorX);
  }
  else {
    this.axis.resizeRange(factor);
  }
}
origin: org.codehaus.jtstand/jtstand-chart

/**
 * Multiplies the range on the domain axis by the specified factor.
 *
 * @param factor  the zoom factor.
 * @param info  the plot rendering info.
 * @param source  the source point (in Java2D space).
 * @param useAnchor  use source point as zoom anchor?
 *
 * @see #zoomRangeAxes(double, PlotRenderingInfo, Point2D, boolean)
 *
 * @since 1.0.7
 */
public void zoomDomainAxes(double factor, PlotRenderingInfo info,
              Point2D source, boolean useAnchor) {
  if (useAnchor) {
    // get the source coordinate - this plot has always a VERTICAL
    // orientation
    double sourceX = source.getX();
    double anchorX = this.domainAxis.java2DToValue(sourceX,
        info.getDataArea(), RectangleEdge.BOTTOM);
    this.domainAxis.resizeRange2(factor, anchorX);
  }
  else {
    this.domainAxis.resizeRange(factor);
  }
}
origin: org.n52.sensorweb/sensorwebclient-api

@Override
public RepresentationResponse producePresentation(DesignOptions options) throws Exception {
  ChartRenderingInfo renderingInfo = new ChartRenderingInfo(new StandardEntityCollection());
  String chartUrl = createChart(options, renderingInfo);
  
  Rectangle2D plotArea = renderingInfo.getPlotInfo().getDataArea();
  for (Axis axis : renderer.getAxisMapping().values()) {
    axis.setMaxY(plotArea.getMaxY());
    axis.setMinY(plotArea.getMinY());
  }
  ImageEntity[] entities = {};
  if (!this.isOverview) {
    LOGGER.debug("Produced EES diagram " + chartUrl);
    entities = createImageEntities(renderingInfo.getEntityCollection());
  } else {
    LOGGER.debug("Produced EES Overview diagram " + chartUrl);
  }
  Bounds chartArea = new Bounds(plotArea.getMinX(), plotArea.getMaxX(), plotArea.getMinY(), plotArea.getMaxY());
  return new EESDataResponse(chartUrl, options, chartArea, entities, renderer.getAxisMapping());
}
origin: jfree/jfreechart

/**
 * Handles a 'click' on the plot by updating the anchor value.
 *
 * @param x  x-coordinate of the click (in Java2D space).
 * @param y  y-coordinate of the click (in Java2D space).
 * @param info  information about the plot's dimensions.
 *
 */
@Override
public void handleClick(int x, int y, PlotRenderingInfo info) {
  Rectangle2D dataArea = info.getDataArea();
  if (dataArea.contains(x, y)) {
    // set the anchor value for the range axis...
    double java2D = 0.0;
    if (this.orientation == PlotOrientation.HORIZONTAL) {
      java2D = x;
    } else if (this.orientation == PlotOrientation.VERTICAL) {
      java2D = y;
    }
    RectangleEdge edge = Plot.resolveRangeAxisLocation(
        getRangeAxisLocation(), this.orientation);
    double value = getRangeAxis().java2DToValue(
        java2D, info.getDataArea(), edge);
    setAnchorValue(value);
    setRangeCrosshairValue(value);
  }
}
origin: jfree/jfreechart

/**
 * Returns the index of the subplot that contains the specified
 * (x, y) point (the "source" point).  The source point will usually
 * come from a mouse click on a {@link org.jfree.chart.ChartPanel},
 * and this method is then used to determine the subplot that
 * contains the source point.
 *
 * @param source  the source point (in Java2D space, {@code null} not
 * permitted).
 *
 * @return The subplot index (or -1 if no subplot contains {@code source}).
 */
public int getSubplotIndex(Point2D source) {
  Args.nullNotPermitted(source, "source");
  int subplotCount = getSubplotCount();
  for (int i = 0; i < subplotCount; i++) {
    PlotRenderingInfo info = getSubplotInfo(i);
    Rectangle2D area = info.getDataArea();
    if (area.contains(source)) {
      return i;
    }
  }
  return -1;
}
origin: jfree/jfreechart

/**
 * 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;
}
origin: cpesch/RouteConverter

  protected String getTooltipAtPoint(Point point) {
    XYPlot plot = (XYPlot) getChart().getPlot();
    PlotRenderingInfo info = getChartRenderingInfo().getPlotInfo();
    double x0 = point.getX();
    double x1 = x0 - 2 * getScaleX();
    double x2 = x0 + 4 * getScaleX();

    ValueAxis domainAxis = plot.getDomainAxis();
    Rectangle2D screenArea = scale(info.getDataArea());
    double tx1 = domainAxis.java2DToValue(x1, screenArea, BOTTOM);
    double tx2 = domainAxis.java2DToValue(x2, screenArea, BOTTOM);

    for (int datasetIndex = 0; datasetIndex < plot.getDatasetCount(); datasetIndex++) {
      XYDataset dataset = plot.getDataset(datasetIndex);
      for (int seriesIndex = 0; seriesIndex < dataset.getSeriesCount(); seriesIndex++) {
        int itemCount = dataset.getItemCount(seriesIndex);
        for (int itemIndex = 0; itemIndex < itemCount; itemIndex++) {
          double xValue = dataset.getXValue(seriesIndex, itemIndex);
          if (tx1 < xValue && xValue < tx2)
            return toolTipGenerator.generateToolTip(dataset, seriesIndex, itemIndex);
        }
      }
    }
    return null;
  }
}
org.jfree.chart.plotPlotRenderingInfogetDataArea

Javadoc

Returns the plot's data area (in Java2D space).

Popular methods of PlotRenderingInfo

  • getOwner
    Returns the owner (as specified in the constructor).
  • addSubplotInfo
    Adds the info for a subplot.
  • <init>
    Creates a new instance.
  • clone
    Returns a clone of this object.
  • getSubplotCount
    Returns the number of subplots (possibly zero).
  • getSubplotIndex
    Returns the index of the subplot that contains the specified (x, y) point (the "source" point). The
  • getSubplotInfo
    Returns the info for a subplot.
  • setDataArea
    Sets the data area.
  • setPlotArea
    Sets the plot area.

Popular in Java

  • Reading from database using SQL prepared statement
  • scheduleAtFixedRate (Timer)
  • putExtra (Intent)
  • setRequestProperty (URLConnection)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now