Java Code Examples for org.jfree.chart.axis.CategoryAxis#configure()

The following examples show how to use org.jfree.chart.axis.CategoryAxis#configure() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CombinedDomainCategoryPlot.java    From openstock with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Removes a subplot from the combined chart.  Potentially, this removes
 * some unique categories from the overall union of the datasets...so the
 * domain axis is reconfigured, then a {@link PlotChangeEvent} is sent to
 * all registered listeners.
 *
 * @param subplot  the subplot (<code>null</code> not permitted).
 */
public void remove(CategoryPlot subplot) {
    ParamChecks.nullNotPermitted(subplot, "subplot");
    int position = -1;
    int size = this.subplots.size();
    int i = 0;
    while (position == -1 && i < size) {
        if (this.subplots.get(i) == subplot) {
            position = i;
        }
        i++;
    }
    if (position != -1) {
        this.subplots.remove(position);
        subplot.setParent(null);
        subplot.removeChangeListener(this);
        CategoryAxis domain = getDomainAxis();
        if (domain != null) {
            domain.configure();
        }
        fireChangeEvent();
    }
}
 
Example 2
Source File: jMutRepair_0021_s.java    From coming with MIT License 6 votes vote down vote up
/**
 * Sets a domain axis and, if requested, sends a {@link PlotChangeEvent} to 
 * all registered listeners.
 *
 * @param index  the axis index.
 * @param axis  the axis (<code>null</code> permitted).
 * @param notify  notify listeners?
 */
public void setDomainAxis(int index, CategoryAxis axis, boolean notify) {
    CategoryAxis existing = (CategoryAxis) this.domainAxes.get(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));
    }
}
 
Example 3
Source File: JGenProg2017_0081_s.java    From coming with MIT License 6 votes vote down vote up
/**
 * Sets a domain axis and, if requested, sends a {@link PlotChangeEvent} to 
 * all registered listeners.
 *
 * @param index  the axis index.
 * @param axis  the axis (<code>null</code> permitted).
 * @param notify  notify listeners?
 */
public void setDomainAxis(int index, CategoryAxis axis, boolean notify) {
    CategoryAxis existing = (CategoryAxis) this.domainAxes.get(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));
    }
}
 
Example 4
Source File: CombinedDomainCategoryPlot.java    From buffer_bci with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Removes a subplot from the combined chart.  Potentially, this removes
 * some unique categories from the overall union of the datasets...so the
 * domain axis is reconfigured, then a {@link PlotChangeEvent} is sent to
 * all registered listeners.
 *
 * @param subplot  the subplot (<code>null</code> not permitted).
 */
public void remove(CategoryPlot subplot) {
    ParamChecks.nullNotPermitted(subplot, "subplot");
    int position = -1;
    int size = this.subplots.size();
    int i = 0;
    while (position == -1 && i < size) {
        if (this.subplots.get(i) == subplot) {
            position = i;
        }
        i++;
    }
    if (position != -1) {
        this.subplots.remove(position);
        subplot.setParent(null);
        subplot.removeChangeListener(this);
        CategoryAxis domain = getDomainAxis();
        if (domain != null) {
            domain.configure();
        }
        fireChangeEvent();
    }
}
 
Example 5
Source File: CombinedDomainCategoryPlot.java    From SIMVA-SoS with Apache License 2.0 6 votes vote down vote up
/**
 * Adds a subplot to the combined chart and sends a {@link PlotChangeEvent}
 * to all registered listeners.
 * <br><br>
 * The domain axis for the subplot will be set to <code>null</code>.  You
 * must ensure that the subplot has a non-null range axis.
 *
 * @param subplot  the subplot (<code>null</code> not permitted).
 * @param weight  the weight (must be &gt;= 1).
 */
public void add(CategoryPlot subplot, int weight) {
    ParamChecks.nullNotPermitted(subplot, "subplot");
    if (weight < 1) {
        throw new IllegalArgumentException("Require weight >= 1.");
    }
    subplot.setParent(this);
    subplot.setWeight(weight);
    subplot.setInsets(new RectangleInsets(0.0, 0.0, 0.0, 0.0));
    subplot.setDomainAxis(null);
    subplot.setOrientation(getOrientation());
    subplot.addChangeListener(this);
    this.subplots.add(subplot);
    CategoryAxis axis = getDomainAxis();
    if (axis != null) {
        axis.configure();
    }
    fireChangeEvent();
}
 
Example 6
Source File: Chart_19_CategoryPlot_s.java    From coming with MIT License 6 votes vote down vote up
/**
 * Sets a domain axis and, if requested, sends a {@link PlotChangeEvent} to 
 * all registered listeners.
 *
 * @param index  the axis index.
 * @param axis  the axis (<code>null</code> permitted).
 * @param notify  notify listeners?
 */
public void setDomainAxis(int index, CategoryAxis axis, boolean notify) {
    CategoryAxis existing = (CategoryAxis) this.domainAxes.get(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));
    }
}
 
Example 7
Source File: patch1-Chart-26-jMutRepair_patch1-Chart-26-jMutRepair_s.java    From coming with MIT License 6 votes vote down vote up
/**
 * Sets a domain axis and, if requested, sends a {@link PlotChangeEvent} to 
 * all registered listeners.
 *
 * @param index  the axis index.
 * @param axis  the axis (<code>null</code> permitted).
 * @param notify  notify listeners?
 */
public void setDomainAxis(int index, CategoryAxis axis, boolean notify) {
    CategoryAxis existing = (CategoryAxis) this.domainAxes.get(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));
    }
}
 
Example 8
Source File: CombinedDomainCategoryPlot.java    From ECG-Viewer with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Adds a subplot to the combined chart and sends a {@link PlotChangeEvent}
 * to all registered listeners.
 * <br><br>
 * The domain axis for the subplot will be set to <code>null</code>.  You
 * must ensure that the subplot has a non-null range axis.
 *
 * @param subplot  the subplot (<code>null</code> not permitted).
 * @param weight  the weight (must be &gt;= 1).
 */
public void add(CategoryPlot subplot, int weight) {
    ParamChecks.nullNotPermitted(subplot, "subplot");
    if (weight < 1) {
        throw new IllegalArgumentException("Require weight >= 1.");
    }
    subplot.setParent(this);
    subplot.setWeight(weight);
    subplot.setInsets(new RectangleInsets(0.0, 0.0, 0.0, 0.0));
    subplot.setDomainAxis(null);
    subplot.setOrientation(getOrientation());
    subplot.addChangeListener(this);
    this.subplots.add(subplot);
    CategoryAxis axis = getDomainAxis();
    if (axis != null) {
        axis.configure();
    }
    fireChangeEvent();
}
 
Example 9
Source File: 1_CategoryPlot.java    From SimFix with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Sets a domain axis and, if requested, sends a {@link PlotChangeEvent} to 
 * all registered listeners.
 *
 * @param index  the axis index.
 * @param axis  the axis (<code>null</code> permitted).
 * @param notify  notify listeners?
 */
public void setDomainAxis(int index, CategoryAxis axis, boolean notify) {
    CategoryAxis existing = (CategoryAxis) this.domainAxes.get(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) {
        fireChangeEvent();
    }
}
 
Example 10
Source File: jMutRepair_0021_t.java    From coming with MIT License 6 votes vote down vote up
/**
 * Sets a domain axis and, if requested, sends a {@link PlotChangeEvent} to 
 * all registered listeners.
 *
 * @param index  the axis index.
 * @param axis  the axis (<code>null</code> permitted).
 * @param notify  notify listeners?
 */
public void setDomainAxis(int index, CategoryAxis axis, boolean notify) {
    CategoryAxis existing = (CategoryAxis) this.domainAxes.get(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));
    }
}
 
Example 11
Source File: CategoryPlot.java    From opensim-gui with Apache License 2.0 6 votes vote down vote up
/**
 * Sets a domain axis and, if requested, sends a {@link PlotChangeEvent} to 
 * all registered listeners.
 *
 * @param index  the axis index.
 * @param axis  the axis.
 * @param notify  notify listeners?
 */
public void setDomainAxis(int index, CategoryAxis axis, boolean notify) {
    CategoryAxis existing = (CategoryAxis) this.domainAxes.get(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));
    }
}
 
Example 12
Source File: CombinedDomainCategoryPlot.java    From openstock with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Adds a subplot to the combined chart and sends a {@link PlotChangeEvent}
 * to all registered listeners.
 * <br><br>
 * The domain axis for the subplot will be set to <code>null</code>.  You
 * must ensure that the subplot has a non-null range axis.
 *
 * @param subplot  the subplot (<code>null</code> not permitted).
 * @param weight  the weight (must be &gt;= 1).
 */
public void add(CategoryPlot subplot, int weight) {
    ParamChecks.nullNotPermitted(subplot, "subplot");
    if (weight < 1) {
        throw new IllegalArgumentException("Require weight >= 1.");
    }
    subplot.setParent(this);
    subplot.setWeight(weight);
    subplot.setInsets(new RectangleInsets(0.0, 0.0, 0.0, 0.0));
    subplot.setDomainAxis(null);
    subplot.setOrientation(getOrientation());
    subplot.addChangeListener(this);
    this.subplots.add(subplot);
    CategoryAxis axis = getDomainAxis();
    if (axis != null) {
        axis.configure();
    }
    fireChangeEvent();
}
 
Example 13
Source File: JGenProg2017_0081_s.java    From coming with MIT License 5 votes vote down vote up
/**
 * Configures the domain axes.
 */
public void configureDomainAxes() {
    for (int i = 0; i < this.domainAxes.size(); i++) {
        CategoryAxis axis = (CategoryAxis) this.domainAxes.get(i);
        if (axis != null) {
            axis.configure();
        }
    }
}
 
Example 14
Source File: patch1-Chart-26-jMutRepair_patch1-Chart-26-jMutRepair_s.java    From coming with MIT License 5 votes vote down vote up
/**
 * Configures the domain axes.
 */
public void configureDomainAxes() {
    for (int i = 0; i < this.domainAxes.size(); i++) {
        CategoryAxis axis = (CategoryAxis) this.domainAxes.get(i);
        if (axis != null) {
            axis.configure();
        }
    }
}
 
Example 15
Source File: 1_CategoryPlot.java    From SimFix with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Configures the domain axes.
 */
public void configureDomainAxes() {
    for (int i = 0; i < this.domainAxes.size(); i++) {
        CategoryAxis axis = (CategoryAxis) this.domainAxes.get(i);
        if (axis != null) {
            axis.configure();
        }
    }
}
 
Example 16
Source File: 1_CategoryPlot.java    From SimFix with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Configures the domain axes.
 */
public void configureDomainAxes() {
    for (int i = 0; i < this.domainAxes.size(); i++) {
        CategoryAxis axis = (CategoryAxis) this.domainAxes.get(i);
        if (axis != null) {
            axis.configure();
        }
    }
}
 
Example 17
Source File: CategoryPlot.java    From ECG-Viewer with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Configures the domain axes.
 */
public void configureDomainAxes() {
    for (CategoryAxis xAxis : this.domainAxes.values()) {
        if (xAxis != null) {
            xAxis.configure();
        }
    }
}
 
Example 18
Source File: Cardumen_006_t.java    From coming with MIT License 5 votes vote down vote up
/**
 * Configures the domain axes.
 */
public void configureDomainAxes() {
    for (int i = 0; i < this.domainAxes.size(); i++) {
        CategoryAxis axis = (CategoryAxis) this.domainAxes.get(i);
        if (axis != null) {
            axis.configure();
        }
    }
}
 
Example 19
Source File: Cardumen_00243_s.java    From coming with MIT License 5 votes vote down vote up
/**
 * Configures the domain axes.
 */
public void configureDomainAxes() {
    for (int i = 0; i < this.domainAxes.size(); i++) {
        CategoryAxis axis = (CategoryAxis) this.domainAxes.get(i);
        if (axis != null) {
            axis.configure();
        }
    }
}
 
Example 20
Source File: CategoryPlot.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Configures the domain axes.
 */
public void configureDomainAxes() {
    for (CategoryAxis xAxis : this.domainAxes.values()) {
        if (xAxis != null) {
            xAxis.configure();
        }
    }
}