Package org.jfree.chart.plot

Examples of org.jfree.chart.plot.Plot


  protected void displayPopupMenu(int x, int y) {

    if (getPopupMenu() != null) {

      // go through each zoom menu item and decide whether or not to enable it...
      Plot plot = this.chart.getPlot();
      ValueAxis horizontalAxis = getHorizontalValueAxis(plot);
      boolean isHorizontal = (horizontalAxis != null);
      ValueAxis verticalAxis = getVerticalValueAxis(plot);
      boolean isVertical = (verticalAxis != null);
View Full Code Here


              );
          break;
      }

      // then customise it a little...
      Plot plot = chart.getPlot();
      plot.setForegroundAlpha(0.75f);

      // NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART...

      // set the background color for the chart...
      chart.setBackgroundPaint(new GradientPaint(0, 0, Color.white, 1000, 0, Color.blue));

      if (backgroundFilePath.length() != 0) {
        try {
          Toolkit toolkit = Toolkit.getDefaultToolkit();
          Image image;
          if ((new File(backgroundFilePath)).exists()) {
            image = toolkit.getImage(backgroundFilePath);
          } else {
            image = toolkit.getImage(new URL(backgroundFilePath));
          }
          WaitingImageObserver obs = new WaitingImageObserver(image);
          obs.waitImageLoaded();
          plot.setBackgroundImage(image);
          plot.setBackgroundPaint(Color.white);
          plot.setBackgroundAlpha(0.6f);
          plot.setForegroundAlpha(0.75f);
        } catch (Exception e) {
          Log.log(Log.DEBUG, this, "Cannot find file or URL=" + backgroundFilePath + " ; error=" + e);
          e.printStackTrace();
        }
      }
View Full Code Here

    @Override
    protected void setUp() throws Exception
    {
        super.setUp();

        Plot plot = new CategoryPlot();
        _jFreeChart = new JFreeChart(plot);

        when(_chartingDefinition.getChartTitle()).thenReturn(CHART_TITLE);
        when(_chartingDefinition.getChartSubtitle()).thenReturn(CHART_SUB_TITLE);
        when(_chartingDefinition.getXAxisTitle()).thenReturn(X_TITLE);
View Full Code Here

        // add the new chart
        this.chart = chart;
        if (chart != null) {
            this.chart.addChangeListener(this);
            this.chart.addProgressListener(this);
            Plot plot = chart.getPlot();
            this.domainZoomable = false;
            this.rangeZoomable = false;
            if (plot instanceof Zoomable) {
                Zoomable z = (Zoomable) plot;
                this.domainZoomable = z.isDomainZoomable();
View Full Code Here

     *
     * @param flag  <code>true</code> enables zooming if possible.
     */
    public void setDomainZoomable(boolean flag) {
        if (flag) {
            Plot plot = this.chart.getPlot();
            if (plot instanceof Zoomable) {
                Zoomable z = (Zoomable) plot;
                this.domainZoomable = flag && (z.isDomainZoomable());
            }
        }
View Full Code Here

     *
     * @param flag  <code>true</code> enables zooming.
     */
    public void setRangeZoomable(boolean flag) {
        if (flag) {
            Plot plot = this.chart.getPlot();
            if (plot instanceof Zoomable) {
                Zoomable z = (Zoomable) plot;
                this.rangeZoomable = flag && (z.isRangeZoomable());
            }
        }
View Full Code Here

     *
     * @param event  details of the chart change event.
     */
    public void chartChanged(ChartChangeEvent event) {
        this.refreshBuffer = true;
        Plot plot = this.chart.getPlot();
        if (plot instanceof Zoomable) {
            Zoomable z = (Zoomable) plot;
            this.orientation = z.getOrientation();
        }
        repaint();
View Full Code Here

     */
    public void mousePressed(MouseEvent e) {
        if (this.chart == null) {
            return;
        }
        Plot plot = this.chart.getPlot();
        int mods = e.getModifiers();
        if ((mods & this.panMask) == this.panMask) {
            // can we pan this plot?
            if (plot instanceof Pannable) {
                Pannable pannable = (Pannable) plot;
View Full Code Here

     *
     * @param x  the x value (in screen coordinates).
     * @param y  the y value (in screen coordinates).
     */
    public void zoomInBoth(double x, double y) {
        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);
        zoomInDomain(x, y);
        zoomInRange(x, y);
        plot.setNotify(savedNotify);
    }
View Full Code Here

    /**
     * Rescales the axis to ensure that all data is visible.
     */
    protected void autoAdjustRange() {

        Plot plot = getPlot();
        if (plot == null) {
            return// no plot, no data
        }

        if (plot instanceof ValueAxisPlot) {
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.