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


Java GanttCategoryDataset类代码示例

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


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

示例1: drawItem

import org.jfree.data.gantt.GanttCategoryDataset; //导入依赖的package包/类
/**
 * Draws the bar for a single (series, category) data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the data area.
 * @param plot  the plot.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param dataset  the dataset.
 * @param row  the row index (zero-based).
 * @param column  the column index (zero-based).
 */
public void drawItem(Graphics2D g2,
                     CategoryItemRendererState state,
                     Rectangle2D dataArea,
                     CategoryPlot plot,
                     CategoryAxis domainAxis,
                     ValueAxis rangeAxis,
                     CategoryDataset dataset,
                     int row,
                     int column) {

     if (dataset instanceof GanttCategoryDataset) {
         GanttCategoryDataset gcd = (GanttCategoryDataset) dataset;
         drawTasks(g2, state, dataArea, plot, domainAxis, rangeAxis, gcd, row, column);
     }
     else {  // let the superclass handle it...
         super.drawItem(g2, state, dataArea, plot, domainAxis, rangeAxis, dataset, row, column);
     }
 
 }
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:33,代码来源:GanttRenderer.java

示例2: drawItem

import org.jfree.data.gantt.GanttCategoryDataset; //导入依赖的package包/类
/**
 * Draws the bar for a single (series, category) data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the data area.
 * @param plot  the plot.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param dataset  the dataset.
 * @param row  the row index (zero-based).
 * @param column  the column index (zero-based).
 * @param pass  the pass index.
 */
public void drawItem(Graphics2D g2,
                     CategoryItemRendererState state,
                     Rectangle2D dataArea,
                     CategoryPlot plot,
                     CategoryAxis domainAxis,
                     ValueAxis rangeAxis,
                     CategoryDataset dataset,
                     int row,
                     int column,
                     int pass) {

     if (dataset instanceof GanttCategoryDataset) {
         GanttCategoryDataset gcd = (GanttCategoryDataset) dataset;
         drawTasks(g2, state, dataArea, plot, domainAxis, rangeAxis, gcd, 
                 row, column);
     }
     else {  // let the superclass handle it...
         super.drawItem(g2, state, dataArea, plot, domainAxis, rangeAxis, 
                 dataset, row, column, pass);
     }
 
 }
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:37,代码来源:GanttRenderer.java

示例3: drawItem

import org.jfree.data.gantt.GanttCategoryDataset; //导入依赖的package包/类
/**
 * Draws the bar for a single (series, category) data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the data area.
 * @param plot  the plot.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param dataset  the dataset.
 * @param row  the row index (zero-based).
 * @param column  the column index (zero-based).
 * @param pass  the pass index.
 */
@Override
public void drawItem(Graphics2D g2, CategoryItemRendererState state,
        Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis,
        ValueAxis rangeAxis, CategoryDataset dataset, int row,
        int column, int pass) {

     if (dataset instanceof GanttCategoryDataset) {
         GanttCategoryDataset gcd = (GanttCategoryDataset) dataset;
         drawTasks(g2, state, dataArea, plot, domainAxis, rangeAxis, gcd,
                 row, column);
     }
     else {  // let the superclass handle it...
         super.drawItem(g2, state, dataArea, plot, domainAxis, rangeAxis,
                 dataset, row, column, pass);
     }

 }
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:32,代码来源:GanttRenderer.java

示例4: drawItem

import org.jfree.data.gantt.GanttCategoryDataset; //导入依赖的package包/类
/**
 * Draws the bar for a single (series, category) data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the data area.
 * @param plot  the plot.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param dataset  the dataset.
 * @param row  the row index (zero-based).
 * @param column  the column index (zero-based).
 * @param pass  the pass index.
 */
public void drawItem(Graphics2D g2,
                     CategoryItemRendererState state,
                     Rectangle2D dataArea,
                     CategoryPlot plot,
                     CategoryAxis domainAxis,
                     ValueAxis rangeAxis,
                     CategoryDataset dataset,
                     int row,
                     int column,
                     int pass) {

     if (dataset instanceof GanttCategoryDataset) {
         GanttCategoryDataset gcd = (GanttCategoryDataset) dataset;
         drawTasks(g2, state, dataArea, plot, domainAxis, rangeAxis, gcd,
                 row, column);
     }
     else {  // let the superclass handle it...
         super.drawItem(g2, state, dataArea, plot, domainAxis, rangeAxis,
                 dataset, row, column, pass);
     }

 }
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:37,代码来源:GanttRenderer.java

示例5: drawItem

import org.jfree.data.gantt.GanttCategoryDataset; //导入依赖的package包/类
/**
 * Draws the bar for a single (series, category) data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the data area.
 * @param plot  the plot.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param dataset  the dataset.
 * @param row  the row index (zero-based).
 * @param column  the column index (zero-based).
 * @param pass  the pass index.
 */
public void drawItem(Graphics2D g2, CategoryItemRendererState state,
        Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis,
        ValueAxis rangeAxis, CategoryDataset dataset, int row, int column,
        boolean selected, int pass) {

     if (dataset instanceof GanttCategoryDataset) {
         GanttCategoryDataset gcd = (GanttCategoryDataset) dataset;
         drawTasks(g2, state, dataArea, plot, domainAxis, rangeAxis, gcd,
                 row, column, selected);
     }
     else {  // let the superclass handle it...
         super.drawItem(g2, state, dataArea, plot, domainAxis, rangeAxis,
                 dataset, row, column, selected, pass);
     }

 }
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:31,代码来源:GanttRenderer.java

示例6: createDebugEventGanttChart

import org.jfree.data.gantt.GanttCategoryDataset; //导入依赖的package包/类
private JFreeChart createDebugEventGanttChart() {
    eventStatistics = new EventStatistics(
            InitializationManager.getInstance(WatchDogUtils.getProject()).getTrackingEventManager(),
            selectedDebugInterval);
    GanttCategoryDataset dataset = eventStatistics.createDebugEventGanttChartDataset();

    JFreeChart chart = ChartFactory.createGanttChart(
            "Debug Events During Selected Debug Interval", "Event", "Time", dataset, false, true, false);

    // Scale the chart based on the selected debug interval.
    CategoryPlot plot = chart.getCategoryPlot();
    ValueAxis axis = plot.getRangeAxis();
    axis.setRangeWithMargins(selectedDebugInterval.getStart().getTime() - EventStatistics.PRE_SESSION_TIME_TO_INCLUDE,
            selectedDebugInterval.getEnd().getTime());

    // Give each event type a different color.
    plot.setRenderer(new WatchDogGanttRenderer());
    return chart;
}
 
开发者ID:TestRoots,项目名称:watchdog,代码行数:20,代码来源:WatchDogView.java

示例7: createDebugEventGanttChart

import org.jfree.data.gantt.GanttCategoryDataset; //导入依赖的package包/类
private JFreeChart createDebugEventGanttChart() {
	eventStatistics = new EventStatistics(
			InitializationManager.getInstance().getTrackingEventManager(),
			selectedDebugInterval);
	GanttCategoryDataset dataset = eventStatistics
			.createDebugEventGanttChartDataset();

	JFreeChart chart = ChartFactory.createGanttChart(
			"Debug Events During Selected Debug Interval", "Event", "Time",
			dataset, false, true, false);

	// Scale the chart based on the selected debug interval.
	CategoryPlot plot = chart.getCategoryPlot();
	ValueAxis axis = plot.getRangeAxis();
	axis.setRangeWithMargins(
			selectedDebugInterval.getStart().getTime()
					- EventStatistics.PRE_SESSION_TIME_TO_INCLUDE,
			selectedDebugInterval.getEnd().getTime());

	// Give each event type a different color.
	plot.setRenderer(new WatchDogGanttRenderer());
	return chart;
}
 
开发者ID:TestRoots,项目名称:watchdog,代码行数:24,代码来源:WatchDogView.java

示例8: drawItem

import org.jfree.data.gantt.GanttCategoryDataset; //导入依赖的package包/类
/**
 * Draws the bar for a single (series, category) data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the data area.
 * @param plot  the plot.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param dataset  the dataset.
 * @param row  the row index (zero-based).
 * @param column  the column index (zero-based).
 * @param pass  the pass index.
 */
public void drawItem(Graphics2D g2,
                     CategoryItemRendererState state,
                     Rectangle2D dataArea,
                     CategoryPlot plot,
                     CategoryAxis domainAxis,
                     ValueAxis rangeAxis,
                     CategoryDataset dataset,
                     int row,
                     int column,
                     int pass) {

     if (dataset instanceof GanttCategoryDataset) {
         GanttCategoryDataset gcd = (GanttCategoryDataset) dataset;
         drawTasks(
            g2, state, dataArea, plot, domainAxis, rangeAxis, gcd, 
            row, column
         );
     }
     else {  // let the superclass handle it...
         super.drawItem(
             g2, state, dataArea, plot, domainAxis, rangeAxis, 
             dataset, row, column, pass
         );
     }
 
 }
 
开发者ID:opensim-org,项目名称:opensim-gui,代码行数:41,代码来源:GanttRenderer.java

示例9: createDebugEventGanttChartDataset

import org.jfree.data.gantt.GanttCategoryDataset; //导入依赖的package包/类
/**
 * Creates a dataset of all events that occurred during the selected debug
 * interval.
 */
public GanttCategoryDataset createDebugEventGanttChartDataset() {
    // Create and add the tasks for each event type.
    TaskSeries allTasks = new TaskSeries("Debug Events");

    for (TrackingEventType type : TrackingEventType.values()) {
        final List<EventBase> filteredEventList = events.stream().filter(e -> e.getType() == type).collect(Collectors.toList());
        allTasks.add(createTaskForEventsWithName(filteredEventList, type.textualDescription));
    }

    // Create collection of the overall tasks.
    TaskSeriesCollection collection = new TaskSeriesCollection();
    collection.add(allTasks);
    return collection;
}
 
开发者ID:TestRoots,项目名称:watchdog,代码行数:19,代码来源:EventStatistics.java

示例10: ganttChartDataTest

import org.jfree.data.gantt.GanttCategoryDataset; //导入依赖的package包/类
protected void ganttChartDataTest(JFreeChart chart, String serie, String[] tasks, Object[][] values) {
	GanttCategoryDataset dataset = (GanttCategoryDataset) chart.getCategoryPlot().getDataset();
	for (int i = 0; i < tasks.length; i++) {
		Assert.assertEquals("chart data start value", ((Date) values[i][0]).getTime(), dataset.getStartValue(serie, tasks[i]));
		Assert.assertEquals("chart data end value", ((Date) values[i][1]).getTime(), dataset.getEndValue(serie, tasks[i]));
		Assert.assertEquals("chart data percent value", values[i][2], dataset.getPercentComplete(serie, tasks[i], 0));
	}
}
 
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:9,代码来源:AbstractJasperChartTest.java

示例11: createGanttChart

import org.jfree.data.gantt.GanttCategoryDataset; //导入依赖的package包/类
/**
 *
 */
protected JFreeChart createGanttChart() throws JRException
{
	//FIXMECHART legend/tooltip/url should come from plot?
	
	ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
	JFreeChart jfreeChart =
		ChartFactory.createGanttChart(
			evaluateTextExpression(getChart().getTitleExpression()),
			evaluateTextExpression(((JRBarPlot)getPlot()).getCategoryAxisLabelExpression()),
			evaluateTextExpression(((JRBarPlot)getPlot()).getValueAxisLabelExpression()),
			(GanttCategoryDataset)getDataset(),
			isShowLegend(),
			true,  //FIXMECHART tooltip: I guess BarPlot is not the best for gantt
			false
			);

	configureChart(jfreeChart, getPlot());
	
	CategoryPlot categoryPlot = (CategoryPlot)jfreeChart.getPlot();
	//plot.setNoDataMessage("No data to display");
	
	JRBarPlot barPlot = (JRBarPlot)getPlot();
	boolean isShowTickMarks = barPlot.getShowTickMarks() == null ? true : barPlot.getShowTickMarks().booleanValue();
	boolean isShowTickLabels = barPlot.getShowTickLabels() == null ? true : barPlot.getShowTickLabels().booleanValue();
	boolean isShowLabels = barPlot.getShowLabels() == null ? false : barPlot.getShowLabels().booleanValue();
	
	categoryPlot.getDomainAxis().setTickMarksVisible(isShowTickMarks);
	categoryPlot.getDomainAxis().setTickLabelsVisible(isShowTickLabels);
	// Handle the axis formating for the category axis
	configureAxis(
		categoryPlot.getDomainAxis(), barPlot.getCategoryAxisLabelFont(),
		barPlot.getCategoryAxisLabelColor(), barPlot.getCategoryAxisTickLabelFont(),
		barPlot.getCategoryAxisTickLabelColor(), barPlot.getCategoryAxisTickLabelMask(), barPlot.getCategoryAxisVerticalTickLabels(),
		barPlot.getOwnCategoryAxisLineColor(), false, null, null
		);
	((DateAxis)categoryPlot.getRangeAxis()).setTickMarksVisible(isShowTickMarks);
	((DateAxis)categoryPlot.getRangeAxis()).setTickLabelsVisible(isShowTickLabels);
	// Handle the axis formating for the value axis
	configureAxis(
		categoryPlot.getRangeAxis(), barPlot.getValueAxisLabelFont(),
		barPlot.getValueAxisLabelColor(), barPlot.getValueAxisTickLabelFont(),
		barPlot.getValueAxisTickLabelColor(), barPlot.getValueAxisTickLabelMask(), barPlot.getValueAxisVerticalTickLabels(),
		barPlot.getOwnValueAxisLineColor(), true,
		(Comparable<?>)evaluateExpression(barPlot.getRangeAxisMinValueExpression()),
		(Comparable<?>)evaluateExpression(barPlot.getRangeAxisMaxValueExpression()));

	BarRenderer categoryRenderer = (BarRenderer)categoryPlot.getRenderer();
	categoryRenderer.setBaseItemLabelGenerator((CategoryItemLabelGenerator)getLabelGenerator());
	categoryRenderer.setBaseItemLabelsVisible(isShowLabels);
	categoryRenderer.setShadowVisible(false);

	return jfreeChart;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:57,代码来源:GenericChartTheme.java

示例12: createGanttChart

import org.jfree.data.gantt.GanttCategoryDataset; //导入依赖的package包/类
/**
 *
 */
protected JFreeChart createGanttChart() throws JRException
{
	//FIXMECHART legend/tooltip/url should come from plot?
	
	ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
	JFreeChart jfreeChart =
		ChartFactory.createGanttChart(
			evaluateTextExpression(getChart().getTitleExpression()),
			evaluateTextExpression(((JRBarPlot)getPlot()).getCategoryAxisLabelExpression()),
			evaluateTextExpression(((JRBarPlot)getPlot()).getValueAxisLabelExpression()),
			(GanttCategoryDataset)getDataset(),
			isShowLegend(),
			true,  //FIXMECHART tooltip: I guess BarPlot is not the best for gantt
			false
			);

	configureChart(jfreeChart, getPlot());
	
	CategoryPlot categoryPlot = (CategoryPlot)jfreeChart.getPlot();
	//plot.setNoDataMessage("No data to display");
	
	JRBarPlot barPlot = (JRBarPlot)getPlot();
	boolean isShowTickMarks = barPlot.getShowTickMarks() == null ? true : barPlot.getShowTickMarks().booleanValue();
	boolean isShowTickLabels = barPlot.getShowTickLabels() == null ? true : barPlot.getShowTickLabels().booleanValue();
	boolean isShowLabels = barPlot.getShowLabels() == null ? false : barPlot.getShowLabels().booleanValue();
	
	//FIXMETHEME these are useless if the theme settings apply after regardless of these; check all
	categoryPlot.getDomainAxis().setTickMarksVisible(isShowTickMarks);
	categoryPlot.getDomainAxis().setTickLabelsVisible(isShowTickLabels);
	// Handle the axis formating for the category axis
	configureAxis(
		categoryPlot.getDomainAxis(), barPlot.getCategoryAxisLabelFont(),
		barPlot.getCategoryAxisLabelColor(), barPlot.getCategoryAxisTickLabelFont(),
		barPlot.getCategoryAxisTickLabelColor(), barPlot.getCategoryAxisTickLabelMask(), barPlot.getCategoryAxisVerticalTickLabels(),
		barPlot.getOwnCategoryAxisLineColor(), getDomainAxisSettings(), 
		(Comparable<?>)evaluateExpression(barPlot.getDomainAxisMinValueExpression()), 
		(Comparable<?>)evaluateExpression(barPlot.getDomainAxisMaxValueExpression())
		);

	((DateAxis)categoryPlot.getRangeAxis()).setTickMarksVisible(isShowTickMarks);
	((DateAxis)categoryPlot.getRangeAxis()).setTickLabelsVisible(isShowTickLabels);
	// Handle the axis formating for the value axis
	configureAxis(
		categoryPlot.getRangeAxis(), barPlot.getValueAxisLabelFont(),
		barPlot.getValueAxisLabelColor(), barPlot.getValueAxisTickLabelFont(),
		barPlot.getValueAxisTickLabelColor(), barPlot.getValueAxisTickLabelMask(), barPlot.getValueAxisVerticalTickLabels(),
		barPlot.getOwnValueAxisLineColor(), getRangeAxisSettings(),
		(Comparable<?>)evaluateExpression(barPlot.getRangeAxisMinValueExpression()), 
		(Comparable<?>)evaluateExpression(barPlot.getRangeAxisMaxValueExpression())
		);

	BarRenderer categoryRenderer = (BarRenderer)categoryPlot.getRenderer();
	categoryRenderer.setBaseItemLabelGenerator((CategoryItemLabelGenerator)getLabelGenerator());
	categoryRenderer.setBaseItemLabelsVisible(isShowLabels);
	categoryRenderer.setShadowVisible(false);

	return jfreeChart;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:62,代码来源:SimpleChartTheme.java

示例13: createGanttChart

import org.jfree.data.gantt.GanttCategoryDataset; //导入依赖的package包/类
/**
 *
 */
protected JFreeChart createGanttChart() throws JRException
{
	//FIXMECHART legend/tooltip/url should come from plot?
	
	ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
	JFreeChart jfreeChart =
		ChartFactory.createGanttChart(
			evaluateTextExpression(getChart().getTitleExpression()),
			evaluateTextExpression(((JRBarPlot)getPlot()).getCategoryAxisLabelExpression()),
			evaluateTextExpression(((JRBarPlot)getPlot()).getValueAxisLabelExpression()),
			(GanttCategoryDataset)getDataset(),
			isShowLegend(),
			true,  //FIXMECHART tooltip: I guess BarPlot is not the best for gantt
			false
			);

	configureChart(jfreeChart);
	
	CategoryPlot categoryPlot = (CategoryPlot)jfreeChart.getPlot();
	//plot.setNoDataMessage("No data to display");
	
	JRBarPlot barPlot = (JRBarPlot)getPlot();
	boolean isShowTickMarks = barPlot.getShowTickMarks() == null ? true : barPlot.getShowTickMarks().booleanValue();
	boolean isShowTickLabels = barPlot.getShowTickLabels() == null ? true : barPlot.getShowTickLabels().booleanValue();
	boolean isShowLabels = barPlot.getShowLabels() == null ? false : barPlot.getShowLabels().booleanValue();
	
	categoryPlot.getDomainAxis().setTickMarksVisible(isShowTickMarks);
	categoryPlot.getDomainAxis().setTickLabelsVisible(isShowTickLabels);
	// Handle the axis formating for the category axis
	configureAxis(
		categoryPlot.getDomainAxis(), barPlot.getCategoryAxisLabelFont(),
		barPlot.getCategoryAxisLabelColor(), barPlot.getCategoryAxisTickLabelFont(),
		barPlot.getCategoryAxisTickLabelColor(), barPlot.getCategoryAxisTickLabelMask(), barPlot.getCategoryAxisVerticalTickLabels(),
		barPlot.getCategoryAxisLineColor(), false, null, null
		);
	((DateAxis)categoryPlot.getRangeAxis()).setTickMarksVisible(isShowTickMarks);
	((DateAxis)categoryPlot.getRangeAxis()).setTickLabelsVisible(isShowTickLabels);
	// Handle the axis formating for the value axis
	configureAxis(
		categoryPlot.getRangeAxis(), barPlot.getValueAxisLabelFont(),
		barPlot.getValueAxisLabelColor(), barPlot.getValueAxisTickLabelFont(),
		barPlot.getValueAxisTickLabelColor(), barPlot.getValueAxisTickLabelMask(), barPlot.getValueAxisVerticalTickLabels(),
		barPlot.getValueAxisLineColor(), true,
		(Comparable<?>)evaluateExpression(barPlot.getRangeAxisMinValueExpression()),
		(Comparable<?>)evaluateExpression(barPlot.getRangeAxisMaxValueExpression()));

	GanttRenderer categoryRenderer = (GanttRenderer)categoryPlot.getRenderer();
	categoryRenderer.setBaseItemLabelGenerator((CategoryItemLabelGenerator)getLabelGenerator());
	categoryRenderer.setBaseItemLabelsVisible(isShowLabels);
	categoryRenderer.setShadowVisible(false);

	return jfreeChart;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:57,代码来源:DefaultChartTheme.java


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