Package org.jfree.chart.plot

Examples of org.jfree.chart.plot.Plot


    * @param x the x coordinate (in screen coordinates).
    * @param y the y-coordinate (in screen coordinates).
    */
   public void zoomOutDomain(double x, double y)
   {
      Plot plot = this.chart.getPlot();
      if (plot instanceof Zoomable)
      {
         // here we tweak the notify flag on the plot so that only
         // one notification happens even though we update multiple
         // axes...
         boolean savedNotify = plot.isNotify();
         plot.setNotify(false);
         Zoomable z = (Zoomable) plot;
         z.zoomDomainAxes(this.zoomOutFactor, this.info.getPlotInfo(),
                 translateScreenToJava2D(new Point((int) x, (int) y)),
                 this.zoomAroundAnchor);
         plot.setNotify(savedNotify);
      }
   }
View Full Code Here


    * @param x the x coordinate (in screen coordinates).
    * @param y the y-coordinate (in screen coordinates).
    */
   public void zoomOutRange(double x, double y)
   {
      Plot plot = this.chart.getPlot();
      if (plot instanceof Zoomable)
      {
         // here we tweak the notify flag on the plot so that only
         // one notification happens even though we update multiple
         // axes...
         boolean savedNotify = plot.isNotify();
         plot.setNotify(false);
         Zoomable z = (Zoomable) plot;
         z.zoomRangeAxes(this.zoomOutFactor, this.info.getPlotInfo(),
                 translateScreenToJava2D(new Point((int) x, (int) y)),
                 this.zoomAroundAnchor);
         plot.setNotify(savedNotify);
      }
   }
View Full Code Here

         double vLower = (scaledDataArea.getMaxY() - selection.getMaxY())
                 / scaledDataArea.getHeight();
         double vUpper = (scaledDataArea.getMaxY() - selection.getMinY())
                 / scaledDataArea.getHeight();

         Plot p = this.chart.getPlot();
         if (p instanceof Zoomable)
         {
            // here we tweak the notify flag on the plot so that only
            // one notification happens even though we update multiple
            // axes...
            boolean savedNotify = p.isNotify();
            p.setNotify(false);
            Zoomable z = (Zoomable) p;
            if (z.getOrientation() == PlotOrientation.HORIZONTAL)
            {
               z.zoomDomainAxes(vLower, vUpper, plotInfo, selectOrigin);
               z.zoomRangeAxes(hLower, hUpper, plotInfo, selectOrigin);
            }
            else
            {
               z.zoomDomainAxes(hLower, hUpper, plotInfo, selectOrigin);
               z.zoomRangeAxes(vLower, vUpper, plotInfo, selectOrigin);
            }
            p.setNotify(savedNotify);
         }

      }

   }
View Full Code Here

   /**
    * Restores the auto-range calculation on both axes.
    */
   public void restoreAutoBounds()
   {
      Plot plot = this.chart.getPlot();
      if (plot == null)
      {
         return;
      }
      // here we tweak the notify flag on the plot so that only
      // one notification happens even though we update multiple
      // axes...
      boolean savedNotify = plot.isNotify();
      plot.setNotify(false);
      restoreAutoDomainBounds();
      restoreAutoRangeBounds();
      plot.setNotify(savedNotify);
   }
View Full Code Here

   /**
    * Restores the auto-range calculation on the domain axis.
    */
   public void restoreAutoDomainBounds()
   {
      Plot plot = this.chart.getPlot();
      if (plot instanceof Zoomable)
      {
         Zoomable z = (Zoomable) plot;
         // here we tweak the notify flag on the plot so that only
         // one notification happens even though we update multiple
         // axes...
         boolean savedNotify = plot.isNotify();
         plot.setNotify(false);
         // we need to guard against this.zoomPoint being null
         Point2D zp = (this.zoomPoint != null
                 ? this.zoomPoint : new Point());
         z.zoomDomainAxes(0.0, this.info.getPlotInfo(), zp);
         plot.setNotify(savedNotify);
      }
   }
View Full Code Here

   /**
    * Restores the auto-range calculation on the range axis.
    */
   public void restoreAutoRangeBounds()
   {
      Plot plot = this.chart.getPlot();
      if (plot instanceof Zoomable)
      {
         Zoomable z = (Zoomable) plot;
         // here we tweak the notify flag on the plot so that only
         // one notification happens even though we update multiple
         // axes...
         boolean savedNotify = plot.isNotify();
         plot.setNotify(false);
         // we need to guard against this.zoomPoint being null
         Point2D zp = (this.zoomPoint != null
                 ? this.zoomPoint : new Point());
         z.zoomRangeAxes(0.0, this.info.getPlotInfo(), zp);
         plot.setNotify(savedNotify);
      }
   }
View Full Code Here

      // go through each zoom menu item and decide whether or not to
      // enable it...
      boolean isDomainZoomable = false;
      boolean isRangeZoomable = false;
      Plot plot = (this.chart != null ? this.chart.getPlot() : null);
      if (plot instanceof Zoomable)
      {
         Zoomable z = (Zoomable) plot;
         isDomainZoomable = z.isDomainZoomable();
         isRangeZoomable = z.isRangeZoomable();
View Full Code Here

    public void mouseWheelMoved(MouseWheelEvent e) {
        JFreeChart chart = this.chartPanel.getChart();
        if (chart == null) {
            return;
        }
        Plot plot = chart.getPlot();
        if (plot instanceof Zoomable) {
            Zoomable zoomable = (Zoomable) plot;
            handleZoomable(zoomable, e);
        }
        else if (plot instanceof PiePlot) {
View Full Code Here

        Point2D p = this.chartPanel.translateScreenToJava2D(e.getPoint());
        if (!pinfo.getDataArea().contains(p)) {
            return;
        }

        Plot plot = (Plot) zoomable;
        // do not notify while zooming each axis
        boolean notifyState = plot.isNotify();
        plot.setNotify(false);
        int clicks = e.getWheelRotation();
        double zf = 1.0 + this.zoomFactor;
        if (clicks < 0) {
            zf = 1.0 / zf;
        }
        if (chartPanel.isDomainZoomable()) {
            zoomable.zoomDomainAxes(zf, pinfo, p, true);
        }
        if (chartPanel.isRangeZoomable()) {
            zoomable.zoomRangeAxes(zf, pinfo, p, true);
        }
        plot.setNotify(notifyState)// this generates the change event too
    }
View Full Code Here

        }

        // calculate the adjusted data area taking into account the 3D effect...
        double xOffset = 0.0;
        double yOffset = 0.0;
        Plot plot = getPlot();
        if (plot instanceof CategoryPlot) {
            CategoryPlot cp = (CategoryPlot) plot;
            CategoryItemRenderer r = cp.getRenderer();
            if (r instanceof Effect3D) {
                Effect3D e3D = (Effect3D) r;
View Full Code Here

TOP

Related Classes of org.jfree.chart.plot.Plot

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.