org.jfree.chart.renderer.category

Class GanttRenderer

public class GanttRenderer extends IntervalBarRenderer implements Serializable

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
Constructor Summary
GanttRenderer()
Creates a new renderer.
Method Summary
voiddrawItem(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 voiddrawTask(Graphics2D g2, CategoryItemRendererState state, Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, GanttCategoryDataset dataset, int row, int column)
Draws a single task.
protected voiddrawTasks(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.
booleanequals(Object obj)
Tests this renderer for equality with an arbitrary object.
PaintgetCompletePaint()
Returns the paint used to show the percentage complete.
doublegetEndPercent()
Returns the position of the end of the progress indicator, as a percentage of the bar width.
PaintgetIncompletePaint()
Returns the paint used to show the percentage incomplete.
doublegetItemMiddle(Comparable rowKey, Comparable columnKey, CategoryDataset dataset, CategoryAxis axis, Rectangle2D area, RectangleEdge edge)
Returns the Java2D coordinate for the middle of the specified data item.
doublegetStartPercent()
Returns the position of the start of the progress indicator, as a percentage of the bar width.
voidsetCompletePaint(Paint paint)
Sets the paint used to show the percentage complete and sends a RendererChangeEvent to all registered listeners.
voidsetEndPercent(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.
voidsetIncompletePaint(Paint paint)
Sets the paint used to show the percentage incomplete and sends a RendererChangeEvent to all registered listeners.
voidsetStartPercent(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.

Constructor Detail

GanttRenderer

public GanttRenderer()
Creates a new renderer.

Method Detail

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.

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.

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

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

equals

public boolean equals(Object obj)
Tests this renderer for equality with an arbitrary object.

Parameters: obj the object (null permitted).

Returns: A boolean.

getCompletePaint

public Paint getCompletePaint()
Returns the paint used to show the percentage complete.

Returns: The paint (never null.

See Also: setCompletePaint

getEndPercent

public double getEndPercent()
Returns the position of the end of the progress indicator, as a percentage of the bar width.

Returns: The end percent.

See Also: GanttRenderer

getIncompletePaint

public Paint getIncompletePaint()
Returns the paint used to show the percentage incomplete.

Returns: The paint (never null).

See Also: setCompletePaint

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.

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.

Since: 1.0.11

getStartPercent

public double getStartPercent()
Returns the position of the start of the progress indicator, as a percentage of the bar width.

Returns: The start percent.

See Also: GanttRenderer

setCompletePaint

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

See Also: getCompletePaint

setEndPercent

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: getEndPercent

setIncompletePaint

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

See Also: getIncompletePaint

setStartPercent

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.

See Also: getStartPercent

Copyright © 2000-2009 by Object Refinery Limited. All Rights Reserved.