Package com.inet.report.chart
Class ChartTitle
- java.lang.Object
-
- com.inet.report.chart.ChartTitle
-
- All Implemented Interfaces:
java.io.Serializable
public class ChartTitle extends java.lang.Object implements java.io.SerializableA chart title that displays a text string with defined font and color.- Since:
- 8.0
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringTOKEN_AXISThe XML token for an axis title.static java.lang.StringTOKEN_FOOTNOTEThe XML token for a footnote title.static java.lang.StringTOKEN_HEADERThe XML token for a header title.static java.lang.StringTOKEN_SUBTITLEThe XML token for a subtitle.
-
Constructor Summary
Constructors Constructor Description ChartTitle(java.awt.Font titleFont, int color)Creates a chart title with the given properties.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ChartTitleclone()intgetColor()Returns the ABGR value of color for this title.java.awt.FontgetFont()Returns the font of the label.java.lang.StringgetTitle()Returns this title's text.FormulaFieldgetTitleFormula()Returns the property formula for the chart title, if it is specified.booleanisEqualToDefault(ChartTitle defaultTitle)Returnstrueif this title is equal to default.booleanisShowAutoTitle()Returns whether or not this title is to be an automatically generated label.voidreadProperties(org.w3c.dom.Element element, Chart2 chart)Reads the XML properties of a chart title.voidsaveProperties(java.lang.StringBuilder buffer, java.lang.String type, int depth)Writes the properties of the title toPrintWriter.voidsetColor(int titleColor)Sets the ABGR value of color for this title.voidsetFont(java.awt.Font titleFont)Sets the font of the label.voidsetShowAutoTitle(boolean showAutoTitle)Sets whether or not this title is to be an automatically generated label.voidsetTitle(java.lang.String title)Sets this title.
Note: to use this property turn off the showing of auto title.voidsetTitleFormula(FormulaField titleFormula)Sets the formula which returns the title.
-
-
-
Field Detail
-
TOKEN_HEADER
public static final java.lang.String TOKEN_HEADER
The XML token for a header title.- See Also:
- Constant Field Values
-
TOKEN_SUBTITLE
public static final java.lang.String TOKEN_SUBTITLE
The XML token for a subtitle.- See Also:
- Constant Field Values
-
TOKEN_FOOTNOTE
public static final java.lang.String TOKEN_FOOTNOTE
The XML token for a footnote title.- See Also:
- Constant Field Values
-
TOKEN_AXIS
public static final java.lang.String TOKEN_AXIS
The XML token for an axis title.- See Also:
- Constant Field Values
-
-
Method Detail
-
isShowAutoTitle
public boolean isShowAutoTitle()
Returns whether or not this title is to be an automatically generated label.- Returns:
- whether or not this title is to be an automatically generated label
- Since:
- 8.0
- See Also:
setShowAutoTitle(boolean)
-
setShowAutoTitle
public void setShowAutoTitle(boolean showAutoTitle)
Sets whether or not this title is to be an automatically generated label.- Parameters:
showAutoTitle- whether or not the title is to be automatically generated- Since:
- 8.0
- See Also:
isShowAutoTitle()
-
getTitle
public java.lang.String getTitle()
Returns this title's text. If this title has been set to show an automatically generated label, this will show the automatically generated text, otherwise this will show the title set with setTitle.- Returns:
- the title text
- Since:
- 8.0
- See Also:
setTitle(String),setShowAutoTitle(boolean),setAutoTitle(String)
-
setTitle
public void setTitle(java.lang.String title)
Sets this title.
Note: to use this property turn off the showing of auto title.- Parameters:
title- the label (nullnot permitted)- Since:
- 8.0
- See Also:
getTitle(),setShowAutoTitle(boolean)
-
getColor
public int getColor()
Returns the ABGR value of color for this title.- Returns:
- the ABGR value representing the label color.
- Since:
- 8.0
- See Also:
ColorUtils.toJavaColor(int),setColor(int)
-
setColor
public void setColor(int titleColor)
Sets the ABGR value of color for this title.- Parameters:
titleColor- ABGR components of the color- Throws:
java.lang.IllegalArgumentException- byRDC.COLOR_NO_COLOR.- Since:
- 8.0
- See Also:
ColorUtils.toCcColor(Color),getColor()
-
getFont
public java.awt.Font getFont()
Returns the font of the label.- Returns:
- the font.
- Since:
- 8.0
- See Also:
setFont(Font)
-
setFont
public void setFont(java.awt.Font titleFont)
Sets the font of the label.- Parameters:
titleFont- the label font (nullnot permitted)- Since:
- 8.0
- See Also:
getFont()
-
isEqualToDefault
public boolean isEqualToDefault(ChartTitle defaultTitle)
Returnstrueif this title is equal to default.- Parameters:
defaultTitle- the default title- Returns:
trueif equal to default.- Since:
- 8.0
-
saveProperties
public void saveProperties(java.lang.StringBuilder buffer, java.lang.String type, int depth)Writes the properties of the title toPrintWriter.- Parameters:
buffer- the outputtype- the type of this title: header, footer or subtitledepth- the depth of XML indent- Since:
- 8.0
- See Also:
TOKEN_HEADER,TOKEN_FOOTNOTE,TOKEN_SUBTITLE
-
readProperties
public void readProperties(org.w3c.dom.Element element, Chart2 chart)Reads the XML properties of a chart title.- Parameters:
element- DOM elementchart- the current chart- Since:
- 8.0
- See Also:
saveProperties(StringBuilder, String, int)
-
clone
public ChartTitle clone()
- Overrides:
clonein classjava.lang.Object
-
setTitleFormula
public void setTitleFormula(FormulaField titleFormula)
Sets the formula which returns the title. Note that this formula is only used whenshowAutoTitleis off.- Parameters:
titleFormula- the formula foe the title- Since:
- i-net Clear Reports 12.0
-
getTitleFormula
public FormulaField getTitleFormula()
Returns the property formula for the chart title, if it is specified.- Returns:
- the formula or can be null.
- Since:
- i-net Clear Reports 12.0
-
-