public class

GanttRenderer

extends IntervalBarRenderer
implements Serializable
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

Class Overview

A renderer for simple Gantt charts. The example shown here is generated by the GanttDemo1.java program included in the JFreeChart Demo Collection:

GanttRendererSample.png

Summary

[Expand]
Inherited Constants
From class org.jfree.chart.renderer.category.BarRenderer
[Expand]
Inherited Fields
From class org.jfree.chart.renderer.AbstractRenderer
Public Constructors
GanttRenderer()
Creates a new renderer.
Public Methods
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.
boolean equals(Object obj)
Tests this renderer for equality with an arbitrary object.
Paint getCompletePaint()
Returns the paint used to show the percentage complete.
double getEndPercent()
Returns the position of the end of the progress indicator, as a percentage of the bar width.
Paint getIncompletePaint()
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 getStartPercent()
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 a RendererChangeEvent 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 a RendererChangeEvent to all registered listeners.
void setIncompletePaint(Paint paint)
Sets the paint used to show the percentage incomplete and sends a RendererChangeEvent 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 a RendererChangeEvent to all registered listeners.
Protected Methods
void drawTask(Graphics2D g2, CategoryItemRendererState state, Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, GanttCategoryDataset dataset, int row, int column)
Draws a single task.
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.
[Expand]
Inherited Methods
From class org.jfree.chart.renderer.category.IntervalBarRenderer
From class org.jfree.chart.renderer.category.BarRenderer
From class org.jfree.chart.renderer.category.AbstractCategoryItemRenderer
From class org.jfree.chart.renderer.AbstractRenderer
From class java.lang.Object
From interface org.jfree.chart.LegendItemSource
From interface org.jfree.chart.renderer.category.CategoryItemRenderer

Public Constructors

public GanttRenderer ()

Creates a new renderer.

Public Methods

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.

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.

public boolean equals (Object obj)

Tests this renderer for equality with an arbitrary object.

Parameters
obj the object (null permitted).
Returns
  • A boolean.

public Paint getCompletePaint ()

Returns the paint used to show the percentage complete.

Returns
  • The paint (never null.

public double getEndPercent ()

Returns the position of the end of the progress indicator, as a percentage of the bar width.

Returns
  • The end percent.

public Paint getIncompletePaint ()

Returns the paint used to show the percentage incomplete.

Returns
  • The paint (never null).

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.

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.

public double getStartPercent ()

Returns the position of the start of the progress indicator, as a percentage of the bar width.

Returns
  • The start percent.

public void setCompletePaint (Paint paint)

Sets the paint used to show the percentage complete and sends a RendererChangeEvent to all registered listeners.

Parameters
paint the paint (null not permitted).

public void setEndPercent (double percent)

Sets the position of the end of the progress indicator, as a percentage of the bar width, and sends a RendererChangeEvent to all registered listeners.

Parameters
percent the percent.
See Also

public void setIncompletePaint (Paint paint)

Sets the paint used to show the percentage incomplete and sends a RendererChangeEvent to all registered listeners.

Parameters
paint the paint (null not permitted).

public void setStartPercent (double percent)

Sets the position of the start of the progress indicator, as a percentage of the bar width, and sends a RendererChangeEvent to all registered listeners.

Parameters
percent the percent.

Protected Methods

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).

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).