Class JRBaseChart
- java.lang.Object
-
- net.sf.jasperreports.engine.base.JRBaseElement
-
- net.sf.jasperreports.charts.base.JRBaseChart
-
- All Implemented Interfaces:
Serializable
,Cloneable
,JRChart
,JRChangeEventsSupport
,JRAnchor
,JRBoxContainer
,JRChild
,JRCloneable
,JRCommonElement
,JRElement
,JREvaluation
,JRHyperlink
,JRIdentifiable
,JRPropertiesHolder
,JRStyleContainer
,JRVisitable
public class JRBaseChart extends JRBaseElement implements JRChart
- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class net.sf.jasperreports.engine.base.JRBaseElement
backcolor, defaultStyleProvider, elementGroup, forecolor, height, isPrintInFirstWholeBand, isPrintRepeatedValues, isPrintWhenDetailOverflows, isRemoveLineWhenBlank, key, mode, parentStyle, parentStyleNameReference, positionType, printWhenExpression, printWhenGroupChanges, PROPERTY_POSITION_TYPE, PROPERTY_PRINT_IN_FIRST_WHOLE_BAND, PROPERTY_PRINT_REPEATED_VALUES, PROPERTY_PRINT_WHEN_DETAIL_OVERFLOWS, PROPERTY_REMOVE_LINE_WHEN_BLANK, PROPERTY_STRETCH_TYPE, PROPERTY_WIDTH, PROPERTY_X, stretchType, styleExpression, uuid, width, x, y
-
Fields inherited from interface net.sf.jasperreports.engine.JRAnchor
NO_BOOKMARK
-
Fields inherited from interface net.sf.jasperreports.charts.JRChart
PROPERTY_CHART_RENDER_TYPE, PROPERTY_CHART_THEME, RENDER_TYPE_DRAW, RENDER_TYPE_IMAGE, RENDER_TYPE_SVG
-
Fields inherited from interface net.sf.jasperreports.engine.JRElement
PROPERTY_ELEMENT_TEMPLATE_POPULATE_STYLE
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
JRBaseChart(JRChart chart, ChartsBaseObjectFactory factory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
clone()
void
collectExpressions(JRExpressionCollector collector)
JRExpression
getAnchorNameExpression()
Returns an expression whose value represents the anchor name.int
getBookmarkLevel()
Returns the level of the bookmark corresponding to the anchor.JRExpression
getBookmarkLevelExpression()
Returns an expression whose value represents the bookmark level (starting from 1) corresponding to this anchor.ChartTypeEnum
getChartType()
Gets the chart type.String
getCustomizerClass()
Gets a user specified chart customizer class name.JRChartDataset
getDataset()
Gets the chart dataset.Color
getDefaultLineColor()
String
getEvaluationGroup()
Gets the evaluation group for this text field.EvaluationTimeEnum
getEvaluationTime()
Gets the evaluation time for this text field.JRExpression
getHyperlinkAnchorExpression()
Returns the expression whose value represents the anchor.JRExpression
getHyperlinkPageExpression()
Returns an integer representing the page index of the link.JRHyperlinkParameter[]
getHyperlinkParameters()
Returns the list of hyperlink parameters.JRExpression
getHyperlinkReferenceExpression()
Returns the expression whose value represents the hyperlink reference.HyperlinkTargetEnum
getHyperlinkTarget()
Retrieves the hyperlink target for the element.JRExpression
getHyperlinkTooltipExpression()
Returns the expression which will generate the hyperlink tooltip.HyperlinkTypeEnum
getHyperlinkType()
Retrieves the hyperlink type for the element.JRExpression
getHyperlinkWhenExpression()
Returns the expression that is evaluated in order to decide if the hyperlink should be displayed.Color
getLegendBackgroundColor()
Color
getLegendColor()
JRFont
getLegendFont()
EdgeEnum
getLegendPosition()
JRLineBox
getLineBox()
String
getLinkTarget()
Returns the hyperlink target name.String
getLinkType()
Returns the hyperlink type.ModeEnum
getMode()
Returns the element transparency mode.Color
getOwnLegendBackgroundColor()
Color
getOwnLegendColor()
Color
getOwnSubtitleColor()
Color
getOwnTitleColor()
JRChartPlot
getPlot()
Gets the chart plot.String
getRenderType()
Boolean
getShowLegend()
Color
getSubtitleColor()
JRExpression
getSubtitleExpression()
Gets the expression whose evaluation will form the subtitle.JRFont
getSubtitleFont()
String
getTheme()
Color
getTitleColor()
JRExpression
getTitleExpression()
Gets the expression whose evaluation will form the title.JRFont
getTitleFont()
EdgeEnum
getTitlePosition()
Gets the title position relative to the chart.void
setLegendBackgroundColor(Color legendBackgroundColor)
void
setLegendColor(Color legendColor)
void
setLegendPosition(EdgeEnum legendPosition)
void
setRenderType(String renderType)
void
setShowLegend(Boolean isShowLegend)
void
setSubtitleColor(Color subtitleColor)
void
setTheme(String theme)
void
setTitleColor(Color titleColor)
void
setTitlePosition(EdgeEnum titlePosition)
Sets the title position relative to the chart.void
visit(JRVisitor visitor)
-
Methods inherited from class net.sf.jasperreports.engine.base.JRBaseElement
clone, clone, getBackcolor, getBaseStyle, getDefaultStyleProvider, getElementGroup, getEventSupport, getForecolor, getHeight, getKey, getOwnBackcolor, getOwnForecolor, getOwnMode, getParentProperties, getPositionType, getPrintWhenExpression, getPrintWhenGroupChanges, getPropertiesMap, getPropertyExpressions, getStretchType, getStyle, getStyleExpression, getStyleNameReference, getStyleResolver, getUUID, getWidth, getX, getY, hasProperties, isPrintInFirstWholeBand, isPrintRepeatedValues, isPrintWhenDetailOverflows, isRemoveLineWhenBlank, setBackcolor, setForecolor, setMode, setPositionType, setPrintInFirstWholeBand, setPrintRepeatedValues, setPrintWhenDetailOverflows, setRemoveLineWhenBlank, setStretchType, setUUID, setWidth, setX
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.jasperreports.charts.JRChart
getChartsStyleResolver
-
Methods inherited from interface net.sf.jasperreports.engine.JRCommonElement
getBackcolor, getForecolor, getHeight, getKey, getOwnBackcolor, getOwnForecolor, getOwnMode, getWidth, setBackcolor, setForecolor, setMode
-
Methods inherited from interface net.sf.jasperreports.engine.JRElement
clone, getElementGroup, getPositionType, getPrintWhenExpression, getPrintWhenGroupChanges, getPropertyExpressions, getStretchType, getStyleExpression, getX, getY, isPrintInFirstWholeBand, isPrintRepeatedValues, isPrintWhenDetailOverflows, isRemoveLineWhenBlank, setPositionType, setPrintInFirstWholeBand, setPrintRepeatedValues, setPrintWhenDetailOverflows, setRemoveLineWhenBlank, setStretchType, setWidth, setX
-
Methods inherited from interface net.sf.jasperreports.engine.JRIdentifiable
getUUID
-
Methods inherited from interface net.sf.jasperreports.engine.JRPropertiesHolder
getParentProperties, getPropertiesMap, hasProperties
-
Methods inherited from interface net.sf.jasperreports.engine.JRStyleContainer
getDefaultStyleProvider, getStyle, getStyleName, getStyleNameReference
-
-
-
-
Field Detail
-
EXCEPTION_MESSAGE_KEY_CHART_TYPE_NOT_SUPPORTED
public static final String EXCEPTION_MESSAGE_KEY_CHART_TYPE_NOT_SUPPORTED
- See Also:
- Constant Field Values
-
PROPERTY_LEGEND_BACKGROUND_COLOR
public static final String PROPERTY_LEGEND_BACKGROUND_COLOR
- See Also:
- Constant Field Values
-
PROPERTY_LEGEND_COLOR
public static final String PROPERTY_LEGEND_COLOR
- See Also:
- Constant Field Values
-
PROPERTY_LEGEND_POSITION
public static final String PROPERTY_LEGEND_POSITION
- See Also:
- Constant Field Values
-
PROPERTY_SHOW_LEGEND
public static final String PROPERTY_SHOW_LEGEND
- See Also:
- Constant Field Values
-
PROPERTY_SUBTITLE_COLOR
public static final String PROPERTY_SUBTITLE_COLOR
- See Also:
- Constant Field Values
-
PROPERTY_TITLE_COLOR
public static final String PROPERTY_TITLE_COLOR
- See Also:
- Constant Field Values
-
PROPERTY_TITLE_POSITION
public static final String PROPERTY_TITLE_POSITION
- See Also:
- Constant Field Values
-
PROPERTY_RENDER_TYPE
public static final String PROPERTY_RENDER_TYPE
- See Also:
- Constant Field Values
-
PROPERTY_THEME
public static final String PROPERTY_THEME
- See Also:
- Constant Field Values
-
chartType
protected ChartTypeEnum chartType
-
showLegend
protected Boolean showLegend
-
evaluationTime
protected EvaluationTimeEnum evaluationTime
-
linkType
protected String linkType
-
linkTarget
protected String linkTarget
-
titleColor
protected Color titleColor
-
subtitleColor
protected Color subtitleColor
-
legendColor
protected Color legendColor
-
legendBackgroundColor
protected Color legendBackgroundColor
-
legendPosition
protected EdgeEnum legendPosition
-
titlePosition
protected EdgeEnum titlePosition
-
renderType
protected String renderType
-
theme
protected String theme
-
lineBox
protected JRLineBox lineBox
-
titleFont
protected JRFont titleFont
-
subtitleFont
protected JRFont subtitleFont
-
legendFont
protected JRFont legendFont
-
customizerClass
protected String customizerClass
-
evaluationGroup
protected String evaluationGroup
-
titleExpression
protected JRExpression titleExpression
-
subtitleExpression
protected JRExpression subtitleExpression
-
anchorNameExpression
protected JRExpression anchorNameExpression
-
bookmarkLevelExpression
protected JRExpression bookmarkLevelExpression
-
hyperlinkReferenceExpression
protected JRExpression hyperlinkReferenceExpression
-
hyperlinkWhenExpression
protected JRExpression hyperlinkWhenExpression
-
hyperlinkAnchorExpression
protected JRExpression hyperlinkAnchorExpression
-
hyperlinkPageExpression
protected JRExpression hyperlinkPageExpression
-
dataset
protected JRChartDataset dataset
-
plot
protected JRChartPlot plot
-
bookmarkLevel
protected int bookmarkLevel
The bookmark level for the anchor associated with this chart.- See Also:
JRAnchor.getBookmarkLevel()
-
-
Constructor Detail
-
JRBaseChart
protected JRBaseChart(JRChart chart, ChartsBaseObjectFactory factory)
-
-
Method Detail
-
getShowLegend
public Boolean getShowLegend()
- Specified by:
getShowLegend
in interfaceJRChart
-
setShowLegend
public void setShowLegend(Boolean isShowLegend)
- Specified by:
setShowLegend
in interfaceJRChart
-
getEvaluationTime
public EvaluationTimeEnum getEvaluationTime()
Description copied from interface:JREvaluation
Gets the evaluation time for this text field.- Specified by:
getEvaluationTime
in interfaceJREvaluation
- Returns:
- one of the evaluation time constants in
JRExpression
-
getEvaluationGroup
public String getEvaluationGroup()
Description copied from interface:JREvaluation
Gets the evaluation group for this text field. Used only when evaluation time is group.- Specified by:
getEvaluationGroup
in interfaceJREvaluation
- See Also:
EvaluationTimeEnum.GROUP
-
getLineBox
public JRLineBox getLineBox()
- Specified by:
getLineBox
in interfaceJRBoxContainer
-
getTitleFont
public JRFont getTitleFont()
- Specified by:
getTitleFont
in interfaceJRChart
-
getTitlePosition
public EdgeEnum getTitlePosition()
Description copied from interface:JRChart
Gets the title position relative to the chart.- Specified by:
getTitlePosition
in interfaceJRChart
-
setTitlePosition
public void setTitlePosition(EdgeEnum titlePosition)
Description copied from interface:JRChart
Sets the title position relative to the chart.- Specified by:
setTitlePosition
in interfaceJRChart
-
getTitleColor
public Color getTitleColor()
- Specified by:
getTitleColor
in interfaceJRChart
-
getOwnTitleColor
public Color getOwnTitleColor()
- Specified by:
getOwnTitleColor
in interfaceJRChart
-
setTitleColor
public void setTitleColor(Color titleColor)
- Specified by:
setTitleColor
in interfaceJRChart
-
getSubtitleFont
public JRFont getSubtitleFont()
- Specified by:
getSubtitleFont
in interfaceJRChart
-
getOwnSubtitleColor
public Color getOwnSubtitleColor()
- Specified by:
getOwnSubtitleColor
in interfaceJRChart
-
getSubtitleColor
public Color getSubtitleColor()
- Specified by:
getSubtitleColor
in interfaceJRChart
-
setSubtitleColor
public void setSubtitleColor(Color subtitleColor)
- Specified by:
setSubtitleColor
in interfaceJRChart
-
getLegendBackgroundColor
public Color getLegendBackgroundColor()
- Specified by:
getLegendBackgroundColor
in interfaceJRChart
-
getOwnLegendBackgroundColor
public Color getOwnLegendBackgroundColor()
- Specified by:
getOwnLegendBackgroundColor
in interfaceJRChart
-
getOwnLegendColor
public Color getOwnLegendColor()
- Specified by:
getOwnLegendColor
in interfaceJRChart
-
getLegendColor
public Color getLegendColor()
- Specified by:
getLegendColor
in interfaceJRChart
-
getLegendFont
public JRFont getLegendFont()
- Specified by:
getLegendFont
in interfaceJRChart
-
setLegendBackgroundColor
public void setLegendBackgroundColor(Color legendBackgroundColor)
- Specified by:
setLegendBackgroundColor
in interfaceJRChart
-
setLegendColor
public void setLegendColor(Color legendColor)
- Specified by:
setLegendColor
in interfaceJRChart
-
getLegendPosition
public EdgeEnum getLegendPosition()
- Specified by:
getLegendPosition
in interfaceJRChart
-
setLegendPosition
public void setLegendPosition(EdgeEnum legendPosition)
- Specified by:
setLegendPosition
in interfaceJRChart
-
getHyperlinkType
public HyperlinkTypeEnum getHyperlinkType()
Description copied from interface:JRHyperlink
Retrieves the hyperlink type for the element.The actual hyperlink type is determined by
getLinkType()
. This method can is used to determine whether the hyperlink type is one of the built-in types or a custom type. When hyperlink is of custom type,CUSTOM
is returned.- Specified by:
getHyperlinkType
in interfaceJRHyperlink
- Returns:
- one of the hyperlink type constants
- See Also:
JRHyperlink.getLinkType()
-
getHyperlinkTarget
public HyperlinkTargetEnum getHyperlinkTarget()
Description copied from interface:JRHyperlink
Retrieves the hyperlink target for the element.The actual hyperlink target is determined by
getLinkTarget()
. This method can is used to determine whether the hyperlink target is one of the built-in target names or a custom one. When hyperlink has a custom target name,HyperlinkTargetEnum.CUSTOM
is returned.- Specified by:
getHyperlinkTarget
in interfaceJRHyperlink
- Returns:
- one of the hyperlink target constants
- See Also:
JRHyperlink.getLinkTarget()
-
getTitleExpression
public JRExpression getTitleExpression()
Description copied from interface:JRChart
Gets the expression whose evaluation will form the title.- Specified by:
getTitleExpression
in interfaceJRChart
-
getSubtitleExpression
public JRExpression getSubtitleExpression()
Description copied from interface:JRChart
Gets the expression whose evaluation will form the subtitle.- Specified by:
getSubtitleExpression
in interfaceJRChart
-
getBookmarkLevelExpression
public JRExpression getBookmarkLevelExpression()
Description copied from interface:JRAnchor
Returns an expression whose value represents the bookmark level (starting from 1) corresponding to this anchor. When the expression is set and its value is not null, it will override the value of the bookmarkLevel attribute.- Specified by:
getBookmarkLevelExpression
in interfaceJRAnchor
-
getAnchorNameExpression
public JRExpression getAnchorNameExpression()
Description copied from interface:JRAnchor
Returns an expression whose value represents the anchor name.- Specified by:
getAnchorNameExpression
in interfaceJRAnchor
-
getHyperlinkReferenceExpression
public JRExpression getHyperlinkReferenceExpression()
Description copied from interface:JRHyperlink
Returns the expression whose value represents the hyperlink reference. It is only used when the hyperlink type is reference or anchor- Specified by:
getHyperlinkReferenceExpression
in interfaceJRHyperlink
-
getHyperlinkWhenExpression
public JRExpression getHyperlinkWhenExpression()
Description copied from interface:JRHyperlink
Returns the expression that is evaluated in order to decide if the hyperlink should be displayed. This expression always returns a boolean value.- Specified by:
getHyperlinkWhenExpression
in interfaceJRHyperlink
-
getHyperlinkAnchorExpression
public JRExpression getHyperlinkAnchorExpression()
Description copied from interface:JRHyperlink
Returns the expression whose value represents the anchor. It is only used when the hyperlink type is anchor.- Specified by:
getHyperlinkAnchorExpression
in interfaceJRHyperlink
-
getHyperlinkPageExpression
public JRExpression getHyperlinkPageExpression()
Description copied from interface:JRHyperlink
Returns an integer representing the page index of the link. It is only used when the hyperlink type is page. If the expression does not evaluate to an integer, an exception will be thrown.- Specified by:
getHyperlinkPageExpression
in interfaceJRHyperlink
-
getDataset
public JRChartDataset getDataset()
Description copied from interface:JRChart
Gets the chart dataset. Most chart types have different dataset structures, depending on the chart type.- Specified by:
getDataset
in interfaceJRChart
-
getPlot
public JRChartPlot getPlot()
Description copied from interface:JRChart
Gets the chart plot. Plots are used to define various chart visual properties, such as colors and transparency.
-
getChartType
public ChartTypeEnum getChartType()
Description copied from interface:JRChart
Gets the chart type. It must be one of the chart type constants in this class.- Specified by:
getChartType
in interfaceJRChart
-
getRenderType
public String getRenderType()
- Specified by:
getRenderType
in interfaceJRChart
-
setRenderType
public void setRenderType(String renderType)
- Specified by:
setRenderType
in interfaceJRChart
-
collectExpressions
public void collectExpressions(JRExpressionCollector collector)
- Specified by:
collectExpressions
in interfaceJRElement
-
visit
public void visit(JRVisitor visitor)
- Specified by:
visit
in interfaceJRVisitable
-
getBookmarkLevel
public int getBookmarkLevel()
Description copied from interface:JRAnchor
Returns the level of the bookmark corresponding to the anchor.- Specified by:
getBookmarkLevel
in interfaceJRAnchor
- Returns:
- the level of the bookmark corresponding to the anchor (starting from 1)
or
NO_BOOKMARK
if no bookmark should be created for this anchor
-
getCustomizerClass
public String getCustomizerClass()
Description copied from interface:JRChart
Gets a user specified chart customizer class name.- Specified by:
getCustomizerClass
in interfaceJRChart
- See Also:
JRChartCustomizer
-
getMode
public ModeEnum getMode()
Description copied from interface:JRCommonElement
Returns the element transparency mode. The default value depends on the type of the report element. Graphic elements like rectangles and lines are opaque by default, but the images are transparent. Both static texts and text fields are transparent by default, and so are the subreport elements.- Specified by:
getMode
in interfaceJRCommonElement
- Overrides:
getMode
in classJRBaseElement
-
getLinkType
public String getLinkType()
Description copied from interface:JRHyperlink
Returns the hyperlink type.The type can be one of the built-in types (Reference, LocalAnchor, LocalPage, RemoteAnchor, RemotePage), or can be an arbitrary type.
- Specified by:
getLinkType
in interfaceJRHyperlink
- Returns:
- the hyperlink type
-
getLinkTarget
public String getLinkTarget()
Description copied from interface:JRHyperlink
Returns the hyperlink target name.The type can be one of the built-in names (Self, Blank, Top, Parent), or can be an arbitrary name.
- Specified by:
getLinkTarget
in interfaceJRHyperlink
- Returns:
- the hyperlink target name
-
getHyperlinkParameters
public JRHyperlinkParameter[] getHyperlinkParameters()
Description copied from interface:JRHyperlink
Returns the list of hyperlink parameters.The parameters can be used by custom hyperlink types to generate dynamic links.
- Specified by:
getHyperlinkParameters
in interfaceJRHyperlink
- Returns:
- the list of hyperlink parameters
-
getHyperlinkTooltipExpression
public JRExpression getHyperlinkTooltipExpression()
Description copied from interface:JRHyperlink
Returns the expression which will generate the hyperlink tooltip.- Specified by:
getHyperlinkTooltipExpression
in interfaceJRHyperlink
- Returns:
- the expression which will generate the hyperlink tooltip
-
getDefaultLineColor
public Color getDefaultLineColor()
- Specified by:
getDefaultLineColor
in interfaceJRBoxContainer
-
clone
public Object clone()
- Specified by:
clone
in interfaceJRCloneable
- Overrides:
clone
in classJRBaseElement
-
-