Example usage for java.awt Paint equals

List of usage examples for java.awt Paint equals

Introduction

In this page you can find the example usage for java.awt Paint equals.

Prototype

public boolean equals(Object obj) 

Source Link

Document

Indicates whether some other object is "equal to" this one.

Usage

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

/**
 * Count the number of series using the specified color for their series
 * plot.//w ww .  j  a v  a 2s  . c  o m
 * 
 * @param color          the color to find
 * @return               the number of series using this color
 */
private int getSeriesUsingColor(Color color) {
    if (color == null) {
        return 0;
    }

    int count = 0;

    for (int i = 0; i < dataCollection.getSeriesCount(); i++) {
        Paint p = xyPlot.getRenderer().getSeriesPaint(i);
        if (p.equals(color)) {
            count++;
        }
    }

    return count;
}