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

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

Introduction

In this page you can find the example usage for org.jfree.data.xy MatrixSeries 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.MatrixSeriesCollectionTest.java

/**
 * Confirm that cloning works./*from w ww  . j a  va2s .co  m*/
 */
@Test
public void testCloning() throws CloneNotSupportedException {
    MatrixSeries s1 = new MatrixSeries("Series", 2, 3);
    s1.update(0, 0, 1.1);
    MatrixSeriesCollection c1 = new MatrixSeriesCollection();
    c1.addSeries(s1);
    MatrixSeriesCollection c2 = (MatrixSeriesCollection) 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.MatrixSeriesCollectionTest.java

/**
 * Confirm that cloning works.//w  ww .  j a v  a  2s.c  o m
 */
public void testCloning() {
    MatrixSeries s1 = new MatrixSeries("Series", 2, 3);
    s1.update(0, 0, 1.1);
    MatrixSeriesCollection c1 = new MatrixSeriesCollection();
    c1.addSeries(s1);
    MatrixSeriesCollection c2 = null;
    try {
        c2 = (MatrixSeriesCollection) 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));
}