Java 类org.jfree.chart.axis.CategoryAnchor 实例源码

项目:parabuild-ci    文件:CategoryTextAnnotationTests.java   
/**
 * 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));

}
项目:ccu-historian    文件:CategoryPlot.java   
/**
 * 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);
            }
        }
    }
}
项目:jfreechart    文件:CategoryPlot.java   
/**
 * 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);
            }
        }
    }
}
项目:aya-lang    文件:CategoryPlot.java   
/**
 * 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);
            }
        }
    }
}
项目:populus    文件:CategoryPlot.java   
/**
 * 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);
            }
        }
    }
}
项目:PI    文件:CategoryPlot.java   
/**
 * 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);
            }
        }
    }
}
项目:ECG-Viewer    文件:CategoryPlot.java   
/**
 * 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);
            }
        }
    }
}
项目:group-five    文件:CategoryPlot.java   
/**
 * 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);
            }
        }
    }
}
项目:manydesigns.cn    文件:CategoryPlot.java   
/**
 * 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);
            }
        }
    }
}
项目:buffer_bci    文件:CategoryPlot.java   
/**
 * 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);
            }
        }
    }
}
项目:buffer_bci    文件:CategoryPlot.java   
/**
 * 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);
            }
        }
    }
}
项目:proyecto-teoria-control-utn-frro    文件:CategoryPlot.java   
/**
 * 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);
            }
        }
    }
}
项目:Memetic-Algorithm-for-TSP    文件:CategoryPlot.java   
/**
 * 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);
            }
        }
    }
}
项目:parabuild-ci    文件:CategoryPlot.java   
/**
 * 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);
                        }
                    }
                }
            }
        }
    }
}
项目:parabuild-ci    文件:CategoryAnchorTests.java   
/**
 * 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));
}
项目:parabuild-ci    文件:CategoryAnchorTests.java   
/**
 * 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));
}
项目:parabuild-ci    文件:CategoryAnchorTests.java   
/**
 * 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);
}
项目:parabuild-ci    文件:CategoryTextAnnotationTests.java   
/**
 * 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));

}
项目:parabuild-ci    文件:CategoryPlot.java   
/**
 * 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);
                        }
                    }
                }
            }
        }
    }
}
项目:parabuild-ci    文件:CategoryTextAnnotation.java   
/**
 * 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;
}
项目:ccu-historian    文件:CategoryTextAnnotationTest.java   
/**
 * 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));
}
项目:ccu-historian    文件:CategoryTextAnnotation.java   
/**
 * 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;
}
项目:jfreechart    文件:CategoryTextAnnotation.java   
/**
 * 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;
}
项目:jfreechart    文件:CategoryTextAnnotationTest.java   
/**
 * 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));
}
项目:aya-lang    文件:CategoryTextAnnotationTest.java   
/**
 * 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));
}
项目:aya-lang    文件:CategoryTextAnnotation.java   
/**
 * 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;
}
项目:HTML5_WebSite    文件:CategoryPlot.java   
/**
 * 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);
                        }
                    }
                }
            }
        }
    }
}
项目:HTML5_WebSite    文件:CategoryTextAnnotation.java   
/**
 * 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;
}
项目:populus    文件:CategoryTextAnnotation.java   
/**
 * 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;
}
项目:PI    文件:CategoryTextAnnotation.java   
/**
 * 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;
}
项目:nabs    文件:CategoryAnchorTests.java   
/**
 * 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));
}
项目:nabs    文件:CategoryAnchorTests.java   
/**
 * 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);
}
项目:nabs    文件:CategoryTextAnnotationTests.java   
/**
 * 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));

}
项目:nabs    文件:CategoryPlot.java   
/**
 * 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);
                        }
                    }
                }
            }
        }
    }
}
项目:nabs    文件:CategoryTextAnnotation.java   
/**
 * 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;
}
项目:ECG-Viewer    文件:CategoryTextAnnotationTest.java   
/**
 * 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));
}
项目:ECG-Viewer    文件:CategoryTextAnnotation.java   
/**
 * 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;
}
项目:astor    文件:CategoryAnchorTests.java   
/**
 * 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));
}
项目:astor    文件:CategoryAnchorTests.java   
/**
 * 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);
}
项目:astor    文件:CategoryTextAnnotationTests.java   
/**
 * 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));

}