|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ca.utoronto.JCVSReport.report.BasicGraph
An abstract base class for representing a single graph.
This class implements:
Field Summary | |
protected MetricDatabase |
database
|
protected MetricRevisionMap |
devMap
|
protected MetricRevisionMap |
fileMap
|
protected String |
id
|
protected boolean |
incremental
|
protected boolean |
perDeveloper
|
protected ResourceBundle |
props
|
Constructor Summary | |
BasicGraph()
|
Method Summary | |
protected ResultSet |
executeQuery()
Execute our data gathering query If the user specifies an SQL query in the properties file for this graph, then we will use it. |
protected abstract org.jfree.chart.JFreeChart |
getChart()
Build a chart from a dataset |
protected abstract org.jfree.data.general.Dataset |
getDataset()
Build a dataset object from an SQL query |
protected int |
getHeight()
Get the desired height of the chart |
protected String |
getKey(MetricRevision revision)
Get the key attribute of a MetricRevision object. |
String[] |
getMetricNames()
Get a list of the metrics supported by this graph |
protected String |
getProperty(String name)
Get a property from the props resource bundle |
protected String |
getProperty(String name,
String defaultValue)
Get a property from the props resource bundle (return defaultValue if the property does not exist) |
protected String |
getSeriesLabel(MetricRevision revision)
Get the label of a series on a graph from a MetricRevision object. |
protected double |
getStoredMetricValue(MetricRevision revision)
Get the stored metric value associated with the specified MetricRevision |
String |
getTitle()
Get the title of the object |
protected int |
getWidth()
Get the desired width of the chart |
protected String |
getXLabel()
Get the label for the x-axis |
protected String |
getYLabel()
Get the label for the y-axis |
void |
init(MetricDatabase database,
String id,
ResourceBundle props)
Initialize Graph from properties file |
void |
setPerDeveloper(boolean value)
Set whether we should report this metric per developer |
protected void |
storeMetricValue(MetricRevision revision)
Store the value associated with the current metric result so that it can be retreived later |
void |
write(PrintWriter output,
File directory)
Write a chart to disk and link to it in an HTML file |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected ResourceBundle props
protected String id
protected MetricDatabase database
protected boolean perDeveloper
protected boolean incremental
protected MetricRevisionMap fileMap
protected MetricRevisionMap devMap
Constructor Detail |
public BasicGraph()
Method Detail |
public void init(MetricDatabase database, String id, ResourceBundle props) throws Exception
init
in interface Graph
database
- Where to get our dataid
- A unique ID for this graphprops
- Properties of this graph
Exception
public void write(PrintWriter output, File directory) throws Exception
write
in interface Graph
output
- Where to write the HTML reportdirectory
- Where to store images
Exception
protected abstract org.jfree.data.general.Dataset getDataset() throws Exception
Exception
protected abstract org.jfree.chart.JFreeChart getChart() throws Exception
Exception
protected String getProperty(String name)
name
- The name of the propertyprotected String getProperty(String name, String defaultValue)
name
- The name of the propertydefaultValue
- The default value for the property (we return this
if the property does not exist)public String getTitle()
getTitle
in interface Graph
protected int getHeight()
protected int getWidth()
protected String getXLabel()
protected String getYLabel()
protected String getKey(MetricRevision revision)
revision
- The MetricRevision object
public void setPerDeveloper(boolean value)
setPerDeveloper
in interface Graph
value
- true or falseprotected String getSeriesLabel(MetricRevision revision)
revision
- the MetricRevision object
protected ResultSet executeQuery() throws SQLException
SQLException
protected void storeMetricValue(MetricRevision revision)
revision
- The current metric resultprotected double getStoredMetricValue(MetricRevision revision)
revision
- The specified MetricRevisionpublic String[] getMetricNames()
getMetricNames
in interface Graph
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |