當前位置: 首頁>>代碼示例>>Java>>正文


Java CategoryPlot.getDomainGridlinePaint方法代碼示例

本文整理匯總了Java中org.jfree.chart.plot.CategoryPlot.getDomainGridlinePaint方法的典型用法代碼示例。如果您正苦於以下問題:Java CategoryPlot.getDomainGridlinePaint方法的具體用法?Java CategoryPlot.getDomainGridlinePaint怎麽用?Java CategoryPlot.getDomainGridlinePaint使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.jfree.chart.plot.CategoryPlot的用法示例。


在下文中一共展示了CategoryPlot.getDomainGridlinePaint方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: drawDomainGridline

import org.jfree.chart.plot.CategoryPlot; //導入方法依賴的package包/類
/**
 * Draws a grid line against the domain axis.
 * <P>
 * Note that this default implementation assumes that the horizontal axis is the domain axis.
 * If this is not the case, you will need to override this method.
 *
 * @param g2  the graphics device.
 * @param plot  the plot.
 * @param dataArea  the area for plotting data (not yet adjusted for any 3D effect).
 * @param value  the Java2D value at which the grid line should be drawn.
 */
public void drawDomainGridline(Graphics2D g2,
                               CategoryPlot plot,
                               Rectangle2D dataArea,
                               double value) {

    Line2D line = null;
    PlotOrientation orientation = plot.getOrientation();

    if (orientation == PlotOrientation.HORIZONTAL) {
        line = new Line2D.Double(dataArea.getMinX(), value, dataArea.getMaxX(), value);
    }
    else if (orientation == PlotOrientation.VERTICAL) {
        line = new Line2D.Double(value, dataArea.getMinY(), value, dataArea.getMaxY());
    }

    Paint paint = plot.getDomainGridlinePaint();
    if (paint == null) {
        paint = CategoryPlot.DEFAULT_GRIDLINE_PAINT;
    }
    g2.setPaint(paint);

    Stroke stroke = plot.getDomainGridlineStroke();
    if (stroke == null) {
        stroke = CategoryPlot.DEFAULT_GRIDLINE_STROKE;
    }
    g2.setStroke(stroke);

    g2.draw(line);

}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:42,代碼來源:AbstractCategoryItemRenderer.java

示例2: drawDomainGridline

import org.jfree.chart.plot.CategoryPlot; //導入方法依賴的package包/類
/**
 * Draws a grid line against the domain axis.
 * <P>
 * Note that this default implementation assumes that the horizontal axis
 * is the domain axis. If this is not the case, you will need to override
 * this method.
 *
 * @param g2  the graphics device.
 * @param plot  the plot.
 * @param dataArea  the area for plotting data (not yet adjusted for any
 *                  3D effect).
 * @param value  the Java2D value at which the grid line should be drawn.
 *
 * @see #drawRangeGridline(Graphics2D, CategoryPlot, ValueAxis,
 *     Rectangle2D, double)
 */
public void drawDomainGridline(Graphics2D g2,
                               CategoryPlot plot,
                               Rectangle2D dataArea,
                               double value) {

    Line2D line = null;
    PlotOrientation orientation = plot.getOrientation();

    if (orientation == PlotOrientation.HORIZONTAL) {
        line = new Line2D.Double(dataArea.getMinX(), value,
                dataArea.getMaxX(), value);
    }
    else if (orientation == PlotOrientation.VERTICAL) {
        line = new Line2D.Double(value, dataArea.getMinY(), value,
                dataArea.getMaxY());
    }

    Paint paint = plot.getDomainGridlinePaint();
    if (paint == null) {
        paint = CategoryPlot.DEFAULT_GRIDLINE_PAINT;
    }
    g2.setPaint(paint);

    Stroke stroke = plot.getDomainGridlineStroke();
    if (stroke == null) {
        stroke = CategoryPlot.DEFAULT_GRIDLINE_STROKE;
    }
    g2.setStroke(stroke);

    g2.draw(line);

}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:49,代碼來源:AbstractCategoryItemRenderer.java


注:本文中的org.jfree.chart.plot.CategoryPlot.getDomainGridlinePaint方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。