Class GanttRenderer
java.lang.Object
org.jfree.chart.renderer.AbstractRenderer
org.jfree.chart.renderer.category.AbstractCategoryItemRenderer
org.jfree.chart.renderer.category.BarRenderer
org.jfree.chart.renderer.category.IntervalBarRenderer
org.jfree.chart.renderer.category.GanttRenderer
- All Implemented Interfaces:
Serializable
,Cloneable
,LegendItemSource
,CategoryItemRenderer
,PublicCloneable
A renderer for simple Gantt charts. The example shown
here is generated by the
GanttDemo1.java
program
included in the JFreeChart Demo Collection:
- See Also:
-
Field Summary
Fields inherited from class org.jfree.chart.renderer.category.BarRenderer
BAR_OUTLINE_WIDTH_THRESHOLD, DEFAULT_ITEM_MARGIN
Fields inherited from class org.jfree.chart.renderer.AbstractRenderer
DEFAULT_ITEM_LABEL_INSETS, DEFAULT_OUTLINE_PAINT, DEFAULT_OUTLINE_STROKE, DEFAULT_PAINT, DEFAULT_SHAPE, DEFAULT_STROKE, DEFAULT_VALUE_LABEL_FONT, DEFAULT_VALUE_LABEL_PAINT, ZERO
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
drawItem
(Graphics2D g2, CategoryItemRendererState state, Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryDataset dataset, int row, int column, int pass) Draws the bar for a single (series, category) data item.protected void
drawTask
(Graphics2D g2, CategoryItemRendererState state, Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, GanttCategoryDataset dataset, int row, int column) Draws a single task.protected void
drawTasks
(Graphics2D g2, CategoryItemRendererState state, Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, GanttCategoryDataset dataset, int row, int column) Draws the tasks/subtasks for one item.boolean
Tests this renderer for equality with an arbitrary object.Returns the paint used to show the percentage complete.double
Returns the position of the end of the progress indicator, as a percentage of the bar width.Returns the paint used to show the percentage incomplete.double
getItemMiddle
(Comparable rowKey, Comparable columnKey, CategoryDataset dataset, CategoryAxis axis, Rectangle2D area, RectangleEdge edge) Returns the Java2D coordinate for the middle of the specified data item.double
Returns the position of the start of the progress indicator, as a percentage of the bar width.void
setCompletePaint
(Paint paint) Sets the paint used to show the percentage complete and sends aRendererChangeEvent
to all registered listeners.void
setEndPercent
(double percent) Sets the position of the end of the progress indicator, as a percentage of the bar width, and sends aRendererChangeEvent
to all registered listeners.void
setIncompletePaint
(Paint paint) Sets the paint used to show the percentage incomplete and sends aRendererChangeEvent
to all registered listeners.void
setStartPercent
(double percent) Sets the position of the start of the progress indicator, as a percentage of the bar width, and sends aRendererChangeEvent
to all registered listeners.Methods inherited from class org.jfree.chart.renderer.category.IntervalBarRenderer
drawInterval, findRangeBounds
Methods inherited from class org.jfree.chart.renderer.category.BarRenderer
calculateBarL0L1, calculateBarW0, calculateBarWidth, calculateSeriesWidth, drawItemLabel, findRangeBounds, getBarPainter, getBase, getDefaultBarPainter, getDefaultShadowsVisible, getGradientPaintTransformer, getIncludeBaseInRange, getItemMargin, getLegendItem, getLowerClip, getMaximumBarWidth, getMinimumBarLength, getNegativeItemLabelPositionFallback, getPositiveItemLabelPositionFallback, getShadowPaint, getShadowsVisible, getShadowXOffset, getShadowYOffset, getUpperClip, initialise, isDrawBarOutline, setBarPainter, setBase, setDefaultBarPainter, setDefaultShadowsVisible, setDrawBarOutline, setGradientPaintTransformer, setIncludeBaseInRange, setItemMargin, setMaximumBarWidth, setMinimumBarLength, setNegativeItemLabelPositionFallback, setPositiveItemLabelPositionFallback, setShadowPaint, setShadowVisible, setShadowXOffset, setShadowYOffset
Methods inherited from class org.jfree.chart.renderer.category.AbstractCategoryItemRenderer
addEntity, addItemEntity, beginElementGroup, calculateDomainMarkerTextAnchorPoint, calculateRangeMarkerTextAnchorPoint, clone, createState, drawBackground, drawDomainGridline, drawDomainMarker, drawItemLabel, drawOutline, drawRangeLine, drawRangeMarker, getColumnCount, getDefaultItemLabelGenerator, getDefaultItemURLGenerator, getDefaultToolTipGenerator, getDomainAxis, getDrawingSupplier, getItemLabelGenerator, getItemURLGenerator, getLegendItemLabelGenerator, getLegendItems, getLegendItemToolTipGenerator, getLegendItemURLGenerator, getPassCount, getPlot, getRangeAxis, getRowCount, getSeriesItemLabelGenerator, getSeriesItemURLGenerator, getSeriesToolTipGenerator, getToolTipGenerator, hashCode, setDefaultItemLabelGenerator, setDefaultItemLabelGenerator, setDefaultItemURLGenerator, setDefaultItemURLGenerator, setDefaultToolTipGenerator, setDefaultToolTipGenerator, setLegendItemLabelGenerator, setLegendItemToolTipGenerator, setLegendItemURLGenerator, setPlot, setSeriesItemLabelGenerator, setSeriesItemLabelGenerator, setSeriesItemURLGenerator, setSeriesItemURLGenerator, setSeriesToolTipGenerator, setSeriesToolTipGenerator, updateCrosshairValues
Methods inherited from class org.jfree.chart.renderer.AbstractRenderer
addChangeListener, beginElementGroup, calculateLabelAnchorPoint, clearSeriesPaints, clearSeriesStrokes, endElementGroup, fireChangeEvent, getAutoPopulateSeriesFillPaint, getAutoPopulateSeriesOutlinePaint, getAutoPopulateSeriesOutlineStroke, getAutoPopulateSeriesPaint, getAutoPopulateSeriesShape, getAutoPopulateSeriesStroke, getDataBoundsIncludesVisibleSeriesOnly, getDefaultCreateEntities, getDefaultEntityRadius, getDefaultFillPaint, getDefaultItemLabelFont, getDefaultItemLabelPaint, getDefaultItemLabelsVisible, getDefaultLegendShape, getDefaultLegendTextFont, getDefaultLegendTextPaint, getDefaultNegativeItemLabelPosition, getDefaultOutlinePaint, getDefaultOutlineStroke, getDefaultPaint, getDefaultPositiveItemLabelPosition, getDefaultSeriesVisible, getDefaultSeriesVisibleInLegend, getDefaultShape, getDefaultStroke, getItemCreateEntity, getItemFillPaint, getItemLabelAnchorOffset, getItemLabelFont, getItemLabelInsets, getItemLabelPaint, getItemOutlinePaint, getItemOutlineStroke, getItemPaint, getItemShape, getItemStroke, getItemVisible, getLegendShape, getLegendTextFont, getLegendTextPaint, getNegativeItemLabelPosition, getPositiveItemLabelPosition, getSeriesCreateEntities, getSeriesFillPaint, getSeriesItemLabelFont, getSeriesItemLabelPaint, getSeriesNegativeItemLabelPosition, getSeriesOutlinePaint, getSeriesOutlineStroke, getSeriesPaint, getSeriesPositiveItemLabelPosition, getSeriesShape, getSeriesStroke, getSeriesVisible, getSeriesVisibleInLegend, getTreatLegendShapeAsLine, hasListener, isComputeItemLabelContrastColor, isItemLabelVisible, isSeriesItemLabelsVisible, isSeriesVisible, isSeriesVisibleInLegend, lookupLegendShape, lookupLegendTextFont, lookupLegendTextPaint, lookupSeriesFillPaint, lookupSeriesOutlinePaint, lookupSeriesOutlineStroke, lookupSeriesPaint, lookupSeriesShape, lookupSeriesStroke, notifyListeners, removeChangeListener, setAutoPopulateSeriesFillPaint, setAutoPopulateSeriesOutlinePaint, setAutoPopulateSeriesOutlineStroke, setAutoPopulateSeriesPaint, setAutoPopulateSeriesShape, setAutoPopulateSeriesStroke, setComputeItemLabelContrastColor, setDataBoundsIncludesVisibleSeriesOnly, setDefaultCreateEntities, setDefaultCreateEntities, setDefaultEntityRadius, setDefaultFillPaint, setDefaultFillPaint, setDefaultItemLabelFont, setDefaultItemLabelFont, setDefaultItemLabelPaint, setDefaultItemLabelPaint, setDefaultItemLabelsVisible, setDefaultItemLabelsVisible, setDefaultLegendShape, setDefaultLegendTextFont, setDefaultLegendTextPaint, setDefaultNegativeItemLabelPosition, setDefaultNegativeItemLabelPosition, setDefaultOutlinePaint, setDefaultOutlinePaint, setDefaultOutlineStroke, setDefaultOutlineStroke, setDefaultPaint, setDefaultPaint, setDefaultPositiveItemLabelPosition, setDefaultPositiveItemLabelPosition, setDefaultSeriesVisible, setDefaultSeriesVisible, setDefaultSeriesVisibleInLegend, setDefaultSeriesVisibleInLegend, setDefaultShape, setDefaultShape, setDefaultStroke, setDefaultStroke, setItemLabelAnchorOffset, setItemLabelInsets, setLegendShape, setLegendTextFont, setLegendTextPaint, setSeriesCreateEntities, setSeriesCreateEntities, setSeriesFillPaint, setSeriesFillPaint, setSeriesItemLabelFont, setSeriesItemLabelFont, setSeriesItemLabelPaint, setSeriesItemLabelPaint, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesNegativeItemLabelPosition, setSeriesNegativeItemLabelPosition, setSeriesOutlinePaint, setSeriesOutlinePaint, setSeriesOutlineStroke, setSeriesOutlineStroke, setSeriesPaint, setSeriesPaint, setSeriesPositiveItemLabelPosition, setSeriesPositiveItemLabelPosition, setSeriesShape, setSeriesShape, setSeriesStroke, setSeriesStroke, setSeriesVisible, setSeriesVisible, setSeriesVisibleInLegend, setSeriesVisibleInLegend, setTreatLegendShapeAsLine
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.jfree.chart.renderer.category.CategoryItemRenderer
addChangeListener, getDefaultCreateEntities, getDefaultFillPaint, getDefaultItemLabelFont, getDefaultItemLabelPaint, getDefaultItemLabelsVisible, getDefaultNegativeItemLabelPosition, getDefaultOutlinePaint, getDefaultOutlineStroke, getDefaultPaint, getDefaultPositiveItemLabelPosition, getDefaultSeriesVisible, getDefaultSeriesVisibleInLegend, getDefaultShape, getDefaultStroke, getItemCreateEntity, getItemFillPaint, getItemLabelFont, getItemLabelPaint, getItemOutlinePaint, getItemOutlineStroke, getItemPaint, getItemShape, getItemStroke, getItemVisible, getNegativeItemLabelPosition, getPositiveItemLabelPosition, getSeriesCreateEntities, getSeriesFillPaint, getSeriesItemLabelFont, getSeriesItemLabelPaint, getSeriesNegativeItemLabelPosition, getSeriesOutlinePaint, getSeriesOutlineStroke, getSeriesPaint, getSeriesPositiveItemLabelPosition, getSeriesShape, getSeriesStroke, getSeriesVisible, getSeriesVisibleInLegend, isItemLabelVisible, isSeriesItemLabelsVisible, isSeriesVisible, isSeriesVisibleInLegend, removeChangeListener, setDefaultCreateEntities, setDefaultCreateEntities, setDefaultFillPaint, setDefaultItemLabelFont, setDefaultItemLabelFont, setDefaultItemLabelPaint, setDefaultItemLabelPaint, setDefaultItemLabelsVisible, setDefaultItemLabelsVisible, setDefaultNegativeItemLabelPosition, setDefaultNegativeItemLabelPosition, setDefaultOutlinePaint, setDefaultOutlinePaint, setDefaultOutlineStroke, setDefaultOutlineStroke, setDefaultPaint, setDefaultPaint, setDefaultPositiveItemLabelPosition, setDefaultPositiveItemLabelPosition, setDefaultSeriesVisible, setDefaultSeriesVisible, setDefaultSeriesVisibleInLegend, setDefaultSeriesVisibleInLegend, setDefaultShape, setDefaultShape, setDefaultStroke, setDefaultStroke, setSeriesCreateEntities, setSeriesCreateEntities, setSeriesFillPaint, setSeriesItemLabelFont, setSeriesItemLabelFont, setSeriesItemLabelPaint, setSeriesItemLabelPaint, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesNegativeItemLabelPosition, setSeriesNegativeItemLabelPosition, setSeriesOutlinePaint, setSeriesOutlinePaint, setSeriesOutlineStroke, setSeriesOutlineStroke, setSeriesPaint, setSeriesPaint, setSeriesPositiveItemLabelPosition, setSeriesPositiveItemLabelPosition, setSeriesShape, setSeriesShape, setSeriesStroke, setSeriesStroke, setSeriesVisible, setSeriesVisible, setSeriesVisibleInLegend, setSeriesVisibleInLegend
Methods inherited from interface org.jfree.chart.util.PublicCloneable
clone
-
Constructor Details
-
GanttRenderer
public GanttRenderer()Creates a new renderer.
-
-
Method Details
-
getCompletePaint
Returns the paint used to show the percentage complete.- Returns:
- The paint (never
null
). - See Also:
-
setCompletePaint
Sets the paint used to show the percentage complete and sends aRendererChangeEvent
to all registered listeners.- Parameters:
paint
- the paint (null
not permitted).- See Also:
-
getIncompletePaint
Returns the paint used to show the percentage incomplete.- Returns:
- The paint (never
null
). - See Also:
-
setIncompletePaint
Sets the paint used to show the percentage incomplete and sends aRendererChangeEvent
to all registered listeners.- Parameters:
paint
- the paint (null
not permitted).- See Also:
-
getStartPercent
Returns the position of the start of the progress indicator, as a percentage of the bar width.- Returns:
- The start percent.
- See Also:
-
setStartPercent
Sets the position of the start of the progress indicator, as a percentage of the bar width, and sends aRendererChangeEvent
to all registered listeners.- Parameters:
percent
- the percent.- See Also:
-
getEndPercent
Returns the position of the end of the progress indicator, as a percentage of the bar width.- Returns:
- The end percent.
- See Also:
-
setEndPercent
Sets the position of the end of the progress indicator, as a percentage of the bar width, and sends aRendererChangeEvent
to all registered listeners.- Parameters:
percent
- the percent.- See Also:
-
drawItem
public void drawItem(Graphics2D g2, CategoryItemRendererState state, Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryDataset dataset, int row, int column, int pass) Draws the bar for a single (series, category) data item.- Specified by:
drawItem
in interfaceCategoryItemRenderer
- Overrides:
drawItem
in classIntervalBarRenderer
- Parameters:
g2
- the graphics device.state
- the renderer state.dataArea
- the data area.plot
- the plot.domainAxis
- the domain axis.rangeAxis
- the range axis.dataset
- the dataset.row
- the row index (zero-based).column
- the column index (zero-based).pass
- the pass index.
-
drawTasks
protected void drawTasks(Graphics2D g2, CategoryItemRendererState state, Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, GanttCategoryDataset dataset, int row, int column) Draws the tasks/subtasks for one item.- Parameters:
g2
- the graphics device.state
- the renderer state.dataArea
- the data plot area.plot
- the plot.domainAxis
- the domain axis.rangeAxis
- the range axis.dataset
- the data.row
- the row index (zero-based).column
- the column index (zero-based).
-
drawTask
protected void drawTask(Graphics2D g2, CategoryItemRendererState state, Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, GanttCategoryDataset dataset, int row, int column) Draws a single task.- Parameters:
g2
- the graphics device.state
- the renderer state.dataArea
- the data plot area.plot
- the plot.domainAxis
- the domain axis.rangeAxis
- the range axis.dataset
- the data.row
- the row index (zero-based).column
- the column index (zero-based).
-
getItemMiddle
public double getItemMiddle(Comparable rowKey, Comparable columnKey, CategoryDataset dataset, CategoryAxis axis, Rectangle2D area, RectangleEdge edge) Returns the Java2D coordinate for the middle of the specified data item.- Specified by:
getItemMiddle
in interfaceCategoryItemRenderer
- Overrides:
getItemMiddle
in classAbstractCategoryItemRenderer
- Parameters:
rowKey
- the row key.columnKey
- the column key.dataset
- the dataset.axis
- the axis.area
- the drawing area.edge
- the edge along which the axis lies.- Returns:
- The Java2D coordinate.
-
equals
Tests this renderer for equality with an arbitrary object.- Overrides:
equals
in classIntervalBarRenderer
- Parameters:
obj
- the object (null
permitted).- Returns:
- A boolean.
-