org.archive.wayback.util.graph
Class GraphRenderer

java.lang.Object
  extended by org.archive.wayback.util.graph.GraphRenderer

public class GraphRenderer
extends Object

Author:
brad

Field Summary
static String RENDERED_IMAGE_MIME
          appropriate Content-Type HTTP header value for graph image content produced by render(OutputStream,Graph)
 
Constructor Summary
GraphRenderer()
           
 
Method Summary
 void render(OutputStream target, Graph graph)
          Send a PNG format byte stream for the argument Graph to the provided OutputStream
static String renderHTML(Graph graph, String mapName, String imgUrl, String[] targets, String[] titles)
          Create both an HTML AREA map and an HTML IMG for a graph, using provided href targets, and titles within the AREA map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RENDERED_IMAGE_MIME

public static final String RENDERED_IMAGE_MIME
appropriate Content-Type HTTP header value for graph image content produced by render(OutputStream,Graph)

See Also:
Constant Field Values
Constructor Detail

GraphRenderer

public GraphRenderer()
Method Detail

renderHTML

public static String renderHTML(Graph graph,
                                String mapName,
                                String imgUrl,
                                String[] targets,
                                String[] titles)
Create both an HTML AREA map and an HTML IMG for a graph, using provided href targets, and titles within the AREA map.

Parameters:
graph - Graph to draw
mapName - name of HTML AREA map
imgUrl - URL to rendered Graph, see GraphEncoder.encode()
targets - URL href targets for the years in the Graph
titles - titles for the years in the graph.
Returns:
HTML String for the resulting AREA and IMG

render

public void render(OutputStream target,
                   Graph graph)
            throws IOException
Send a PNG format byte stream for the argument Graph to the provided OutputStream

Parameters:
target - OutputStream to write PNG format bytes
graph - Graph to send to the target
Throws:
IOException - for usual reasons.


Copyright © 2005-2011 Internet Archive. All Rights Reserved.