当前位置: 首页>>代码示例>>Java>>正文


Java CategoryAnchor类代码示例

本文整理汇总了Java中org.jfree.chart.axis.CategoryAnchor的典型用法代码示例。如果您正苦于以下问题:Java CategoryAnchor类的具体用法?Java CategoryAnchor怎么用?Java CategoryAnchor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


CategoryAnchor类属于org.jfree.chart.axis包,在下文中一共展示了CategoryAnchor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testEquals

import org.jfree.chart.axis.CategoryAnchor; //导入依赖的package包/类
/**
 * Confirm that the equals method can distinguish all the required fields.
 */
public void testEquals() {
    
    CategoryTextAnnotation a1 = new CategoryTextAnnotation("Test", "Category", 1.0);
    CategoryTextAnnotation a2 = new CategoryTextAnnotation("Test", "Category", 1.0);
    assertTrue(a1.equals(a2));
    
    // category 
    a1.setCategory("Category 2");
    assertFalse(a1.equals(a2));
    a2.setCategory("Category 2");
    assertTrue(a1.equals(a2));

    // categoryAnchor
    a1.setCategoryAnchor(CategoryAnchor.START);
    assertFalse(a1.equals(a2));
    a2.setCategoryAnchor(CategoryAnchor.START);
    assertTrue(a1.equals(a2));

    // value 
    a1.setValue(0.15);
    assertFalse(a1.equals(a2));
    a2.setValue(0.15);
    assertTrue(a1.equals(a2));
  
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:29,代码来源:CategoryTextAnnotationTests.java

示例2: drawDomainGridlines

import org.jfree.chart.axis.CategoryAnchor; //导入依赖的package包/类
/**
 * Draws the domain gridlines for the plot, if they are visible.
 *
 * @param g2  the graphics device.
 * @param dataArea  the area inside the axes.
 *
 * @see #drawRangeGridlines(Graphics2D, Rectangle2D, List)
 */
protected void drawDomainGridlines(Graphics2D g2, Rectangle2D dataArea) {

    if (!isDomainGridlinesVisible()) {
        return;
    }
    CategoryAnchor anchor = getDomainGridlinePosition();
    RectangleEdge domainAxisEdge = getDomainAxisEdge();
    CategoryDataset dataset = getDataset();
    if (dataset == null) {
        return;
    }
    CategoryAxis axis = getDomainAxis();
    if (axis != null) {
        int columnCount = dataset.getColumnCount();
        for (int c = 0; c < columnCount; c++) {
            double xx = axis.getCategoryJava2DCoordinate(anchor, c,
                    columnCount, dataArea, domainAxisEdge);
            CategoryItemRenderer renderer1 = getRenderer();
            if (renderer1 != null) {
                renderer1.drawDomainGridline(g2, this, dataArea, xx);
            }
        }
    }
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:33,代码来源:CategoryPlot.java

示例3: drawDomainGridlines

import org.jfree.chart.axis.CategoryAnchor; //导入依赖的package包/类
/**
 * Draws the gridlines for the plot.
 *
 * @param g2  the graphics device.
 * @param dataArea  the area inside the axes.
 */
protected void drawDomainGridlines(Graphics2D g2, Rectangle2D dataArea) {

    // draw the domain grid lines, if any...
    if (isDomainGridlinesVisible()) {
        CategoryAnchor anchor = getDomainGridlinePosition();
        RectangleEdge domainAxisEdge = getDomainAxisEdge();
        Stroke gridStroke = getDomainGridlineStroke();
        Paint gridPaint = getDomainGridlinePaint();
        if ((gridStroke != null) && (gridPaint != null)) {
            // iterate over the categories
            CategoryDataset data = getDataset();
            if (data != null) {
                CategoryAxis axis = getDomainAxis();
                if (axis != null) {
                    int columnCount = data.getColumnCount();
                    for (int c = 0; c < columnCount; c++) {
                        double xx = axis.getCategoryJava2DCoordinate(
                            anchor, c, columnCount, dataArea, domainAxisEdge
                        );
                        CategoryItemRenderer renderer1 = getRenderer();
                        if (renderer1 != null) {
                            renderer1.drawDomainGridline(g2, this, dataArea, xx);
                        }
                    }
                }
            }
        }
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:36,代码来源:CategoryPlot.java

示例4: testEquals

import org.jfree.chart.axis.CategoryAnchor; //导入依赖的package包/类
/**
 * Problem equals method.
 */
public void testEquals() {
    assertEquals(CategoryAnchor.START, CategoryAnchor.START);
    assertEquals(CategoryAnchor.MIDDLE, CategoryAnchor.MIDDLE);
    assertEquals(CategoryAnchor.END, CategoryAnchor.END);
    assertFalse(CategoryAnchor.START.equals(CategoryAnchor.END));
    assertFalse(CategoryAnchor.MIDDLE.equals(CategoryAnchor.END));
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:11,代码来源:CategoryAnchorTests.java

示例5: testEquals

import org.jfree.chart.axis.CategoryAnchor; //导入依赖的package包/类
/**
 * Check that the equals() method distinguishes known instances.
 */
public void testEquals() {
    assertEquals(CategoryAnchor.START, CategoryAnchor.START);
    assertEquals(CategoryAnchor.MIDDLE, CategoryAnchor.MIDDLE);
    assertEquals(CategoryAnchor.END, CategoryAnchor.END);
    assertFalse(CategoryAnchor.START.equals(CategoryAnchor.END));
    assertFalse(CategoryAnchor.MIDDLE.equals(CategoryAnchor.END));
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:11,代码来源:CategoryAnchorTests.java

示例6: testHashCode

import org.jfree.chart.axis.CategoryAnchor; //导入依赖的package包/类
/**
 * Two objects that are equal are required to return the same hashCode. 
 */
public void testHashCode() {
    CategoryAnchor a1 = CategoryAnchor.START;
    CategoryAnchor a2 = CategoryAnchor.START;
    assertTrue(a1.equals(a2));
    int h1 = a1.hashCode();
    int h2 = a2.hashCode();
    assertEquals(h1, h2);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:12,代码来源:CategoryAnchorTests.java

示例7: testEquals

import org.jfree.chart.axis.CategoryAnchor; //导入依赖的package包/类
/**
 * Confirm that the equals method can distinguish all the required fields.
 */
public void testEquals() {
    
    CategoryTextAnnotation a1 = new CategoryTextAnnotation(
        "Test", "Category", 1.0
    );
    CategoryTextAnnotation a2 = new CategoryTextAnnotation(
        "Test", "Category", 1.0
    );
    assertTrue(a1.equals(a2));
    
    // category 
    a1.setCategory("Category 2");
    assertFalse(a1.equals(a2));
    a2.setCategory("Category 2");
    assertTrue(a1.equals(a2));

    // categoryAnchor
    a1.setCategoryAnchor(CategoryAnchor.START);
    assertFalse(a1.equals(a2));
    a2.setCategoryAnchor(CategoryAnchor.START);
    assertTrue(a1.equals(a2));

    // value 
    a1.setValue(0.15);
    assertFalse(a1.equals(a2));
    a2.setValue(0.15);
    assertTrue(a1.equals(a2));
  
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:33,代码来源:CategoryTextAnnotationTests.java

示例8: drawDomainGridlines

import org.jfree.chart.axis.CategoryAnchor; //导入依赖的package包/类
/**
 * Draws the gridlines for the plot.
 *
 * @param g2  the graphics device.
 * @param dataArea  the area inside the axes.
 * 
 * @see #drawRangeGridlines(Graphics2D, Rectangle2D, List)
 */
protected void drawDomainGridlines(Graphics2D g2, Rectangle2D dataArea) {

    // draw the domain grid lines, if any...
    if (isDomainGridlinesVisible()) {
        CategoryAnchor anchor = getDomainGridlinePosition();
        RectangleEdge domainAxisEdge = getDomainAxisEdge();
        Stroke gridStroke = getDomainGridlineStroke();
        Paint gridPaint = getDomainGridlinePaint();
        if ((gridStroke != null) && (gridPaint != null)) {
            // iterate over the categories
            CategoryDataset data = getDataset();
            if (data != null) {
                CategoryAxis axis = getDomainAxis();
                if (axis != null) {
                    int columnCount = data.getColumnCount();
                    for (int c = 0; c < columnCount; c++) {
                        double xx = axis.getCategoryJava2DCoordinate(
                                anchor, c, columnCount, dataArea, 
                                domainAxisEdge);
                        CategoryItemRenderer renderer1 = getRenderer();
                        if (renderer1 != null) {
                            renderer1.drawDomainGridline(g2, this, 
                                    dataArea, xx);
                        }
                    }
                }
            }
        }
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:39,代码来源:CategoryPlot.java

示例9: CategoryTextAnnotation

import org.jfree.chart.axis.CategoryAnchor; //导入依赖的package包/类
/**
 * Creates a new annotation to be displayed at the given location.
 *
 * @param text  the text (<code>null</code> not permitted).
 * @param category  the category (<code>null</code> not permitted).
 * @param value  the value.
 */
public CategoryTextAnnotation(String text, Comparable category, 
                              double value) {
    super(text);
    if (category == null) {
        throw new IllegalArgumentException("Null 'category' argument.");   
    }
    this.category = category;
    this.value = value;
    this.categoryAnchor = CategoryAnchor.MIDDLE;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:18,代码来源:CategoryTextAnnotation.java

示例10: testEquals

import org.jfree.chart.axis.CategoryAnchor; //导入依赖的package包/类
/**
 * Confirm that the equals method can distinguish all the required fields.
 */
@Test
public void testEquals() {
    CategoryTextAnnotation a1 = new CategoryTextAnnotation("Test", 
            "Category", 1.0);
    CategoryTextAnnotation a2 = new CategoryTextAnnotation("Test", 
            "Category", 1.0);
    assertTrue(a1.equals(a2));

    // category
    a1.setCategory("Category 2");
    assertFalse(a1.equals(a2));
    a2.setCategory("Category 2");
    assertTrue(a1.equals(a2));

    // categoryAnchor
    a1.setCategoryAnchor(CategoryAnchor.START);
    assertFalse(a1.equals(a2));
    a2.setCategoryAnchor(CategoryAnchor.START);
    assertTrue(a1.equals(a2));

    // value
    a1.setValue(0.15);
    assertFalse(a1.equals(a2));
    a2.setValue(0.15);
    assertTrue(a1.equals(a2));
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:30,代码来源:CategoryTextAnnotationTest.java

示例11: CategoryTextAnnotation

import org.jfree.chart.axis.CategoryAnchor; //导入依赖的package包/类
/**
 * Creates a new annotation to be displayed at the given location.
 *
 * @param text  the text (<code>null</code> not permitted).
 * @param category  the category (<code>null</code> not permitted).
 * @param value  the value.
 */
public CategoryTextAnnotation(String text, Comparable category,
                              double value) {
    super(text);
    ParamChecks.nullNotPermitted(category, "category");
    this.category = category;
    this.value = value;
    this.categoryAnchor = CategoryAnchor.MIDDLE;
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:16,代码来源:CategoryTextAnnotation.java

示例12: CategoryTextAnnotation

import org.jfree.chart.axis.CategoryAnchor; //导入依赖的package包/类
/**
 * Creates a new annotation to be displayed at the given location.
 *
 * @param text  the text ({@code null} not permitted).
 * @param category  the category ({@code null} not permitted).
 * @param value  the value.
 */
public CategoryTextAnnotation(String text, Comparable category,
                              double value) {
    super(text);
    Args.nullNotPermitted(category, "category");
    this.category = category;
    this.value = value;
    this.categoryAnchor = CategoryAnchor.MIDDLE;
}
 
开发者ID:jfree,项目名称:jfreechart,代码行数:16,代码来源:CategoryTextAnnotation.java

示例13: drawDomainGridlines

import org.jfree.chart.axis.CategoryAnchor; //导入依赖的package包/类
/**
 * Draws the gridlines for the plot.
 *
 * @param g2  the graphics device.
 * @param dataArea  the area inside the axes.
 *
 * @see #drawRangeGridlines(Graphics2D, Rectangle2D, List)
 */
protected void drawDomainGridlines(Graphics2D g2, Rectangle2D dataArea) {

    // draw the domain grid lines, if any...
    if (isDomainGridlinesVisible()) {
        CategoryAnchor anchor = getDomainGridlinePosition();
        RectangleEdge domainAxisEdge = getDomainAxisEdge();
        Stroke gridStroke = getDomainGridlineStroke();
        Paint gridPaint = getDomainGridlinePaint();
        if ((gridStroke != null) && (gridPaint != null)) {
            // iterate over the categories
            CategoryDataset data = getDataset();
            if (data != null) {
                CategoryAxis axis = getDomainAxis();
                if (axis != null) {
                    int columnCount = data.getColumnCount();
                    for (int c = 0; c < columnCount; c++) {
                        double xx = axis.getCategoryJava2DCoordinate(
                                anchor, c, columnCount, dataArea,
                                domainAxisEdge);
                        CategoryItemRenderer renderer1 = getRenderer();
                        if (renderer1 != null) {
                            renderer1.drawDomainGridline(g2, this,
                                    dataArea, xx);
                        }
                    }
                }
            }
        }
    }
}
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:39,代码来源:CategoryPlot.java

示例14: CategoryTextAnnotation

import org.jfree.chart.axis.CategoryAnchor; //导入依赖的package包/类
/**
 * Creates a new annotation to be displayed at the given location.
 *
 * @param text  the text (<code>null</code> not permitted).
 * @param category  the category (<code>null</code> not permitted).
 * @param value  the value.
 */
public CategoryTextAnnotation(String text, Comparable category,
                              double value) {
    super(text);
    if (category == null) {
        throw new IllegalArgumentException("Null 'category' argument.");
    }
    this.category = category;
    this.value = value;
    this.categoryAnchor = CategoryAnchor.MIDDLE;
}
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:18,代码来源:CategoryTextAnnotation.java

示例15: testHashCode

import org.jfree.chart.axis.CategoryAnchor; //导入依赖的package包/类
/**
 * Two objects that are equal are required to return the same hashCode.
 */
public void testHashCode() {
    CategoryAnchor a1 = CategoryAnchor.START;
    CategoryAnchor a2 = CategoryAnchor.START;
    assertTrue(a1.equals(a2));
    int h1 = a1.hashCode();
    int h2 = a2.hashCode();
    assertEquals(h1, h2);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:12,代码来源:CategoryAnchorTests.java


注:本文中的org.jfree.chart.axis.CategoryAnchor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。