Example usage for org.jfree.chart.axis ValueAxis removeChangeListener

List of usage examples for org.jfree.chart.axis ValueAxis removeChangeListener

Introduction

In this page you can find the example usage for org.jfree.chart.axis ValueAxis removeChangeListener.

Prototype

public void removeChangeListener(AxisChangeListener listener) 

Source Link

Document

Deregisters an object for notification of changes to the axis.

Usage

From source file:net.sf.maltcms.chromaui.chromatogram1Dviewer.ui.panel.Chromatogram1DViewPanel.java

private void removeAxisListener() {
    if (this.plot != null) {
        ValueAxis domain = this.plot.getDomainAxis();
        if (domain != null) {
            domain.removeChangeListener(this);
        }//from w w  w.j  a va2 s.com
        ValueAxis range = this.plot.getRangeAxis();
        if (range != null) {
            range.removeChangeListener(this);
        }
    }
}

From source file:edu.ucla.stat.SOCR.motionchart.MotionBubbleRenderer.java

/**
 * Sets the plot that the renderer is assigned to.
 *
 * @param plot the plot (<code>null</code> permitted).
 *//*from w w w  .j  a v  a2s.c om*/
@Override
public void setPlot(XYPlot plot) {
    XYPlot prevPlot = getPlot();
    if (prevPlot != null && plot != prevPlot) {
        prevPlot.removeChangeListener(this);
        ValueAxis prevDomainAxis = prevPlot.getDomainAxis();
        ValueAxis prevRangeAxis = prevPlot.getRangeAxis();

        if (prevDomainAxis != null)
            prevDomainAxis.removeChangeListener(this);

        if (prevRangeAxis != null)
            prevRangeAxis.removeChangeListener(this);
    }

    super.setPlot(plot);

    domainAxis = plot.getDomainAxis();
    rangeAxis = plot.getRangeAxis();

    if (domainAxis != null) {
        domainAxisLength = domainAxis.getRange().getLength();
        domainAxis.addChangeListener(this);
    }

    if (rangeAxis != null) {
        rangeAxisLength = rangeAxis.getRange().getLength();
        rangeAxis.addChangeListener(this);
    }

    plot.addChangeListener(this);
}

From source file:net.sf.maltcms.chromaui.chromatogram1Dviewer.ui.panel.Chromatogram1DHeatmapViewerPanel.java

public void removeAxisListener() {
    if (this.chartPanel != null) {
        ValueAxis domain = this.chartPanel.getChart().getXYPlot().getDomainAxis();
        if (domain != null) {
            domain.removeChangeListener(this);
        }/*w  w  w  .  j ava 2  s .  c  o m*/
        ValueAxis range = this.chartPanel.getChart().getXYPlot().getRangeAxis();
        if (range != null) {
            range.removeChangeListener(this);
        }
    }
}

From source file:org.esa.beam.visat.toolviews.stat.ScatterPlotPanel.java

private void updateScalingOfXAxis() {
    final boolean logScaled = scatterPlotModel.xAxisLogScaled;
    final ValueAxis oldAxis = getPlot().getDomainAxis();
    ValueAxis newAxis = StatisticChartStyling.updateScalingOfAxis(logScaled, oldAxis, false);
    oldAxis.removeChangeListener(domainAxisChangeListener);
    newAxis.addChangeListener(domainAxisChangeListener);
    getPlot().setDomainAxis(newAxis);/*from   www .  j a v a 2  s  .  co m*/
    finishScalingUpdate(xAxisRangeControl, newAxis, oldAxis);
}

From source file:ucar.unidata.idv.control.chart.MyXYPlot.java

/**
 * Sets the range axis for the plot and sends a {@link PlotChangeEvent} to
 * all registered listeners.// w w  w  .  ja va  2s. c  o m
 *
 * @param axis  the axis (<code>null</code> permitted).
 *
 */
public void setRangeAxis(ValueAxis axis) {

    if (axis != null) {
        axis.setPlot(this);
    }

    // plot is likely registered as a listener with the existing axis...
    ValueAxis existing = getRangeAxis();
    if (existing != null) {
        existing.removeChangeListener(this);
    }

    this.rangeAxes.set(0, axis);
    if (axis != null) {
        axis.configure();
        axis.addChangeListener(this);
    }
    notifyListeners(new PlotChangeEvent(this));

}

From source file:ucar.unidata.idv.control.chart.MyXYPlot.java

/**
 * Sets a range axis and, if requested, sends a {@link PlotChangeEvent} to
 * all registered listeners.//  w ww  .j  a v  a2  s . c  o m
 *
 * @param index  the axis index.
 * @param axis  the axis (<code>null</code> permitted).
 * @param notify and notify the listeners
 */
public void setRangeAxis(int index, ValueAxis axis, boolean notify) {
    ValueAxis existing = getRangeAxis(index);
    if (existing != null) {
        existing.removeChangeListener(this);
    }
    if (axis != null) {
        axis.setPlot(this);
    }
    this.rangeAxes.set(index, axis);
    if (axis != null) {
        axis.configure();
        axis.addChangeListener(this);
    }
    if (notify) {
        notifyListeners(new PlotChangeEvent(this));
    }
}

From source file:ucar.unidata.idv.control.chart.MyXYPlot.java

/**
 * Sets a domain axis and, if requested, sends a {@link PlotChangeEvent} to
 * all registered listeners./*from  w w w.j  a  v a  2 s. co m*/
 *
 * @param index  the axis index.
 * @param axis  the axis.
 * @param notify  notify listeners?
 */
public void setDomainAxis(int index, ValueAxis axis, boolean notify) {
    ValueAxis existing = getDomainAxis(index);
    if (existing != null) {
        existing.removeChangeListener(this);
    }
    if (axis != null) {
        axis.setPlot(this);
    }
    this.domainAxes.set(index, axis);
    if (axis != null) {
        axis.configure();
        axis.addChangeListener(this);
    }
    if (notify) {
        notifyListeners(new PlotChangeEvent(this));
    }
}

From source file:ucar.unidata.idv.control.chart.MyXYPlot.java

/**
 * Clears the range axes from the plot and sends a {@link PlotChangeEvent}
 * to all registered listeners./*from   ww  w . ja  va 2  s  . c o  m*/
 */
public void clearRangeAxes() {
    for (int i = 0; i < this.rangeAxes.size(); i++) {
        ValueAxis axis = (ValueAxis) this.rangeAxes.get(i);
        if (axis != null) {
            axis.removeChangeListener(this);
        }
    }
    this.rangeAxes.clear();
    notifyListeners(new PlotChangeEvent(this));
}

From source file:ucar.unidata.idv.control.chart.MyXYPlot.java

/**
 * Clears the domain axes from the plot and sends a {@link PlotChangeEvent}
 * to all registered listeners./*w w  w .  j av  a  2 s  .  c o  m*/
 */
public void clearDomainAxes() {
    for (int i = 0; i < this.domainAxes.size(); i++) {
        ValueAxis axis = (ValueAxis) this.domainAxes.get(i);
        if (axis != null) {
            axis.removeChangeListener(this);
        }
    }
    this.domainAxes.clear();
    notifyListeners(new PlotChangeEvent(this));
}