Class ImageMapUtils

java.lang.Object
org.jfree.chart.imagemap.ImageMapUtils

public class ImageMapUtils extends Object
Collection of utility methods related to producing image maps. Functionality was originally in ChartUtils.
  • Constructor Details

  • Method Details

    • writeImageMap

      public static void writeImageMap(PrintWriter writer, String name, ChartRenderingInfo info) throws IOException
      Writes an image map to an output stream.
      Parameters:
      writer - the writer (null not permitted).
      name - the map name (null not permitted).
      info - the chart rendering info (null not permitted).
      Throws:
      IOException - if there are any I/O errors.
    • writeImageMap

      public static void writeImageMap(PrintWriter writer, String name, ChartRenderingInfo info, boolean useOverLibForToolTips) throws IOException
      Writes an image map to an output stream.
      Parameters:
      writer - the writer (null not permitted).
      name - the map name (null not permitted).
      info - the chart rendering info (null not permitted).
      useOverLibForToolTips - whether to use OverLIB for tooltips (http://www.bosrup.com/web/overlib/).
      Throws:
      IOException - if there are any I/O errors.
    • writeImageMap

      public static void writeImageMap(PrintWriter writer, String name, ChartRenderingInfo info, ToolTipTagFragmentGenerator toolTipTagFragmentGenerator, URLTagFragmentGenerator urlTagFragmentGenerator) throws IOException
      Writes an image map to an output stream.
      Parameters:
      writer - the writer (null not permitted).
      name - the map name (null not permitted).
      info - the chart rendering info (null not permitted).
      toolTipTagFragmentGenerator - a generator for the HTML fragment that will contain the tooltip text (null not permitted if info contains tooltip information).
      urlTagFragmentGenerator - a generator for the HTML fragment that will contain the URL reference (null not permitted if info contains URLs).
      Throws:
      IOException - if there are any I/O errors.
    • getImageMap

      public static String getImageMap(String name, ChartRenderingInfo info)
      Creates an image map element that complies with the XHTML 1.0 specification.
      Parameters:
      name - the map name (null not permitted).
      info - the chart rendering info (null not permitted).
      Returns:
      The map element.
    • getImageMap

      public static String getImageMap(String name, ChartRenderingInfo info, ToolTipTagFragmentGenerator toolTipTagFragmentGenerator, URLTagFragmentGenerator urlTagFragmentGenerator)
      Creates an image map element that complies with the XHTML 1.0 specification.
      Parameters:
      name - the map name (null not permitted).
      info - the chart rendering info (null not permitted).
      toolTipTagFragmentGenerator - a generator for the HTML fragment that will contain the tooltip text (null not permitted if info contains tooltip information).
      urlTagFragmentGenerator - a generator for the HTML fragment that will contain the URL reference (null not permitted if info contains URLs).
      Returns:
      The map tag.
    • htmlEscape

      public static String htmlEscape(String input)
      Returns a string that is equivalent to the input string, but with special characters converted to HTML escape sequences.
      Parameters:
      input - the string to escape (null not permitted).
      Returns:
      A string with characters escaped.
    • javascriptEscape

      public static String javascriptEscape(String input)
      Returns a string that is equivalent to the input string, but with special characters converted to JavaScript escape sequences.
      Parameters:
      input - the string to escape (null not permitted).
      Returns:
      A string with characters escaped.