org.jfree.chart.urls
Class CustomPieURLGenerator
java.lang.Object
org.jfree.chart.urls.CustomPieURLGenerator
- Cloneable, PieURLGenerator, PublicCloneable, Serializable
A custom URL generator for pie charts.
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.
|
Object | clone() - Returns a clone of the generator.
|
boolean | equals(Object o) - Tests if this object is equal to another.
|
String | generateURL(PieDataset dataset, Comparable key, int pieIndex) - Generates a URL fragment.
|
int | getListCount() - Returns the number of URL maps stored by the renderer.
|
String | 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).
|
CustomPieURLGenerator
public CustomPieURLGenerator()
Creates a new
CustomPieURLGenerator
instance, initially
empty. Call
addURLs(Map)
to specify the URL fragments to be
used.
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
.
urlMap
- the URLs (null
permitted).
clone
public Object clone()
throws CloneNotSupportedException
Returns a clone of the generator.
equals
public boolean equals(Object o)
Tests if this object is equal to another.
generateURL
public String generateURL(PieDataset dataset,
Comparable key,
int pieIndex)
Generates a URL fragment.
- generateURL in interface PieURLGenerator
dataset
- the dataset (ignored).key
- the item key.pieIndex
- the pie index.
- A string containing the generated URL.
getListCount
public int getListCount()
Returns the number of URL maps stored by the renderer.
getURL
public String getURL(Comparable key,
int mapIndex)
Returns the URL for a section in the specified map.
key
- the key.mapIndex
- the map index.
getURLCount
public int getURLCount(int list)
Returns the number of URLs in a given map (specified by its position
in the map list).
list
- the list index (zero based).