Example usage for org.jfree.data.xy VectorSeries setDescription

List of usage examples for org.jfree.data.xy VectorSeries setDescription

Introduction

In this page you can find the example usage for org.jfree.data.xy VectorSeries setDescription.

Prototype

public void setDescription(String description) 

Source Link

Document

Sets the description of the series and sends a PropertyChangeEvent to all registered listeners.

Usage

From source file:org.jfree.data.xy.VectorSeriesCollectionTest.java

/**
 * Confirm that cloning works.// w ww.ja v a 2 s .c  o  m
 */
@Test
public void testCloning() throws CloneNotSupportedException {
    VectorSeries s1 = new VectorSeries("Series");
    s1.add(1.0, 1.1, 1.2, 1.3);
    VectorSeriesCollection c1 = new VectorSeriesCollection();
    c1.addSeries(s1);
    VectorSeriesCollection c2 = (VectorSeriesCollection) c1.clone();
    assertTrue(c1 != c2);
    assertTrue(c1.getClass() == c2.getClass());
    assertTrue(c1.equals(c2));

    // check independence
    s1.setDescription("XYZ");
    assertFalse(c1.equals(c2));
}

From source file:org.jfree.data.xy.junit.VectorSeriesCollectionTest.java

/**
 * Confirm that cloning works.//w ww  .  j  av a 2 s.com
 */
public void testCloning() {
    VectorSeries s1 = new VectorSeries("Series");
    s1.add(1.0, 1.1, 1.2, 1.3);
    VectorSeriesCollection c1 = new VectorSeriesCollection();
    c1.addSeries(s1);
    VectorSeriesCollection c2 = null;
    try {
        c2 = (VectorSeriesCollection) c1.clone();
    } catch (CloneNotSupportedException e) {
        e.printStackTrace();
    }
    assertTrue(c1 != c2);
    assertTrue(c1.getClass() == c2.getClass());
    assertTrue(c1.equals(c2));

    // check independence
    s1.setDescription("XYZ");
    assertFalse(c1.equals(c2));
}