本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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;
}
示例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
);
}
}
示例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;
}
示例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));
}
}
示例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;
}
示例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;
}
示例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;
}