hudson.plugins.covcomplplot.util
Class CustomGraph

java.lang.Object
  extended by hudson.plugins.covcomplplot.util.CustomGraph
Direct Known Subclasses:
CovComplPlotTaget.GraphImpl

public abstract class CustomGraph
extends Object

Reimplementation of Graph class in Jenkins lib. lazyMap logic on which Graph class is based is not properly working in IE. Related doMap() method in the class is removed.

Author:
JunHo Yoon

Field Summary
protected  int defaultH
           
protected  int defaultW
           
protected  org.jfree.chart.JFreeChart graph
           
protected  long timestamp
           
 
Constructor Summary
protected CustomGraph(Calendar timestamp, int defaultW, int defaultH)
          Constructor
protected CustomGraph(long timestamp, int defaultW, int defaultH)
          Constructor
 
Method Summary
protected abstract  org.jfree.chart.JFreeChart createGraph()
          Prepare JFreeChart instance to render image
 void doPng(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          Renders a graph.
protected  BufferedImage render(org.kohsuke.stapler.StaplerRequest req)
          Actually render a chart.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

timestamp

protected final long timestamp

defaultW

protected final int defaultW

defaultH

protected final int defaultH

graph

protected volatile org.jfree.chart.JFreeChart graph
Constructor Detail

CustomGraph

protected CustomGraph(long timestamp,
                      int defaultW,
                      int defaultH)
Constructor

Parameters:
timestamp - Timestamp of this graph. Used for HTTP cache related headers. If the graph doesn't have any timestamp to tie it to, pass -1.
defaultW - default width
defaultH - default height

CustomGraph

protected CustomGraph(Calendar timestamp,
                      int defaultW,
                      int defaultH)
Constructor

Parameters:
timestamp - Timestamp of this graph. Used for HTTP cache related headers.
defaultW - default width
defaultH - default height
Method Detail

createGraph

protected abstract org.jfree.chart.JFreeChart createGraph()
Prepare JFreeChart instance to render image

Returns:
chart prepared JFreeChart instance

render

protected BufferedImage render(org.kohsuke.stapler.StaplerRequest req)
Actually render a chart.

Parameters:
req - the StaplerRequest instance from which the width and height attributes are extracted.

doPng

public void doPng(org.kohsuke.stapler.StaplerRequest req,
                  org.kohsuke.stapler.StaplerResponse rsp)
           throws IOException
Renders a graph.

Parameters:
req - request from which the some attribute is extracted (width / height)
rsp - response to which the image is written.
Throws:
IOException - occurs when there is IO problems


Copyright © 2004-2011. All Rights Reserved.