Package org.jfree.chart.entity
Class ChartEntity
java.lang.Object
org.jfree.chart.entity.ChartEntity
- All Implemented Interfaces:
Serializable
,Cloneable
,PublicCloneable
- Direct Known Subclasses:
AxisEntity
,CategoryItemEntity
,FlowEntity
,JFreeChartEntity
,LegendItemEntity
,NodeEntity
,PieSectionEntity
,PlotEntity
,TickLabelEntity
,TitleEntity
,XYAnnotationEntity
,XYItemEntity
A class that captures information about some component of a chart (a bar,
line etc).
- See Also:
-
Constructor Summary
ConstructorDescriptionChartEntity
(Shape area) Creates a new chart entity.ChartEntity
(Shape area, String toolTipText) Creates a new chart entity.ChartEntity
(Shape area, String toolTipText, String urlText) Creates a new entity. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Ensures symmetry between super/subclass implementations of equals.clone()
Returns a clone of the entity.boolean
Tests the entity for equality with an arbitrary object.getArea()
Returns the area occupied by the entity (in Java 2D space).getImageMapAreaTag
(ToolTipTagFragmentGenerator toolTipTagFragmentGenerator, URLTagFragmentGenerator urlTagFragmentGenerator) Returns an HTML image map tag for this entity.Returns the shape coordinates as a string.Returns a string describing the entity area.Returns the tool tip text for the entity.Returns the URL text for the entity.int
hashCode()
Returns a hash code for this instance.void
Sets the area for the entity.void
setToolTipText
(String text) Sets the tool tip text.void
setURLText
(String text) Sets the URL text.toString()
Returns a string representation of the chart entity, useful for debugging.
-
Constructor Details
-
ChartEntity
Creates a new chart entity.- Parameters:
area
- the area (null
not permitted).
-
ChartEntity
Creates a new chart entity.- Parameters:
area
- the area (null
not permitted).toolTipText
- the tool tip text (null
permitted).
-
ChartEntity
Creates a new entity.- Parameters:
area
- the area (null
not permitted).toolTipText
- the tool tip text (null
permitted).urlText
- the URL text for HTML image maps (null
permitted).
-
-
Method Details
-
getArea
Returns the area occupied by the entity (in Java 2D space).- Returns:
- The area (never
null
).
-
setArea
Sets the area for the entity.This class conveys information about chart entities back to a client. Setting this area doesn't change the entity (which has already been drawn).
- Parameters:
area
- the area (null
not permitted).
-
getToolTipText
Returns the tool tip text for the entity. Be aware that this text may have been generated from user supplied data, so for security reasons some form of filtering should be applied before incorporating this text into any HTML output.- Returns:
- The tool tip text (possibly
null
).
-
setToolTipText
Sets the tool tip text.- Parameters:
text
- the text (null
permitted).
-
getURLText
Returns the URL text for the entity. Be aware that this text may have been generated from user supplied data, so some form of filtering should be applied before this "URL" is used in any output.- Returns:
- The URL text (possibly
null
).
-
setURLText
Sets the URL text.- Parameters:
text
- the text (null
permitted).
-
getShapeType
Returns a string describing the entity area. This string is intended for use in an AREA tag when generating an image map.- Returns:
- The shape type (never
null
).
-
getShapeCoords
Returns the shape coordinates as a string.- Returns:
- The shape coordinates (never
null
).
-
getImageMapAreaTag
public String getImageMapAreaTag(ToolTipTagFragmentGenerator toolTipTagFragmentGenerator, URLTagFragmentGenerator urlTagFragmentGenerator) Returns an HTML image map tag for this entity. The returned fragment should beXHTML 1.0
compliant.- Parameters:
toolTipTagFragmentGenerator
- a generator for the HTML fragment that will contain the tooltip text (null
not permitted if this entity contains tooltip information).urlTagFragmentGenerator
- a generator for the HTML fragment that will contain the URL reference (null
not permitted if this entity has a URL).- Returns:
- The HTML tag.
-
toString
Returns a string representation of the chart entity, useful for debugging. -
equals
Tests the entity for equality with an arbitrary object. -
canEqual
Ensures symmetry between super/subclass implementations of equals. For more detail, see http://jqno.nl/equalsverifier/manual/inheritance.- Parameters:
other
- Object- Returns:
- true ONLY if the parameter is THIS class type
-
hashCode
Returns a hash code for this instance. -
clone
Returns a clone of the entity.- Specified by:
clone
in interfacePublicCloneable
- Overrides:
clone
in classObject
- Returns:
- A clone.
- Throws:
CloneNotSupportedException
- if there is a problem cloning the entity.
-