org.jfree.chart.labels.StandardCategoryItemLabelGenerator Java Examples

The following examples show how to use org.jfree.chart.labels.StandardCategoryItemLabelGenerator. 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: AbstractCategoryItemRendererTest.java    From ECG-Viewer with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Confirm that cloning works.
 */
@Test
public void testCloning1() throws CloneNotSupportedException {
    AbstractCategoryItemRenderer r1 = new BarRenderer();
    r1.setItemLabelGenerator(new StandardCategoryItemLabelGenerator());
    AbstractCategoryItemRenderer r2 = (BarRenderer) r1.clone();
    assertTrue(r1 != r2);
    assertTrue(r1.getClass() == r2.getClass());
    assertTrue(r1.equals(r2));

    r1 = new BarRenderer();
    r1.setSeriesItemLabelGenerator(0,
            new StandardCategoryItemLabelGenerator());
    r2 = (BarRenderer) r1.clone();

    assertTrue(r1 != r2);
    assertTrue(r1.getClass() == r2.getClass());
    assertTrue(r1.equals(r2));

    r1 = new BarRenderer();
    r1.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator());
    r2 = (BarRenderer) r1.clone();
    assertTrue(r1 != r2);
    assertTrue(r1.getClass() == r2.getClass());
    assertTrue(r1.equals(r2));
}
 
Example #2
Source File: AbstractCategoryItemRendererTest.java    From openstock with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Confirm that cloning works.
 */
@Test
public void testCloning1() throws CloneNotSupportedException {
    AbstractCategoryItemRenderer r1 = new BarRenderer();
    r1.setItemLabelGenerator(new StandardCategoryItemLabelGenerator());
    AbstractCategoryItemRenderer r2 = (BarRenderer) r1.clone();
    assertTrue(r1 != r2);
    assertTrue(r1.getClass() == r2.getClass());
    assertTrue(r1.equals(r2));

    r1 = new BarRenderer();
    r1.setSeriesItemLabelGenerator(0,
            new StandardCategoryItemLabelGenerator());
    r2 = (BarRenderer) r1.clone();

    assertTrue(r1 != r2);
    assertTrue(r1.getClass() == r2.getClass());
    assertTrue(r1.equals(r2));

    r1 = new BarRenderer();
    r1.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator());
    r2 = (BarRenderer) r1.clone();
    assertTrue(r1 != r2);
    assertTrue(r1.getClass() == r2.getClass());
    assertTrue(r1.equals(r2));
}
 
Example #3
Source File: AbstractCategoryItemRendererTest.java    From buffer_bci with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Confirm that cloning works.
 */
@Test
public void testCloning1() throws CloneNotSupportedException {
    AbstractCategoryItemRenderer r1 = new BarRenderer();
    r1.setItemLabelGenerator(new StandardCategoryItemLabelGenerator());
    AbstractCategoryItemRenderer r2 = (BarRenderer) r1.clone();
    assertTrue(r1 != r2);
    assertTrue(r1.getClass() == r2.getClass());
    assertTrue(r1.equals(r2));

    r1 = new BarRenderer();
    r1.setSeriesItemLabelGenerator(0,
            new StandardCategoryItemLabelGenerator());
    r2 = (BarRenderer) r1.clone();

    assertTrue(r1 != r2);
    assertTrue(r1.getClass() == r2.getClass());
    assertTrue(r1.equals(r2));

    r1 = new BarRenderer();
    r1.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator());
    r2 = (BarRenderer) r1.clone();
    assertTrue(r1 != r2);
    assertTrue(r1.getClass() == r2.getClass());
    assertTrue(r1.equals(r2));
}
 
Example #4
Source File: StandardCategoryItemLabelGeneratorTests.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Some checks for the generalLabel() method.
 */
public void testGenerateLabel() {
    StandardCategoryItemLabelGenerator g
            = new StandardCategoryItemLabelGenerator("{2}",
            new DecimalFormat("0.000"));
    DefaultCategoryDataset dataset = new DefaultCategoryDataset();
    dataset.addValue(1.0, "R0", "C0");
    dataset.addValue(2.0, "R0", "C1");
    dataset.addValue(3.0, "R1", "C0");
    dataset.addValue(null, "R1", "C1");
    String s = g.generateLabel(dataset, 0, 0);
    assertTrue(s.startsWith("1"));
    assertTrue(s.endsWith("000"));

    // try a null value
    s = g.generateLabel(dataset, 1, 1);
    assertEquals("-", s);
}
 
Example #5
Source File: AbstractCategoryItemRendererTest.java    From ccu-historian with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Confirm that cloning works.
 */
@Test
public void testCloning1() throws CloneNotSupportedException {
    AbstractCategoryItemRenderer r1 = new BarRenderer();
    r1.setItemLabelGenerator(new StandardCategoryItemLabelGenerator());
    AbstractCategoryItemRenderer r2 = (BarRenderer) r1.clone();
    assertTrue(r1 != r2);
    assertTrue(r1.getClass() == r2.getClass());
    assertTrue(r1.equals(r2));

    r1 = new BarRenderer();
    r1.setSeriesItemLabelGenerator(0,
            new StandardCategoryItemLabelGenerator());
    r2 = (BarRenderer) r1.clone();

    assertTrue(r1 != r2);
    assertTrue(r1.getClass() == r2.getClass());
    assertTrue(r1.equals(r2));

    r1 = new BarRenderer();
    r1.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator());
    r2 = (BarRenderer) r1.clone();
    assertTrue(r1 != r2);
    assertTrue(r1.getClass() == r2.getClass());
    assertTrue(r1.equals(r2));
}
 
Example #6
Source File: AbstractCategoryItemRendererTest.java    From SIMVA-SoS with Apache License 2.0 6 votes vote down vote up
/**
 * Confirm that cloning works.
 */
@Test
public void testCloning1() throws CloneNotSupportedException {
    AbstractCategoryItemRenderer r1 = new BarRenderer();
    r1.setItemLabelGenerator(new StandardCategoryItemLabelGenerator());
    AbstractCategoryItemRenderer r2 = (BarRenderer) r1.clone();
    assertTrue(r1 != r2);
    assertTrue(r1.getClass() == r2.getClass());
    assertTrue(r1.equals(r2));

    r1 = new BarRenderer();
    r1.setSeriesItemLabelGenerator(0,
            new StandardCategoryItemLabelGenerator());
    r2 = (BarRenderer) r1.clone();

    assertTrue(r1 != r2);
    assertTrue(r1.getClass() == r2.getClass());
    assertTrue(r1.equals(r2));

    r1 = new BarRenderer();
    r1.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator());
    r2 = (BarRenderer) r1.clone();
    assertTrue(r1 != r2);
    assertTrue(r1.getClass() == r2.getClass());
    assertTrue(r1.equals(r2));
}
 
Example #7
Source File: StandardCategoryItemLabelGeneratorTests.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Some checks for the generalLabel() method.
 */
public void testGenerateLabel() {
    StandardCategoryItemLabelGenerator g 
        = new StandardCategoryItemLabelGenerator("{2}", 
                new DecimalFormat("0.000"));
    DefaultCategoryDataset dataset = new DefaultCategoryDataset();
    dataset.addValue(1.0, "R0", "C0");
    dataset.addValue(2.0, "R0", "C1");
    dataset.addValue(3.0, "R1", "C0");
    dataset.addValue(null, "R1", "C1");
    String s = g.generateLabel(dataset, 0, 0);
    assertEquals("1.000", s);
    
    // try a null value
    s = g.generateLabel(dataset, 1, 1);
    assertEquals("-", s);
}
 
Example #8
Source File: StandardCategoryItemLabelGeneratorTests.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * A test for bug 1481087.
 */
public void testEquals1481087() {
    StandardCategoryItemLabelGenerator g1 
        = new StandardCategoryItemLabelGenerator("{0}", 
                new DecimalFormat("0.00"));
    StandardCategoryToolTipGenerator g2 
        = new StandardCategoryToolTipGenerator("{0}", 
                new DecimalFormat("0.00"));
    assertFalse(g1.equals(g2));
}
 
Example #9
Source File: AbstractCategoryItemRendererTests.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Check that the getSeriesItemLabelGenerator() method behaves as
 * expected.
 */
public void testGetSeriesItemLabelGenerator() {
    CategoryItemRenderer r = new BarRenderer();
    assertNull(r.getSeriesItemLabelGenerator(2));
    r.setSeriesItemLabelGenerator(2,
            new StandardCategoryItemLabelGenerator());
    assertNotNull(r.getSeriesItemLabelGenerator(2));
    r.setSeriesItemLabelGenerator(2, null);
    assertNull(r.getSeriesItemLabelGenerator(2));
    r.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator());
    assertNull(r.getSeriesItemLabelGenerator(2));
}
 
Example #10
Source File: StandardCategoryItemLabelGeneratorTests.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Simple check that hashCode is implemented.
 */
public void testHashCode() {
    StandardCategoryItemLabelGenerator g1
            = new StandardCategoryItemLabelGenerator();
    StandardCategoryItemLabelGenerator g2
            = new StandardCategoryItemLabelGenerator();
    assertTrue(g1.equals(g2));
    assertTrue(g1.hashCode() == g2.hashCode());
}
 
Example #11
Source File: StandardCategoryItemLabelGeneratorTests.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * A test for bug 1481087.
 */
public void testEquals1481087() {
    StandardCategoryItemLabelGenerator g1
            = new StandardCategoryItemLabelGenerator("{0}",
            new DecimalFormat("0.00"));
    StandardCategoryToolTipGenerator g2
            = new StandardCategoryToolTipGenerator("{0}",
            new DecimalFormat("0.00"));
    assertFalse(g1.equals(g2));
}
 
Example #12
Source File: StandardCategoryToolTipGeneratorTests.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * A test for bug 1481087.
 */
public void testEquals1481087() {
    StandardCategoryToolTipGenerator g1
            = new StandardCategoryToolTipGenerator("{0}",
            new DecimalFormat("0.00"));
    StandardCategoryItemLabelGenerator g2
            = new StandardCategoryItemLabelGenerator("{0}",
            new DecimalFormat("0.00"));
    assertFalse(g1.equals(g2));
}
 
Example #13
Source File: SpiderWebPlot.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new spider web plot with the given dataset.
 *
 * @param dataset  the dataset.
 * @param extract  controls how data is extracted ({@link TableOrder#BY_ROW}
 *                 or {@link TableOrder#BY_COLUMN}).
 */
public SpiderWebPlot(CategoryDataset dataset, TableOrder extract) {
    super();
    if (extract == null) {
        throw new IllegalArgumentException("Null 'extract' argument.");
    }
    this.dataset = dataset;
    if (dataset != null) {
        dataset.addChangeListener(this);
    }

    this.dataExtractOrder = extract;
    this.headPercent = DEFAULT_HEAD;
    this.axisLabelGap = DEFAULT_AXIS_LABEL_GAP;
    this.axisLinePaint = Color.black;
    this.axisLineStroke = new BasicStroke(1.0f);

    this.interiorGap = DEFAULT_INTERIOR_GAP;
    this.startAngle = DEFAULT_START_ANGLE;
    this.direction = Rotation.CLOCKWISE;
    this.maxValue = DEFAULT_MAX_VALUE;

    this.seriesPaint = null;
    this.seriesPaintList = new PaintList();
    this.baseSeriesPaint = null;

    this.seriesOutlinePaint = null;
    this.seriesOutlinePaintList = new PaintList();
    this.baseSeriesOutlinePaint = DEFAULT_OUTLINE_PAINT;

    this.seriesOutlineStroke = null;
    this.seriesOutlineStrokeList = new StrokeList();
    this.baseSeriesOutlineStroke = DEFAULT_OUTLINE_STROKE;

    this.labelFont = DEFAULT_LABEL_FONT;
    this.labelPaint = DEFAULT_LABEL_PAINT;
    this.labelGenerator = new StandardCategoryItemLabelGenerator();

    this.legendItemShape = DEFAULT_LEGEND_ITEM_CIRCLE;
}
 
Example #14
Source File: AbstractCategoryItemRendererTests.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Check that the getSeriesItemLabelGenerator() method behaves as 
 * expected.
 */
public void testGetSeriesItemLabelGenerator() {
    CategoryItemRenderer r = new BarRenderer();
    assertNull(r.getSeriesItemLabelGenerator(2));
    r.setSeriesItemLabelGenerator(2, 
            new StandardCategoryItemLabelGenerator());
    assertNotNull(r.getSeriesItemLabelGenerator(2));
    r.setSeriesItemLabelGenerator(2, null);
    assertNull(r.getSeriesItemLabelGenerator(2));
    r.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator());
    assertNull(r.getSeriesItemLabelGenerator(2));
}
 
Example #15
Source File: SpiderWebPlot.java    From ECG-Viewer with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new spider web plot with the given dataset.
 *
 * @param dataset  the dataset.
 * @param extract  controls how data is extracted ({@link TableOrder#BY_ROW}
 *                 or {@link TableOrder#BY_COLUMN}).
 */
public SpiderWebPlot(CategoryDataset dataset, TableOrder extract) {
    super();
    ParamChecks.nullNotPermitted(extract, "extract");
    this.dataset = dataset;
    if (dataset != null) {
        dataset.addChangeListener(this);
    }

    this.dataExtractOrder = extract;
    this.headPercent = DEFAULT_HEAD;
    this.axisLabelGap = DEFAULT_AXIS_LABEL_GAP;
    this.axisLinePaint = Color.black;
    this.axisLineStroke = new BasicStroke(1.0f);

    this.interiorGap = DEFAULT_INTERIOR_GAP;
    this.startAngle = DEFAULT_START_ANGLE;
    this.direction = Rotation.CLOCKWISE;
    this.maxValue = DEFAULT_MAX_VALUE;

    this.seriesPaint = null;
    this.seriesPaintList = new PaintList();
    this.baseSeriesPaint = null;

    this.seriesOutlinePaint = null;
    this.seriesOutlinePaintList = new PaintList();
    this.baseSeriesOutlinePaint = DEFAULT_OUTLINE_PAINT;

    this.seriesOutlineStroke = null;
    this.seriesOutlineStrokeList = new StrokeList();
    this.baseSeriesOutlineStroke = DEFAULT_OUTLINE_STROKE;

    this.labelFont = DEFAULT_LABEL_FONT;
    this.labelPaint = DEFAULT_LABEL_PAINT;
    this.labelGenerator = new StandardCategoryItemLabelGenerator();

    this.legendItemShape = DEFAULT_LEGEND_ITEM_CIRCLE;
}
 
Example #16
Source File: StandardCategoryToolTipGeneratorTests.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * A test for bug 1481087.
 */
public void testEquals1481087() {
    StandardCategoryToolTipGenerator g1 
        = new StandardCategoryToolTipGenerator("{0}", 
                new DecimalFormat("0.00"));
    StandardCategoryItemLabelGenerator g2 
        = new StandardCategoryItemLabelGenerator("{0}", 
                new DecimalFormat("0.00"));
    assertFalse(g1.equals(g2));
}
 
Example #17
Source File: SpiderWebPlot.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new spider web plot with the given dataset.
 * 
 * @param dataset  the dataset.
 * @param extract  controls how data is extracted ({@link TableOrder#BY_ROW}
 *                 or {@link TableOrder#BY_COLUMN}).
 */
public SpiderWebPlot(CategoryDataset dataset, TableOrder extract) {
    super();
    if (extract == null) {
        throw new IllegalArgumentException("Null 'extract' argument.");
    }
    this.dataset = dataset;
    if (dataset != null) {
        dataset.addChangeListener(this);
    }

    this.dataExtractOrder = extract;
    this.headPercent = DEFAULT_HEAD;
    this.axisLabelGap = DEFAULT_AXIS_LABEL_GAP;
    this.axisLinePaint = Color.black;
    this.axisLineStroke = new BasicStroke(1.0f);
    
    this.interiorGap = DEFAULT_INTERIOR_GAP;
    this.startAngle = DEFAULT_START_ANGLE;
    this.direction = Rotation.CLOCKWISE;
    this.maxValue = DEFAULT_MAX_VALUE;

    this.seriesPaint = null;
    this.seriesPaintList = new PaintList();
    this.baseSeriesPaint = null;

    this.seriesOutlinePaint = null;
    this.seriesOutlinePaintList = new PaintList();
    this.baseSeriesOutlinePaint = DEFAULT_OUTLINE_PAINT;

    this.seriesOutlineStroke = null;
    this.seriesOutlineStrokeList = new StrokeList();
    this.baseSeriesOutlineStroke = DEFAULT_OUTLINE_STROKE;

    this.labelFont = DEFAULT_LABEL_FONT;
    this.labelPaint = DEFAULT_LABEL_PAINT;
    this.labelGenerator = new StandardCategoryItemLabelGenerator();
    
    this.legendItemShape = DEFAULT_LEGEND_ITEM_CIRCLE;
}
 
Example #18
Source File: SpiderWebPlot.java    From opensim-gui with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a new spider web plot with the given dataset.
 * 
 * @param dataset  the dataset.
 * @param extract  controls how data is extracted ({@link TableOrder#BY_ROW}
 *                 or {@link TableOrder#BY_COLUMN}).
 */
public SpiderWebPlot(CategoryDataset dataset, TableOrder extract) {
    super();
    if (extract == null) {
        throw new IllegalArgumentException("Null 'extract' argument.");
    }
    this.dataset = dataset;
    if (dataset != null) {
        dataset.addChangeListener(this);
    }

    this.dataExtractOrder = extract;
    this.headPercent = DEFAULT_HEAD;
    this.axisLabelGap = DEFAULT_AXIS_LABEL_GAP;
    this.axisLinePaint = Color.black;
    this.axisLineStroke = new BasicStroke(1.0f);
    
    this.interiorGap = DEFAULT_INTERIOR_GAP;
    this.startAngle = DEFAULT_START_ANGLE;
    this.direction = Rotation.CLOCKWISE;
    this.maxValue = DEFAULT_MAX_VALUE;

    this.seriesPaint = null;
    this.seriesPaintList = new PaintList();
    this.baseSeriesPaint = null;

    this.seriesOutlinePaint = null;
    this.seriesOutlinePaintList = new PaintList();
    this.baseSeriesOutlinePaint = DEFAULT_OUTLINE_PAINT;

    this.seriesOutlineStroke = null;
    this.seriesOutlineStrokeList = new StrokeList();
    this.baseSeriesOutlineStroke = DEFAULT_OUTLINE_STROKE;

    this.labelFont = DEFAULT_LABEL_FONT;
    this.labelPaint = DEFAULT_LABEL_PAINT;
    this.labelGenerator = new StandardCategoryItemLabelGenerator();
    
    this.legendItemShape = DEFAULT_LEGEND_ITEM_CIRCLE;
}
 
Example #19
Source File: BarRendererTest.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Confirm that cloning works.
 */
@Test
public void testCloning() throws CloneNotSupportedException {
    BarRenderer r1 = new BarRenderer();
    r1.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator());
    r1.setBarPainter(new GradientBarPainter(0.11, 0.22, 0.33));
    BarRenderer r2 = (BarRenderer) r1.clone();
    assertTrue(r1 != r2);
    assertTrue(r1.getClass() == r2.getClass());
    assertTrue(r1.equals(r2));
}
 
Example #20
Source File: AbstractCategoryItemRendererTest.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
@Test
public void testEquals_ObjectList() {
    BarRenderer r1 = new BarRenderer();
    r1.setSeriesItemLabelGenerator(0, new StandardCategoryItemLabelGenerator());
    BarRenderer r2 = new BarRenderer();
    r2.setSeriesItemLabelGenerator(0, new StandardCategoryItemLabelGenerator());
    assertEquals(r1, r2);
    r2.setSeriesItemLabelGenerator(1, new StandardCategoryItemLabelGenerator("X", new DecimalFormat("0.0")));
    assertNotEquals(r1, r2);
}
 
Example #21
Source File: SpiderWebPlot.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Creates a new spider web plot with the given dataset.
 *
 * @param dataset  the dataset.
 * @param extract  controls how data is extracted ({@link TableOrder#BY_ROW}
 *                 or {@link TableOrder#BY_COLUMN}).
 */
public SpiderWebPlot(CategoryDataset dataset, TableOrder extract) {
    super();
    ParamChecks.nullNotPermitted(extract, "extract");
    this.dataset = dataset;
    if (dataset != null) {
        dataset.addChangeListener(this);
    }

    this.dataExtractOrder = extract;
    this.headPercent = DEFAULT_HEAD;
    this.axisLabelGap = DEFAULT_AXIS_LABEL_GAP;
    this.axisLinePaint = Color.black;
    this.axisLineStroke = new BasicStroke(1.0f);

    this.interiorGap = DEFAULT_INTERIOR_GAP;
    this.startAngle = DEFAULT_START_ANGLE;
    this.direction = Rotation.CLOCKWISE;
    this.maxValue = DEFAULT_MAX_VALUE;

    this.seriesPaint = null;
    this.seriesPaintList = new PaintList();
    this.baseSeriesPaint = null;

    this.seriesOutlinePaint = null;
    this.seriesOutlinePaintList = new PaintList();
    this.baseSeriesOutlinePaint = DEFAULT_OUTLINE_PAINT;

    this.seriesOutlineStroke = null;
    this.seriesOutlineStrokeList = new StrokeList();
    this.baseSeriesOutlineStroke = DEFAULT_OUTLINE_STROKE;

    this.labelFont = DEFAULT_LABEL_FONT;
    this.labelPaint = DEFAULT_LABEL_PAINT;
    this.labelGenerator = new StandardCategoryItemLabelGenerator();

    this.legendItemShape = DEFAULT_LEGEND_ITEM_CIRCLE;
}
 
Example #22
Source File: SpiderWebPlot.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Creates a new spider web plot with the given dataset.
 *
 * @param dataset  the dataset.
 * @param extract  controls how data is extracted ({@link TableOrder#BY_ROW}
 *                 or {@link TableOrder#BY_COLUMN}).
 */
public SpiderWebPlot(CategoryDataset dataset, TableOrder extract) {
    super();
    ParamChecks.nullNotPermitted(extract, "extract");
    this.dataset = dataset;
    if (dataset != null) {
        dataset.addChangeListener(this);
    }

    this.dataExtractOrder = extract;
    this.headPercent = DEFAULT_HEAD;
    this.axisLabelGap = DEFAULT_AXIS_LABEL_GAP;
    this.axisLinePaint = Color.black;
    this.axisLineStroke = new BasicStroke(1.0f);

    this.interiorGap = DEFAULT_INTERIOR_GAP;
    this.startAngle = DEFAULT_START_ANGLE;
    this.direction = Rotation.CLOCKWISE;
    this.maxValue = DEFAULT_MAX_VALUE;

    this.seriesPaint = null;
    this.seriesPaintList = new PaintList();
    this.baseSeriesPaint = null;

    this.seriesOutlinePaint = null;
    this.seriesOutlinePaintList = new PaintList();
    this.baseSeriesOutlinePaint = DEFAULT_OUTLINE_PAINT;

    this.seriesOutlineStroke = null;
    this.seriesOutlineStrokeList = new StrokeList();
    this.baseSeriesOutlineStroke = DEFAULT_OUTLINE_STROKE;

    this.labelFont = DEFAULT_LABEL_FONT;
    this.labelPaint = DEFAULT_LABEL_PAINT;
    this.labelGenerator = new StandardCategoryItemLabelGenerator();

    this.legendItemShape = DEFAULT_LEGEND_ITEM_CIRCLE;
}
 
Example #23
Source File: AbstractCategoryItemRendererTest.java    From ECG-Viewer with GNU General Public License v2.0 5 votes vote down vote up
@Test
public void testEquals_ObjectList() {
    BarRenderer r1 = new BarRenderer();
    r1.setSeriesItemLabelGenerator(0, new StandardCategoryItemLabelGenerator());
    BarRenderer r2 = new BarRenderer();
    r2.setSeriesItemLabelGenerator(0, new StandardCategoryItemLabelGenerator());
    assertEquals(r1, r2);
    r2.setSeriesItemLabelGenerator(1, new StandardCategoryItemLabelGenerator("X", new DecimalFormat("0.0")));
    assertNotEquals(r1, r2);
}
 
Example #24
Source File: AbstractCategoryItemRendererTest.java    From openstock with GNU General Public License v3.0 5 votes vote down vote up
@Test
public void testEquals_ObjectList() {
    BarRenderer r1 = new BarRenderer();
    r1.setSeriesItemLabelGenerator(0, new StandardCategoryItemLabelGenerator());
    BarRenderer r2 = new BarRenderer();
    r2.setSeriesItemLabelGenerator(0, new StandardCategoryItemLabelGenerator());
    assertEquals(r1, r2);
    r2.setSeriesItemLabelGenerator(1, new StandardCategoryItemLabelGenerator("X", new DecimalFormat("0.0")));
    assertNotEquals(r1, r2);
}
 
Example #25
Source File: BarRendererTest.java    From ECG-Viewer with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Confirm that cloning works.
 */
@Test
public void testCloning() throws CloneNotSupportedException {
    BarRenderer r1 = new BarRenderer();
    r1.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator());
    r1.setBarPainter(new GradientBarPainter(0.11, 0.22, 0.33));
    BarRenderer r2 = (BarRenderer) r1.clone();
    assertTrue(r1 != r2);
    assertTrue(r1.getClass() == r2.getClass());
    assertTrue(r1.equals(r2));
}
 
Example #26
Source File: SpiderWebPlot.java    From openstock with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Creates a new spider web plot with the given dataset.
 *
 * @param dataset  the dataset.
 * @param extract  controls how data is extracted ({@link TableOrder#BY_ROW}
 *                 or {@link TableOrder#BY_COLUMN}).
 */
public SpiderWebPlot(CategoryDataset dataset, TableOrder extract) {
    super();
    ParamChecks.nullNotPermitted(extract, "extract");
    this.dataset = dataset;
    if (dataset != null) {
        dataset.addChangeListener(this);
    }

    this.dataExtractOrder = extract;
    this.headPercent = DEFAULT_HEAD;
    this.axisLabelGap = DEFAULT_AXIS_LABEL_GAP;
    this.axisLinePaint = Color.black;
    this.axisLineStroke = new BasicStroke(1.0f);

    this.interiorGap = DEFAULT_INTERIOR_GAP;
    this.startAngle = DEFAULT_START_ANGLE;
    this.direction = Rotation.CLOCKWISE;
    this.maxValue = DEFAULT_MAX_VALUE;

    this.seriesPaint = null;
    this.seriesPaintList = new PaintList();
    this.baseSeriesPaint = null;

    this.seriesOutlinePaint = null;
    this.seriesOutlinePaintList = new PaintList();
    this.baseSeriesOutlinePaint = DEFAULT_OUTLINE_PAINT;

    this.seriesOutlineStroke = null;
    this.seriesOutlineStrokeList = new StrokeList();
    this.baseSeriesOutlineStroke = DEFAULT_OUTLINE_STROKE;

    this.labelFont = DEFAULT_LABEL_FONT;
    this.labelPaint = DEFAULT_LABEL_PAINT;
    this.labelGenerator = new StandardCategoryItemLabelGenerator();

    this.legendItemShape = DEFAULT_LEGEND_ITEM_CIRCLE;
}
 
Example #27
Source File: BarRendererTest.java    From ccu-historian with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Confirm that cloning works.
 */
@Test
public void testCloning() throws CloneNotSupportedException {
    BarRenderer r1 = new BarRenderer();
    r1.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator());
    r1.setBarPainter(new GradientBarPainter(0.11, 0.22, 0.33));
    BarRenderer r2 = (BarRenderer) r1.clone();
    assertTrue(r1 != r2);
    assertTrue(r1.getClass() == r2.getClass());
    assertTrue(r1.equals(r2));
}
 
Example #28
Source File: SpiderWebPlot.java    From SIMVA-SoS with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a new spider web plot with the given dataset.
 *
 * @param dataset  the dataset.
 * @param extract  controls how data is extracted ({@link TableOrder#BY_ROW}
 *                 or {@link TableOrder#BY_COLUMN}).
 */
public SpiderWebPlot(CategoryDataset dataset, TableOrder extract) {
    super();
    ParamChecks.nullNotPermitted(extract, "extract");
    this.dataset = dataset;
    if (dataset != null) {
        dataset.addChangeListener(this);
    }

    this.dataExtractOrder = extract;
    this.headPercent = DEFAULT_HEAD;
    this.axisLabelGap = DEFAULT_AXIS_LABEL_GAP;
    this.axisLinePaint = Color.black;
    this.axisLineStroke = new BasicStroke(1.0f);

    this.interiorGap = DEFAULT_INTERIOR_GAP;
    this.startAngle = DEFAULT_START_ANGLE;
    this.direction = Rotation.CLOCKWISE;
    this.maxValue = DEFAULT_MAX_VALUE;

    this.seriesPaint = null;
    this.seriesPaintList = new PaintList();
    this.baseSeriesPaint = null;

    this.seriesOutlinePaint = null;
    this.seriesOutlinePaintList = new PaintList();
    this.baseSeriesOutlinePaint = DEFAULT_OUTLINE_PAINT;

    this.seriesOutlineStroke = null;
    this.seriesOutlineStrokeList = new StrokeList();
    this.baseSeriesOutlineStroke = DEFAULT_OUTLINE_STROKE;

    this.labelFont = DEFAULT_LABEL_FONT;
    this.labelPaint = DEFAULT_LABEL_PAINT;
    this.labelGenerator = new StandardCategoryItemLabelGenerator();

    this.legendItemShape = DEFAULT_LEGEND_ITEM_CIRCLE;
}
 
Example #29
Source File: AbstractCategoryItemRendererTest.java    From SIMVA-SoS with Apache License 2.0 5 votes vote down vote up
@Test
public void testEquals_ObjectList() {
    BarRenderer r1 = new BarRenderer();
    r1.setSeriesItemLabelGenerator(0, new StandardCategoryItemLabelGenerator());
    BarRenderer r2 = new BarRenderer();
    r2.setSeriesItemLabelGenerator(0, new StandardCategoryItemLabelGenerator());
    assertEquals(r1, r2);
    r2.setSeriesItemLabelGenerator(1, new StandardCategoryItemLabelGenerator("X", new DecimalFormat("0.0")));
    assertNotEquals(r1, r2);
}
 
Example #30
Source File: BarRendererTest.java    From openstock with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Confirm that cloning works.
 */
@Test
public void testCloning() throws CloneNotSupportedException {
    BarRenderer r1 = new BarRenderer();
    r1.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator());
    r1.setBarPainter(new GradientBarPainter(0.11, 0.22, 0.33));
    BarRenderer r2 = (BarRenderer) r1.clone();
    assertTrue(r1 != r2);
    assertTrue(r1.getClass() == r2.getClass());
    assertTrue(r1.equals(r2));
}