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


Java CategoryItemRenderer.initialise方法代碼示例

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


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

示例1: render

import org.jfree.chart.renderer.category.CategoryItemRenderer; //導入方法依賴的package包/類
/**
 * Draws a representation of a dataset within the dataArea region using the appropriate
 * renderer.
 *
 * @param g2  the graphics device.
 * @param dataArea  the region in which the data is to be drawn.
 * @param index  the dataset and renderer index.
 * @param info  an optional object for collection dimension information.
 * 
 * @return A boolean that indicates whether or not real data was found.
 */
public boolean render(Graphics2D g2, Rectangle2D dataArea, int index, PlotRenderingInfo info) {

    boolean foundData = false;
    CategoryDataset currentDataset = getDataset(index);
    CategoryItemRenderer renderer = getRenderer(index);
    CategoryAxis domainAxis = getDomainAxisForDataset(index);
    ValueAxis rangeAxis = getRangeAxisForDataset(index);
    if (!DatasetUtilities.isEmptyOrNull(currentDataset) && renderer != null) {
        
        foundData = true;
        CategoryItemRendererState state = renderer.initialise(g2, dataArea, this, index, info);

        int columnCount = currentDataset.getColumnCount();
        int rowCount = currentDataset.getRowCount();
            
        if (this.columnRenderingOrder == SortOrder.ASCENDING) {
            for (int column = 0; column < columnCount; column++) {
                if (this.rowRenderingOrder == SortOrder.ASCENDING) {
                    for (int row = 0; row < rowCount; row++) {
                        renderer.drawItem(
                            g2, state, dataArea, this, domainAxis, rangeAxis,
                            currentDataset, row, column
                        );
                    }
                }
                else {
                    for (int row = rowCount - 1; row >= 0; row--) {
                        renderer.drawItem(
                            g2, state, dataArea, this, domainAxis, rangeAxis,
                            currentDataset, row, column
                        );
                    }                        
                }
            }
        }
        else {
            for (int column = columnCount - 1; column >= 0; column--) {
                if (this.rowRenderingOrder == SortOrder.ASCENDING) {
                    for (int row = 0; row < rowCount; row++) {
                        renderer.drawItem(
                            g2, state, dataArea, this, domainAxis, rangeAxis,
                            currentDataset, row, column
                        );
                    }
                }
                else {
                    for (int row = rowCount - 1; row >= 0; row--) {
                        renderer.drawItem(
                            g2, state, dataArea, this, domainAxis, rangeAxis,
                            currentDataset, row, column
                        );
                    }                        
                }
            }                
        }
    }
    return foundData;
    
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:71,代碼來源:CategoryPlot.java

示例2: render

import org.jfree.chart.renderer.category.CategoryItemRenderer; //導入方法依賴的package包/類
/**
 * Draws a representation of a dataset within the dataArea region using the
 * appropriate renderer.
 *
 * @param g2  the graphics device.
 * @param dataArea  the region in which the data is to be drawn.
 * @param index  the dataset and renderer index.
 * @param info  an optional object for collection dimension information.
 * 
 * @return A boolean that indicates whether or not real data was found.
 */
public boolean render(Graphics2D g2, Rectangle2D dataArea, int index, 
                      PlotRenderingInfo info) {

    boolean foundData = false;
    CategoryDataset currentDataset = getDataset(index);
    CategoryItemRenderer renderer = getRenderer(index);
    CategoryAxis domainAxis = getDomainAxisForDataset(index);
    ValueAxis rangeAxis = getRangeAxisForDataset(index);
    boolean hasData = !DatasetUtilities.isEmptyOrNull(currentDataset);
    if (hasData && renderer != null) {
        
        foundData = true;
        CategoryItemRendererState state = renderer.initialise(g2, dataArea,
                this, index, info);
        int columnCount = currentDataset.getColumnCount();
        int rowCount = currentDataset.getRowCount();
        int passCount = renderer.getPassCount();
        for (int pass = 0; pass < passCount; pass++) {            
            if (this.columnRenderingOrder == SortOrder.ASCENDING) {
                for (int column = 0; column < columnCount; column++) {
                    if (this.rowRenderingOrder == SortOrder.ASCENDING) {
                        for (int row = 0; row < rowCount; row++) {
                            renderer.drawItem(g2, state, dataArea, this, 
                                    domainAxis, rangeAxis, currentDataset, 
                                    row, column, pass);
                        }
                    }
                    else {
                        for (int row = rowCount - 1; row >= 0; row--) {
                            renderer.drawItem(g2, state, dataArea, this, 
                                    domainAxis, rangeAxis, currentDataset, 
                                    row, column, pass);
                        }                        
                    }
                }
            }
            else {
                for (int column = columnCount - 1; column >= 0; column--) {
                    if (this.rowRenderingOrder == SortOrder.ASCENDING) {
                        for (int row = 0; row < rowCount; row++) {
                            renderer.drawItem(g2, state, dataArea, this, 
                                    domainAxis, rangeAxis, currentDataset, 
                                    row, column, pass);
                        }
                    }
                    else {
                        for (int row = rowCount - 1; row >= 0; row--) {
                            renderer.drawItem(g2, state, dataArea, this, 
                                    domainAxis, rangeAxis, currentDataset, 
                                    row, column, pass);
                        }                        
                    }
                }
            }
        }
    }
    return foundData;
    
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:71,代碼來源:CategoryPlot.java

示例3: render

import org.jfree.chart.renderer.category.CategoryItemRenderer; //導入方法依賴的package包/類
/**
 * Draws a representation of a dataset within the dataArea region using the
 * appropriate renderer.
 *
 * @param g2  the graphics device.
 * @param dataArea  the region in which the data is to be drawn.
 * @param index  the dataset and renderer index.
 * @param info  an optional object for collection dimension information.
 * @param crosshairState  a state object for tracking crosshair info
 *        (<code>null</code> permitted).
 *
 * @return A boolean that indicates whether or not real data was found.
 *
 * @since 1.0.11
 */
public boolean render(Graphics2D g2, Rectangle2D dataArea, int index,
        PlotRenderingInfo info, CategoryCrosshairState crosshairState) {

    boolean foundData = false;
    CategoryDataset currentDataset = getDataset(index);
    CategoryItemRenderer renderer = getRenderer(index);
    CategoryAxis domainAxis = getDomainAxisForDataset(index);
    ValueAxis rangeAxis = getRangeAxisForDataset(index);
    boolean hasData = !DatasetUtilities.isEmptyOrNull(currentDataset);
    if (hasData && renderer != null) {

        foundData = true;
        CategoryItemRendererState state = renderer.initialise(g2, dataArea,
                this, index, info);
        state.setCrosshairState(crosshairState);
        int columnCount = currentDataset.getColumnCount();
        int rowCount = currentDataset.getRowCount();
        int passCount = renderer.getPassCount();
        for (int pass = 0; pass < passCount; pass++) {
            if (this.columnRenderingOrder == SortOrder.ASCENDING) {
                for (int column = 0; column < columnCount; column++) {
                    if (this.rowRenderingOrder == SortOrder.ASCENDING) {
                        for (int row = 0; row < rowCount; row++) {
                            renderer.drawItem(g2, state, dataArea, this,
                                    domainAxis, rangeAxis, currentDataset,
                                    row, column, pass);
                        }
                    }
                    else {
                        for (int row = rowCount - 1; row >= 0; row--) {
                            renderer.drawItem(g2, state, dataArea, this,
                                    domainAxis, rangeAxis, currentDataset,
                                    row, column, pass);
                        }
                    }
                }
            }
            else {
                for (int column = columnCount - 1; column >= 0; column--) {
                    if (this.rowRenderingOrder == SortOrder.ASCENDING) {
                        for (int row = 0; row < rowCount; row++) {
                            renderer.drawItem(g2, state, dataArea, this,
                                    domainAxis, rangeAxis, currentDataset,
                                    row, column, pass);
                        }
                    }
                    else {
                        for (int row = rowCount - 1; row >= 0; row--) {
                            renderer.drawItem(g2, state, dataArea, this,
                                    domainAxis, rangeAxis, currentDataset,
                                    row, column, pass);
                        }
                    }
                }
            }
        }
    }
    return foundData;

}
 
開發者ID:mdzio,項目名稱:ccu-historian,代碼行數:76,代碼來源:CategoryPlot.java

示例4: render

import org.jfree.chart.renderer.category.CategoryItemRenderer; //導入方法依賴的package包/類
/**
 * Draws a representation of a dataset within the dataArea region using the
 * appropriate renderer.
 *
 * @param g2  the graphics device.
 * @param dataArea  the region in which the data is to be drawn.
 * @param index  the dataset and renderer index.
 * @param info  an optional object for collection dimension information.
 * @param crosshairState  a state object for tracking crosshair info
 *        ({@code null} permitted).
 *
 * @return A boolean that indicates whether or not real data was found.
 *
 * @since 1.0.11
 */
public boolean render(Graphics2D g2, Rectangle2D dataArea, int index,
        PlotRenderingInfo info, CategoryCrosshairState crosshairState) {

    boolean foundData = false;
    CategoryDataset currentDataset = getDataset(index);
    CategoryItemRenderer renderer = getRenderer(index);
    CategoryAxis domainAxis = getDomainAxisForDataset(index);
    ValueAxis rangeAxis = getRangeAxisForDataset(index);
    boolean hasData = !DatasetUtils.isEmptyOrNull(currentDataset);
    if (hasData && renderer != null) {

        foundData = true;
        CategoryItemRendererState state = renderer.initialise(g2, dataArea,
                this, index, info);
        state.setCrosshairState(crosshairState);
        int columnCount = currentDataset.getColumnCount();
        int rowCount = currentDataset.getRowCount();
        int passCount = renderer.getPassCount();
        for (int pass = 0; pass < passCount; pass++) {
            if (this.columnRenderingOrder == SortOrder.ASCENDING) {
                for (int column = 0; column < columnCount; column++) {
                    if (this.rowRenderingOrder == SortOrder.ASCENDING) {
                        for (int row = 0; row < rowCount; row++) {
                            renderer.drawItem(g2, state, dataArea, this,
                                    domainAxis, rangeAxis, currentDataset,
                                    row, column, pass);
                        }
                    }
                    else {
                        for (int row = rowCount - 1; row >= 0; row--) {
                            renderer.drawItem(g2, state, dataArea, this,
                                    domainAxis, rangeAxis, currentDataset,
                                    row, column, pass);
                        }
                    }
                }
            }
            else {
                for (int column = columnCount - 1; column >= 0; column--) {
                    if (this.rowRenderingOrder == SortOrder.ASCENDING) {
                        for (int row = 0; row < rowCount; row++) {
                            renderer.drawItem(g2, state, dataArea, this,
                                    domainAxis, rangeAxis, currentDataset,
                                    row, column, pass);
                        }
                    }
                    else {
                        for (int row = rowCount - 1; row >= 0; row--) {
                            renderer.drawItem(g2, state, dataArea, this,
                                    domainAxis, rangeAxis, currentDataset,
                                    row, column, pass);
                        }
                    }
                }
            }
        }
    }
    return foundData;

}
 
開發者ID:jfree,項目名稱:jfreechart,代碼行數:76,代碼來源:CategoryPlot.java


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