Class CustomPieURLGenerator

java.lang.Object
org.jfree.chart.urls.CustomPieURLGenerator
All Implemented Interfaces:
Serializable, Cloneable, PieURLGenerator, PublicCloneable

A custom URL generator for pie charts.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new CustomPieURLGenerator instance, initially empty.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addURLs(Map urlMap)
    Adds a map containing (key, URL) mappings where each key is an instance of Comparable (corresponding to the key for an item in a pie dataset) and each URL is a String representing a URL fragment.
    Returns a clone of the generator.
    boolean
    Tests if this object is equal to another.
    generateURL(PieDataset dataset, Comparable key, int pieIndex)
    Generates a URL fragment.
    int
    Returns the number of URL maps stored by the renderer.
    getURL(Comparable key, int mapIndex)
    Returns the URL for a section in the specified map.
    int
    getURLCount(int list)
    Returns the number of URLs in a given map (specified by its position in the map list).

    Methods inherited from class java.lang.Object

    finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CustomPieURLGenerator

      Creates a new CustomPieURLGenerator instance, initially empty. Call addURLs(Map) to specify the URL fragments to be used.
  • Method Details

    • generateURL

      public String generateURL(PieDataset dataset, Comparable key, int pieIndex)
      Generates a URL fragment.
      Specified by:
      generateURL in interface PieURLGenerator
      Parameters:
      dataset - the dataset (ignored).
      key - the item key.
      pieIndex - the pie index.
      Returns:
      A string containing the generated URL.
      See Also:
    • getListCount

      public int getListCount()
      Returns the number of URL maps stored by the renderer.
      Returns:
      The list count.
      See Also:
    • getURLCount

      public int getURLCount(int list)
      Returns the number of URLs in a given map (specified by its position in the map list).
      Parameters:
      list - the list index (zero based).
      Returns:
      The URL count.
      See Also:
    • getURL

      public String getURL(Comparable key, int mapIndex)
      Returns the URL for a section in the specified map.
      Parameters:
      key - the key.
      mapIndex - the map index.
      Returns:
      The URL.
    • addURLs

      public void addURLs(Map urlMap)
      Adds a map containing (key, URL) mappings where each key is an instance of Comparable (corresponding to the key for an item in a pie dataset) and each URL is a String representing a URL fragment.

      The map is appended to an internal list...you can add multiple maps if you are working with, say, a MultiplePiePlot.
      Parameters:
      urlMap - the URLs (null permitted).
    • equals

      public boolean equals(Object o)
      Tests if this object is equal to another.
      Overrides:
      equals in class Object
      Parameters:
      o - the other object.
      Returns:
      A boolean.
    • clone

      Returns a clone of the generator.
      Specified by:
      clone in interface PublicCloneable
      Overrides:
      clone in class Object
      Returns:
      A clone.
      Throws:
      CloneNotSupportedException - if cloning is not supported.