com.googlecode.sarasvati.visual
Interface GraphToImageMap

All Known Implementing Classes:
GraphToImageMapAdapter

public interface GraphToImageMap

Used to generate HTML Image maps of graphs. It provides methods to generate hrefs and hovers for nodes and arcs.

Author:
Paul Lorenz

Method Summary
 boolean drawArcLabels(Arc arc)
          Controls drawing of arc labels
 String hoverForArc(Arc arc)
          Every arc in a generated image of a graph may have associated text which will pop-up when the arc is hovered over.
 String hoverForNode(Node node)
          Every node in a generated image of a graph may have associated text which will pop-up when the node is hovered over.
 String hrefForArc(Arc arc)
          Every arc in a generated image of a graph may have a link for when the arc is clicked.
 String hrefForNode(Node node)
          Every node in a generated image of a graph may have a link for when the node is clicked.
 Icon iconForNode(Node node)
          Each node may have a different Icon representing it in the generated image map.
 

Method Detail

drawArcLabels

boolean drawArcLabels(Arc arc)
Controls drawing of arc labels

Parameters:
arc -
Returns:
true if arc labels should be rendered, false otherwise

iconForNode

Icon iconForNode(Node node)
Each node may have a different Icon representing it in the generated image map. Override this method to specify which Icon to use for a given node.

Parameters:
node - The graph node needing an icon
Returns:
An icon representing the given node.

hrefForNode

String hrefForNode(Node node)
Every node in a generated image of a graph may have a link for when the node is clicked. The link may be a regular http URL or a javascript: link. If null is returned, no link will be associated with the node.

Parameters:
node - The node to generate the HREF for
Returns:
An HREF for when the node is clicked in the generated image. May be null, in which case no link is generated.

hoverForNode

String hoverForNode(Node node)
Every node in a generated image of a graph may have associated text which will pop-up when the node is hovered over. If null is returned, no hover will be created for the node.

Parameters:
node - The node to generate the hover for.
Returns:
An String to display in a hover when the node is moused over. May be null, in which case no hover will appear.

hrefForArc

String hrefForArc(Arc arc)
Every arc in a generated image of a graph may have a link for when the arc is clicked. The link may be a regular http URL or a javascript: link. If null is returned, no link will be associated with the arc.

Parameters:
arc - The arc to generate the HREF for
Returns:
An HREF for when the arc is clicked in the generated image. May be null, in which case no link is generated.

hoverForArc

String hoverForArc(Arc arc)
Every arc in a generated image of a graph may have associated text which will pop-up when the arc is hovered over. If null is returned, no hover will be created for the arc.

Parameters:
arc - The arc to generate the hover for.
Returns:
An String to display in a hover when the arc is moused over. May be null, in which case no hover will appear.


Copyright © 2012. All Rights Reserved.