hudson.plugins.analysis.graph
Class CategoryBuildResultGraph

java.lang.Object
  extended by hudson.plugins.analysis.graph.BuildResultGraph
      extended by hudson.plugins.analysis.graph.CategoryBuildResultGraph
Direct Known Subclasses:
HealthGraph, NewVersusFixedGraph, PriorityGraph, TotalsGraph

public abstract class CategoryBuildResultGraph
extends BuildResultGraph

A build result graph using a CategoryPlot. Uses a template method to create a graph based on a series of build results.

Author:
Ulli Hafner

Constructor Summary
CategoryBuildResultGraph()
           
 
Method Summary
protected abstract  List<Integer> computeSeries(BuildResult current)
          Returns the series to plot for the specified build result.
 org.jfree.chart.JFreeChart create(GraphConfiguration configuration, ResultAction<? extends BuildResult> resultAction, String pluginName)
          Creates a PNG image trend graph with clickable map.
 org.jfree.chart.JFreeChart createAggregation(GraphConfiguration configuration, Collection<ResultAction<? extends BuildResult>> resultActions, String pluginName)
          Creates a PNG image trend graph with clickable map.
 org.jfree.chart.JFreeChart createAreaChart(org.jfree.data.category.CategoryDataset dataset)
          Creates a stacked area graph from the specified data set.
 org.jfree.chart.JFreeChart createBlockChart(org.jfree.data.category.CategoryDataset dataset)
          Creates a stacked block graph from the specified data set.
protected abstract  org.jfree.chart.JFreeChart createChart(org.jfree.data.category.CategoryDataset dataSet)
          Creates the chart for the specified data set.
protected  org.jfree.chart.JFreeChart createChart(GraphConfiguration configuration, ResultAction<? extends BuildResult> action)
          Creates the chart by iterating through all available actions.
protected  org.jfree.chart.JFreeChart createLineGraph(org.jfree.data.category.CategoryDataset dataSet, boolean hasLegend)
          Creates a line graph for the specified data set.
protected  org.jfree.chart.renderer.category.CategoryItemRenderer createLineRenderer()
          Creates a line renderer with predefined stroke.
protected abstract  org.jfree.chart.renderer.category.CategoryItemRenderer createRenderer(GraphConfiguration configuration, String pluginName, ToolTipProvider toolTipProvider)
          Creates the renderer for this graph.
protected abstract  Color[] getColors()
          Returns the colors for this graph.
protected  String getRowId(int level)
          Returns the row identifier for the specified level.
protected  void setCategoryPlotProperties(org.jfree.chart.plot.CategoryPlot plot)
          Sets properties common to all category graphs of this plug-in.
 void setColors(org.jfree.chart.JFreeChart chart, Color[] colors)
          Sets the series colors for the specified chart.
 
Methods inherited from class hudson.plugins.analysis.graph.BuildResultGraph
computeDayDelta, computeDayDelta, createXYChart, getExampleImage, getGraph, getGraph, getId, getLabel, getPlugin, getRootUrl, isBuildTooOld, isDeactivated, isSelectable, isVisible, setPlotProperties, setRootUrl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CategoryBuildResultGraph

public CategoryBuildResultGraph()
Method Detail

create

public org.jfree.chart.JFreeChart create(GraphConfiguration configuration,
                                         ResultAction<? extends BuildResult> resultAction,
                                         String pluginName)
Creates a PNG image trend graph with clickable map.

Specified by:
create in class BuildResultGraph
Parameters:
configuration - the configuration parameters
resultAction - the result action to start the graph computation from
pluginName - the name of the plug-in
Returns:
the graph

createAggregation

public org.jfree.chart.JFreeChart createAggregation(GraphConfiguration configuration,
                                                    Collection<ResultAction<? extends BuildResult>> resultActions,
                                                    String pluginName)
Creates a PNG image trend graph with clickable map.

Specified by:
createAggregation in class BuildResultGraph
Parameters:
configuration - the configuration parameters
resultActions - the result actions to start the graph computation from
pluginName - the name of the plug-in
Returns:
the graph

createChart

protected org.jfree.chart.JFreeChart createChart(GraphConfiguration configuration,
                                                 ResultAction<? extends BuildResult> action)
Creates the chart by iterating through all available actions.

Parameters:
configuration - the configuration parameters
action - the action to start with
Returns:
the created chart

getRowId

protected String getRowId(int level)
Returns the row identifier for the specified level. This identifier will be used in the legend.

Parameters:
level - the level
Returns:
the row identifier

computeSeries

protected abstract List<Integer> computeSeries(BuildResult current)
Returns the series to plot for the specified build result.

Parameters:
current - the current build result
Returns:
the series to plot

createChart

protected abstract org.jfree.chart.JFreeChart createChart(org.jfree.data.category.CategoryDataset dataSet)
Creates the chart for the specified data set.

Parameters:
dataSet - the data set to show in the graph
Returns:
the created graph

createRenderer

protected abstract org.jfree.chart.renderer.category.CategoryItemRenderer createRenderer(GraphConfiguration configuration,
                                                                                         String pluginName,
                                                                                         ToolTipProvider toolTipProvider)
Creates the renderer for this graph.

Parameters:
configuration - the graph configuration
pluginName - the name of the plug-in
toolTipProvider - the tooltip provider
Returns:
the renderer

getColors

protected abstract Color[] getColors()
Returns the colors for this graph. The first color is used for the first series value, etc.

Returns:
the colors

setColors

public void setColors(org.jfree.chart.JFreeChart chart,
                      Color[] colors)
Sets the series colors for the specified chart.

Parameters:
chart - the chart
colors - the colors to set

setCategoryPlotProperties

protected void setCategoryPlotProperties(org.jfree.chart.plot.CategoryPlot plot)
Sets properties common to all category graphs of this plug-in.

Parameters:
plot - the chart to set the properties for

createAreaChart

public org.jfree.chart.JFreeChart createAreaChart(org.jfree.data.category.CategoryDataset dataset)
Creates a stacked area graph from the specified data set.

Parameters:
dataset - the values to display
Returns:
the created graph

createBlockChart

public org.jfree.chart.JFreeChart createBlockChart(org.jfree.data.category.CategoryDataset dataset)
Creates a stacked block graph from the specified data set.

Parameters:
dataset - the values to display
Returns:
the created graph

createLineRenderer

protected org.jfree.chart.renderer.category.CategoryItemRenderer createLineRenderer()
Creates a line renderer with predefined stroke.

Returns:
a line renderer
Since:
1.23

createLineGraph

protected org.jfree.chart.JFreeChart createLineGraph(org.jfree.data.category.CategoryDataset dataSet,
                                                     boolean hasLegend)
Creates a line graph for the specified data set.

Parameters:
dataSet - the data to plot
hasLegend - determines whether to show a legend
Returns:
the graph


Copyright © 2004-2012 Hudson. All Rights Reserved.