Java 类org.jfree.chart.labels.IntervalCategoryItemLabelGenerator 实例源码

项目:ezScrum    文件:ScheduleReport.java   
private void setAttribute(JFreeChart chart) {
    // 圖案與文字的間隔
    LegendTitle legend = chart.getLegend();
    legend.setBorder(1, 1, 1, 1);

    CategoryPlot plot = chart.getCategoryPlot();
    // 設定WorkItem的屬性
    CategoryAxis domainAxis = plot.getDomainAxis();
    domainAxis.setCategoryLabelPositions(CategoryLabelPositions.DOWN_45); // 字體角度
    domainAxis.setTickLabelFont(new Font("新細明體", Font.TRUETYPE_FONT, 12)); // 字體

    // 設定Date的屬性
    DateAxis da = (DateAxis) plot.getRangeAxis(0);
    setDateAxis(da);

    // 設定實體的顯示名稱
    CategoryItemRenderer render = plot.getRenderer(0);
    DateFormat format = new SimpleDateFormat("yyyy-MM-dd");
    CategoryItemLabelGenerator generator = new IntervalCategoryItemLabelGenerator(
            "{3} ~ {4}", format);
    render.setBaseItemLabelGenerator(generator);
    render.setBaseItemLabelPaint(Color.BLUE);
    render.setBaseItemLabelsVisible(true);
    render.setBaseItemLabelFont(new Font("黑體", Font.TRUETYPE_FONT, 8));
    render.setSeriesPaint(0, Color.RED);
}
项目:ccu-historian    文件:AbstractCategoryItemRendererTest.java   
/**
 * Confirm that cloning works.
 */
@Test
public void testCloning2() throws CloneNotSupportedException {
    BarRenderer r1 = new BarRenderer();
    r1.setBaseItemLabelGenerator(new IntervalCategoryItemLabelGenerator());
    BarRenderer r2 = (BarRenderer) r1.clone();

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

    r1 = new BarRenderer();
    r1.setSeriesItemLabelGenerator(0,
            new IntervalCategoryItemLabelGenerator());
    r2 = (BarRenderer) r1.clone();
    assertTrue(r1 != r2);
    assertTrue(r1.getClass() == r2.getClass());
    assertTrue(r1.equals(r2));

    r1 = new BarRenderer();
    r1.setBaseItemLabelGenerator(new IntervalCategoryItemLabelGenerator());
    r2 = (BarRenderer) r1.clone();

    assertTrue(r1 != r2);
    assertTrue(r1.getClass() == r2.getClass());
    assertTrue(r1.equals(r2));
}
项目:jfreechart    文件:AbstractCategoryItemRendererTest.java   
/**
 * Confirm that cloning works.
 */
@Test
public void testCloning2() throws CloneNotSupportedException {
    BarRenderer r1 = new BarRenderer();
    r1.setDefaultItemLabelGenerator(new IntervalCategoryItemLabelGenerator());
    BarRenderer r2 = (BarRenderer) r1.clone();

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

    r1 = new BarRenderer();
    r1.setSeriesItemLabelGenerator(0,
            new IntervalCategoryItemLabelGenerator());
    r2 = (BarRenderer) r1.clone();
    assertTrue(r1 != r2);
    assertTrue(r1.getClass() == r2.getClass());
    assertTrue(r1.equals(r2));

    r1 = new BarRenderer();
    r1.setDefaultItemLabelGenerator(new IntervalCategoryItemLabelGenerator());
    r2 = (BarRenderer) r1.clone();

    assertTrue(r1 != r2);
    assertTrue(r1.getClass() == r2.getClass());
    assertTrue(r1.equals(r2));
}
项目:aya-lang    文件:AbstractCategoryItemRendererTest.java   
/**
 * Confirm that cloning works.
 */
@Test
public void testCloning2() throws CloneNotSupportedException {
    BarRenderer r1 = new BarRenderer();
    r1.setBaseItemLabelGenerator(new IntervalCategoryItemLabelGenerator());
    BarRenderer r2 = (BarRenderer) r1.clone();

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

    r1 = new BarRenderer();
    r1.setSeriesItemLabelGenerator(0,
            new IntervalCategoryItemLabelGenerator());
    r2 = (BarRenderer) r1.clone();
    assertTrue(r1 != r2);
    assertTrue(r1.getClass() == r2.getClass());
    assertTrue(r1.equals(r2));

    r1 = new BarRenderer();
    r1.setBaseItemLabelGenerator(new IntervalCategoryItemLabelGenerator());
    r2 = (BarRenderer) r1.clone();

    assertTrue(r1 != r2);
    assertTrue(r1.getClass() == r2.getClass());
    assertTrue(r1.equals(r2));
}
项目:ECG-Viewer    文件:AbstractCategoryItemRendererTest.java   
/**
 * Confirm that cloning works.
 */
@Test
public void testCloning2() throws CloneNotSupportedException {
    BarRenderer r1 = new BarRenderer();
    r1.setBaseItemLabelGenerator(new IntervalCategoryItemLabelGenerator());
    BarRenderer r2 = (BarRenderer) r1.clone();

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

    r1 = new BarRenderer();
    r1.setSeriesItemLabelGenerator(0,
            new IntervalCategoryItemLabelGenerator());
    r2 = (BarRenderer) r1.clone();
    assertTrue(r1 != r2);
    assertTrue(r1.getClass() == r2.getClass());
    assertTrue(r1.equals(r2));

    r1 = new BarRenderer();
    r1.setBaseItemLabelGenerator(new IntervalCategoryItemLabelGenerator());
    r2 = (BarRenderer) r1.clone();

    assertTrue(r1 != r2);
    assertTrue(r1.getClass() == r2.getClass());
    assertTrue(r1.equals(r2));
}
项目:astor    文件:IntervalCategoryItemLabelGeneratorTests.java   
/**
 * Simple check that hashCode is implemented.
 */
public void testHashCode() {
    IntervalCategoryItemLabelGenerator g1
            = new IntervalCategoryItemLabelGenerator();
    IntervalCategoryItemLabelGenerator g2
            = new IntervalCategoryItemLabelGenerator();
    assertTrue(g1.equals(g2));
    assertTrue(g1.hashCode() == g2.hashCode());
}
项目:group-five    文件:AbstractCategoryItemRendererTest.java   
/**
 * Confirm that cloning works.
 */
@Test
public void testCloning2() throws CloneNotSupportedException {
    BarRenderer r1 = new BarRenderer();
    r1.setBaseItemLabelGenerator(new IntervalCategoryItemLabelGenerator());
    BarRenderer r2 = (BarRenderer) r1.clone();

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

    r1 = new BarRenderer();
    r1.setSeriesItemLabelGenerator(0,
            new IntervalCategoryItemLabelGenerator());
    r2 = (BarRenderer) r1.clone();
    assertTrue(r1 != r2);
    assertTrue(r1.getClass() == r2.getClass());
    assertTrue(r1.equals(r2));

    r1 = new BarRenderer();
    r1.setBaseItemLabelGenerator(new IntervalCategoryItemLabelGenerator());
    r2 = (BarRenderer) r1.clone();

    assertTrue(r1 != r2);
    assertTrue(r1.getClass() == r2.getClass());
    assertTrue(r1.equals(r2));
}
项目:buffer_bci    文件:AbstractCategoryItemRendererTest.java   
/**
 * Confirm that cloning works.
 */
@Test
public void testCloning2() throws CloneNotSupportedException {
    BarRenderer r1 = new BarRenderer();
    r1.setBaseItemLabelGenerator(new IntervalCategoryItemLabelGenerator());
    BarRenderer r2 = (BarRenderer) r1.clone();

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

    r1 = new BarRenderer();
    r1.setSeriesItemLabelGenerator(0,
            new IntervalCategoryItemLabelGenerator());
    r2 = (BarRenderer) r1.clone();
    assertTrue(r1 != r2);
    assertTrue(r1.getClass() == r2.getClass());
    assertTrue(r1.equals(r2));

    r1 = new BarRenderer();
    r1.setBaseItemLabelGenerator(new IntervalCategoryItemLabelGenerator());
    r2 = (BarRenderer) r1.clone();

    assertTrue(r1 != r2);
    assertTrue(r1.getClass() == r2.getClass());
    assertTrue(r1.equals(r2));
}
项目:proyecto-teoria-control-utn-frro    文件:AbstractCategoryItemRendererTest.java   
/**
 * Confirm that cloning works.
 */
@Test
public void testCloning2() throws CloneNotSupportedException {
    BarRenderer r1 = new BarRenderer();
    r1.setBaseItemLabelGenerator(new IntervalCategoryItemLabelGenerator());
    BarRenderer r2 = (BarRenderer) r1.clone();

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

    r1 = new BarRenderer();
    r1.setSeriesItemLabelGenerator(0,
            new IntervalCategoryItemLabelGenerator());
    r2 = (BarRenderer) r1.clone();
    assertTrue(r1 != r2);
    assertTrue(r1.getClass() == r2.getClass());
    assertTrue(r1.equals(r2));

    r1 = new BarRenderer();
    r1.setBaseItemLabelGenerator(new IntervalCategoryItemLabelGenerator());
    r2 = (BarRenderer) r1.clone();

    assertTrue(r1 != r2);
    assertTrue(r1.getClass() == r2.getClass());
    assertTrue(r1.equals(r2));
}
项目:Memetic-Algorithm-for-TSP    文件:AbstractCategoryItemRendererTest.java   
/**
 * Confirm that cloning works.
 */
@Test
public void testCloning2() throws CloneNotSupportedException {
    BarRenderer r1 = new BarRenderer();
    r1.setBaseItemLabelGenerator(new IntervalCategoryItemLabelGenerator());
    BarRenderer r2 = (BarRenderer) r1.clone();

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

    r1 = new BarRenderer();
    r1.setSeriesItemLabelGenerator(0,
            new IntervalCategoryItemLabelGenerator());
    r2 = (BarRenderer) r1.clone();
    assertTrue(r1 != r2);
    assertTrue(r1.getClass() == r2.getClass());
    assertTrue(r1.equals(r2));

    r1 = new BarRenderer();
    r1.setBaseItemLabelGenerator(new IntervalCategoryItemLabelGenerator());
    r2 = (BarRenderer) r1.clone();

    assertTrue(r1 != r2);
    assertTrue(r1.getClass() == r2.getClass());
    assertTrue(r1.equals(r2));
}
项目:astor    文件:IntervalCategoryItemLabelGeneratorTests.java   
/**
 * Check to ensure that this class implements PublicCloneable.
 */
public void testPublicCloneable() {
    IntervalCategoryItemLabelGenerator g1
            = new IntervalCategoryItemLabelGenerator();
    assertTrue(g1 instanceof PublicCloneable);
}