Example usage for org.jfree.chart.plot Zoomable isDomainZoomable

List of usage examples for org.jfree.chart.plot Zoomable isDomainZoomable

Introduction

In this page you can find the example usage for org.jfree.chart.plot Zoomable isDomainZoomable.

Prototype

public boolean isDomainZoomable();

Source Link

Document

Returns true if the plot's domain is zoomable, and false otherwise.

Usage

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

/**
 * Sets the chart that is displayed in the panel.
 * /*from   w  w w  .jav a2  s  .c  o  m*/
 * @param chart
 *          the chart (<code>null</code> permitted).
 */
public void setChart(final JFreeChart chart) {
    // stop listening for changes to the existing chart
    if (this.chart != null) {
        this.chart.removeChangeListener(this);
        this.chart.removeProgressListener(this);
    }

    // add the new chart
    this.chart = chart;
    if (chart != null) {
        this.chart.addChangeListener(this);
        this.chart.addProgressListener(this);
        final Plot plot = chart.getPlot();
        this.domainZoomable = false;
        this.rangeZoomable = false;
        if (plot instanceof Zoomable) {
            final Zoomable z = (Zoomable) plot;
            this.domainZoomable = z.isDomainZoomable();
            this.rangeZoomable = z.isRangeZoomable();
            this.orientation = z.getOrientation();
        }
    } else {
        this.domainZoomable = false;
        this.rangeZoomable = false;
    }
    if (this.useBuffer) {
        this.refreshBuffer = true;
    }
}

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

/**
 * The idea is to modify the zooming options depending on the type of chart
 * being displayed by the panel./*from ww  w  .  ja  v  a 2s .co  m*/
 * 
 * @param x
 *          horizontal position of the popup.
 * @param y
 *          vertical position of the popup.
 */
protected void displayPopupMenu(final int x, final int y) {
    if (this.popup != null) {
        // go through each zoom menu item and decide whether or not to
        // enable it...
        final Plot plot = this.chart.getPlot();
        boolean isDomainZoomable = false;
        boolean isRangeZoomable = false;
        if (plot instanceof Zoomable) {
            final Zoomable z = (Zoomable) plot;
            isDomainZoomable = z.isDomainZoomable();
            isRangeZoomable = z.isRangeZoomable();
        }
        if (this.zoomInDomainMenuItem != null) {
            this.zoomInDomainMenuItem.setEnabled(isDomainZoomable);
        }
        if (this.zoomOutDomainMenuItem != null) {
            this.zoomOutDomainMenuItem.setEnabled(isDomainZoomable);
        }
        if (this.zoomResetDomainMenuItem != null) {
            this.zoomResetDomainMenuItem.setEnabled(isDomainZoomable);
        }

        if (this.zoomInRangeMenuItem != null) {
            this.zoomInRangeMenuItem.setEnabled(isRangeZoomable);
        }
        if (this.zoomOutRangeMenuItem != null) {
            this.zoomOutRangeMenuItem.setEnabled(isRangeZoomable);
        }

        if (this.zoomResetRangeMenuItem != null) {
            this.zoomResetRangeMenuItem.setEnabled(isRangeZoomable);
        }

        if (this.zoomInBothMenuItem != null) {
            this.zoomInBothMenuItem.setEnabled(isDomainZoomable & isRangeZoomable);
        }
        if (this.zoomOutBothMenuItem != null) {
            this.zoomOutBothMenuItem.setEnabled(isDomainZoomable & isRangeZoomable);
        }
        if (this.zoomResetBothMenuItem != null) {
            this.zoomResetBothMenuItem.setEnabled(isDomainZoomable & isRangeZoomable);
        }

        this.popup.setLocation(x, y);
        this.popup.setVisible(true);
    }

}

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

/**
 * Sets the flag that controls whether or not zooming is enable for the domain axis. A check is
 * made to ensure that the current plot supports zooming for the domain values.
 * /*from  www . j  a v a2  s.  c o  m*/
 * @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());
        }
    } else {
        this.domainZoomable = false;
    }
}

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

/**
 * Sets the chart that is displayed in the panel.
 * //from   ww  w .ja  v a 2s .  com
 * @param chart
 *            the chart (<code>null</code> permitted).
 */
public void setChart(JFreeChart chart) {
    // stop listening for changes to the existing chart
    if (this.chart != null) {
        this.chart.removeChangeListener(this);
        this.chart.removeProgressListener(this);
    }

    // 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();
            this.rangeZoomable = z.isRangeZoomable();
            this.orientation = z.getOrientation();
        }
    } else {
        this.domainZoomable = false;
        this.rangeZoomable = false;
    }
    if (this.useBuffer) {
        this.refreshBuffer = true;
    }
    repaint();
}

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

/**
 * The idea is to modify the zooming options depending on the type of chart being displayed by
 * the panel.//w  ww.j  a  v  a  2 s .  c o m
 * 
 * @param x
 *            horizontal position of the popup.
 * @param y
 *            vertical position of the popup.
 */
protected void displayPopupMenu(int x, int y) {

    if (this.popup != null) {

        // go through each zoom menu item and decide whether or not to
        // enable it...
        Plot plot = this.chart.getPlot();
        boolean isDomainZoomable = false;
        boolean isRangeZoomable = false;
        if (plot instanceof Zoomable) {
            Zoomable z = (Zoomable) plot;
            isDomainZoomable = z.isDomainZoomable();
            isRangeZoomable = z.isRangeZoomable();
        }

        if (this.zoomInDomainMenuItem != null) {
            this.zoomInDomainMenuItem.setEnabled(isDomainZoomable);
        }
        if (this.zoomOutDomainMenuItem != null) {
            this.zoomOutDomainMenuItem.setEnabled(isDomainZoomable);
        }
        if (this.zoomResetDomainMenuItem != null) {
            this.zoomResetDomainMenuItem.setEnabled(isDomainZoomable);
        }

        if (this.zoomInRangeMenuItem != null) {
            this.zoomInRangeMenuItem.setEnabled(isRangeZoomable);
        }
        if (this.zoomOutRangeMenuItem != null) {
            this.zoomOutRangeMenuItem.setEnabled(isRangeZoomable);
        }

        if (this.zoomResetRangeMenuItem != null) {
            this.zoomResetRangeMenuItem.setEnabled(isRangeZoomable);
        }

        if (this.zoomInBothMenuItem != null) {
            this.zoomInBothMenuItem.setEnabled(isDomainZoomable && isRangeZoomable);
        }
        if (this.zoomOutBothMenuItem != null) {
            this.zoomOutBothMenuItem.setEnabled(isDomainZoomable && isRangeZoomable);
        }
        if (this.zoomResetBothMenuItem != null) {
            this.zoomResetBothMenuItem.setEnabled(isDomainZoomable && isRangeZoomable);
        }

        this.popup.show(this, x, y);
    }
}

From source file:org.rdv.viz.chart.ChartPanel.java

/**
 * Sets the chart that is displayed in the panel.
 *
 * @param chart  the chart (<code>null</code> permitted).
 *///from w w  w .  j a va2 s. co m
public void setChart(JFreeChart chart) {

    // stop listening for changes to the existing chart
    if (this.chart != null) {
        this.chart.removeChangeListener(this);
        this.chart.removeProgressListener(this);
    }

    // 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();
            this.rangeZoomable = z.isRangeZoomable();
            this.orientation = z.getOrientation();
        }
    } else {
        this.domainZoomable = false;
        this.rangeZoomable = false;
    }
    if (this.useBuffer) {
        this.refreshBuffer = true;
    }
    repaint();

}

From source file:org.rdv.viz.chart.ChartPanel.java

/**
 * The idea is to modify the zooming options depending on the type of chart
 * being displayed by the panel./*from  ww  w  . ja v a2  s . c om*/
 *
 * @param x  horizontal position of the popup.
 * @param y  vertical position of the popup.
 */
protected void displayPopupMenu(int x, int y) {

    if (this.popup != null) {

        // go through each zoom menu item and decide whether or not to
        // enable it...
        Plot plot = this.chart.getPlot();
        boolean isDomainZoomable = false;
        boolean isRangeZoomable = false;
        if (plot instanceof Zoomable) {
            Zoomable z = (Zoomable) plot;
            isDomainZoomable = z.isDomainZoomable();
            isRangeZoomable = z.isRangeZoomable();
        }

        if (this.zoomInDomainMenuItem != null) {
            this.zoomInDomainMenuItem.setEnabled(isDomainZoomable);
        }
        if (this.zoomOutDomainMenuItem != null) {
            this.zoomOutDomainMenuItem.setEnabled(isDomainZoomable);
        }
        if (this.zoomResetDomainMenuItem != null) {
            this.zoomResetDomainMenuItem.setEnabled(isDomainZoomable);
        }

        if (this.zoomInRangeMenuItem != null) {
            this.zoomInRangeMenuItem.setEnabled(isRangeZoomable);
        }
        if (this.zoomOutRangeMenuItem != null) {
            this.zoomOutRangeMenuItem.setEnabled(isRangeZoomable);
        }

        if (this.zoomResetRangeMenuItem != null) {
            this.zoomResetRangeMenuItem.setEnabled(isRangeZoomable);
        }

        if (this.zoomInBothMenuItem != null) {
            this.zoomInBothMenuItem.setEnabled(isDomainZoomable && isRangeZoomable);
        }
        if (this.zoomOutBothMenuItem != null) {
            this.zoomOutBothMenuItem.setEnabled(isDomainZoomable && isRangeZoomable);
        }
        if (this.zoomResetBothMenuItem != null) {
            this.zoomResetBothMenuItem.setEnabled(isDomainZoomable && isRangeZoomable);
        }

        this.popup.show(this, x, y);
    }

}

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

/**
 * Sets the flag that controls whether or not zooming is enable for the domain axis. A check is
 * made to ensure that the current plot supports zooming for the domain values.
 * //w ww .j a v  a2  s  . c om
 * @param flag
 *            <code>true</code> enables zooming if possible.
 */

@Override
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();
        }
    } else {
        this.domainZoomable = false;
    }
}

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

/**
 * Sets the chart that is displayed in the panel.
 * /*from   w  w  w  . j  av a2s  .  c om*/
 * @param chart
 *            the chart (<code>null</code> permitted).
 */

@Override
public void setChart(JFreeChart chart) {

    // stop listening for changes to the existing chart
    if (this.chart != null) {
        this.chart.removeChangeListener(this);
        this.chart.removeProgressListener(this);
    }

    // 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();
            this.rangeZoomable = z.isRangeZoomable();
            this.orientation = z.getOrientation();
        }
    } else {
        this.domainZoomable = false;
        this.rangeZoomable = false;
    }

    repaint();

}

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

/**
 * The idea is to modify the zooming options depending on the type of chart being displayed by
 * the panel.//  ww  w  . j  a  v  a2s  .c  o  m
 * 
 * @param x
 *            horizontal position of the popup.
 * @param y
 *            vertical position of the popup.
 */

@Override
protected void displayPopupMenu(int x, int y) {

    if (this.popup == null) {
        return;
    }

    // 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();
    }

    if (this.zoomInDomainMenuItem != null) {
        this.zoomInDomainMenuItem.setEnabled(isDomainZoomable);
    }
    if (this.zoomOutDomainMenuItem != null) {
        this.zoomOutDomainMenuItem.setEnabled(isDomainZoomable);
    }
    if (this.zoomResetDomainMenuItem != null) {
        this.zoomResetDomainMenuItem.setEnabled(isDomainZoomable);
    }

    if (this.zoomInRangeMenuItem != null) {
        this.zoomInRangeMenuItem.setEnabled(isRangeZoomable);
    }
    if (this.zoomOutRangeMenuItem != null) {
        this.zoomOutRangeMenuItem.setEnabled(isRangeZoomable);
    }

    if (this.zoomResetRangeMenuItem != null) {
        this.zoomResetRangeMenuItem.setEnabled(isRangeZoomable);
    }

    if (this.zoomInBothMenuItem != null) {
        this.zoomInBothMenuItem.setEnabled(isDomainZoomable && isRangeZoomable);
    }
    if (this.zoomOutBothMenuItem != null) {
        this.zoomOutBothMenuItem.setEnabled(isDomainZoomable && isRangeZoomable);
    }
    if (this.zoomResetBothMenuItem != null) {
        this.zoomResetBothMenuItem.setEnabled(isDomainZoomable && isRangeZoomable);
    }

    coordinateTransformation.showPopupMenu(new Point(x, y), this, popup);
}