Package org.jfree.chart.entity
Class PieSectionEntity
java.lang.Object
org.jfree.chart.entity.ChartEntity
org.jfree.chart.entity.PieSectionEntity
- All Implemented Interfaces:
Serializable,Cloneable,PublicCloneable
public class PieSectionEntity extends ChartEntity implements Serializable
A chart entity that represents one section within a pie plot.
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description PieSectionEntity(Shape area, PieDataset dataset, int pieIndex, int sectionIndex, Comparable sectionKey, String toolTipText, String urlText)Creates a new pie section entity. -
Method Summary
Modifier and Type Method Description booleanequals(Object obj)Tests this entity for equality with an arbitrary object.PieDatasetgetDataset()Returns the dataset this entity refers to.intgetPieIndex()Returns the pie index.intgetSectionIndex()Returns the section index.ComparablegetSectionKey()Returns the section key.inthashCode()Returns a hash code for this instance.voidsetDataset(PieDataset dataset)Sets the dataset this entity refers to.voidsetPieIndex(int index)Sets the pie index.voidsetSectionIndex(int index)Sets the section index.voidsetSectionKey(Comparable key)Sets the section key.StringtoString()Returns a string representing the entity.Methods inherited from class org.jfree.chart.entity.ChartEntity
clone, getArea, getImageMapAreaTag, getShapeCoords, getShapeType, getToolTipText, getURLText, setArea, setToolTipText, setURLText
-
Constructor Details
-
PieSectionEntity
public PieSectionEntity(Shape area, PieDataset dataset, int pieIndex, int sectionIndex, Comparable sectionKey, String toolTipText, String urlText)Creates a new pie section entity.- Parameters:
area- the area.dataset- the pie dataset.pieIndex- the pie index (zero-based).sectionIndex- the section index (zero-based).sectionKey- the section key.toolTipText- the tool tip text.urlText- the URL text for HTML image maps.
-
-
Method Details
-
getDataset
Returns the dataset this entity refers to.- Returns:
- The dataset.
- See Also:
setDataset(PieDataset)
-
setDataset
Sets the dataset this entity refers to.- Parameters:
dataset- the dataset.- See Also:
getDataset()
-
getPieIndex
Returns the pie index. For a regular pie chart, the section index is 0. For a pie chart containing multiple pie plots, the pie index is the row or column index from which the pie data is extracted.- Returns:
- The pie index.
- See Also:
setPieIndex(int)
-
setPieIndex
Sets the pie index.- Parameters:
index- the new index value.- See Also:
getPieIndex()
-
getSectionIndex
Returns the section index.- Returns:
- The section index.
- See Also:
setSectionIndex(int)
-
setSectionIndex
Sets the section index.- Parameters:
index- the section index.- See Also:
getSectionIndex()
-
getSectionKey
Returns the section key.- Returns:
- The section key.
- See Also:
setSectionKey(Comparable)
-
setSectionKey
Sets the section key.- Parameters:
key- the section key.- See Also:
getSectionKey()
-
equals
Tests this entity for equality with an arbitrary object.- Overrides:
equalsin classChartEntity- Parameters:
obj- the object (nullpermitted).- Returns:
- A boolean.
-
hashCode
Returns a hash code for this instance.- Overrides:
hashCodein classChartEntity- Returns:
- A hash code.
-
toString
Returns a string representing the entity.- Overrides:
toStringin classChartEntity- Returns:
- A string representing the entity.
-