Example usage for org.jfree.data.xy XYIntervalSeries setKey

List of usage examples for org.jfree.data.xy XYIntervalSeries setKey

Introduction

In this page you can find the example usage for org.jfree.data.xy XYIntervalSeries setKey.

Prototype

public void setKey(Comparable key) 

Source Link

Document

Sets the key for the series and sends a VetoableChangeEvent (with the property name "Key") to all registered listeners.

Usage

From source file:userinterface.graph.Histogram.java

/**
 * Changes the name of a series./*from  www. j  ava 2 s.  c  om*/
 * 
 * @param key The key identifying the series.
 * @param seriesName New name of series.
 */
public void changeSeriesName(SeriesKey key, String seriesName) {
    synchronized (seriesCollection) {
        seriesName = getUniqueSeriesName(seriesName);

        if (keyToSeries.containsKey(key)) {
            XYIntervalSeries series = keyToSeries.get(key);
            series.setKey(seriesName);
        }
    }
}