Package com.inet.report.chart
Class Legend
java.lang.Object
com.inet.report.chart.Legend
- All Implemented Interfaces:
Serializable
The class responsible for the settings of the charts legend.
- Since:
- 8.0
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the ABGR value representing the background color.intReturns the ABGR value representing the legend color.Returns the font for all labels in this legend.Returns the placement of the legend in the chart.intReturns the ABGR value representing the legend's outline's color.intReturns the legend's outline's style.intReturns the width of the legend's outline in twips.booleanReturns whether or not to draw the outline of legend.voidreadProperties(Element element) Loads the properties of a chart legend from an XML element.voidsaveProperties(PrintWriter out, int depth) Writes the properties of this legend toPrintWriteras XML.voidsetBackColor(int backgroundColor) Sets the ABGR value representing the legend's background color.voidsetDrawOutline(boolean drawOutline) Sets whether or not to draw the outline of legend.voidsetLegendColor(int legendColor) Sets the ABGR value representing the legend color.voidsetLegendFont(Font legendFont) Sets the font for all labels in this legend.voidsetLegendPlacement(LegendPlacement legendPlacement) Sets a placement of the legend in the chart.voidsetOutlineColor(int outlineColor) Sets the ABGR components of the legend's outline's color.voidsetOutlineStyle(int outlineStyle) Sets the style of the legend's outline.voidsetOutlineWidth(int outlineWidth) Sets the width of the legend's outline in twips.
-
Field Details
-
DEFAULT_FONT
Default legend font. -
DEFAULT_LABEL_COLOR
public static final int DEFAULT_LABEL_COLORDefault legend color.- See Also:
-
DEFAULT_LEGEND_OUTLINE_COLOR
public static final int DEFAULT_LEGEND_OUTLINE_COLORDefault legend outline color.- See Also:
-
TOKEN_LEGEND
XML token for legend element.- See Also:
-
-
Constructor Details
-
Legend
public Legend()Creates a legend with default properties.- Since:
- 8.0
-
-
Method Details
-
isDrawOutline
public boolean isDrawOutline()Returns whether or not to draw the outline of legend.- Returns:
truethe outline is to be drawn.- Since:
- 8.0
-
setDrawOutline
public void setDrawOutline(boolean drawOutline) Sets whether or not to draw the outline of legend.- Parameters:
drawOutline-trueif outline is to be drawn.- Since:
- 8.0
-
getLegendPlacement
Returns the placement of the legend in the chart.- Returns:
- the legend placement
- Since:
- 8.0
- See Also:
-
setLegendPlacement
Sets a placement of the legend in the chart. To hide the legend, useLegendPlacement.NONE.- Parameters:
legendPlacement- the placement object (nullnot permitted)- Throws:
IllegalArgumentException- if the legend placement isnull.- Since:
- 8.0
-
getLegendFont
Returns the font for all labels in this legend.- Returns:
- the legend font.
- Since:
- 8.0
- See Also:
-
setLegendFont
Sets the font for all labels in this legend.- Parameters:
legendFont- the legend font (nullnot permitted)- Since:
- 8.0
- See Also:
-
getLegendColor
public int getLegendColor()Returns the ABGR value representing the legend color.- Returns:
- the ABGR value representing the legend color.
- Since:
- 8.0
- See Also:
-
ColorUtils.toJavaColor(int)setLegendColor(int)
-
setLegendColor
public void setLegendColor(int legendColor) Sets the ABGR value representing the legend color.- Parameters:
legendColor- ABGR components of the legend color - may not beRDC.COLOR_NO_COLOR- Throws:
IllegalArgumentException- if the color isRDC.COLOR_NO_COLOR.- Since:
- 8.0
- See Also:
-
ColorUtils.toCcColor(Color)getLegendColor()
-
getBackColor
public int getBackColor()Returns the ABGR value representing the background color.- Returns:
- the background color
- Since:
- 8.0
- See Also:
-
setBackColor(int)ColorUtils.toJavaColor(int)
-
setBackColor
public void setBackColor(int backgroundColor) Sets the ABGR value representing the legend's background color.- Parameters:
backgroundColor- a background color- Since:
- 8.0
- See Also:
-
getBackColor()ColorUtils.toCcColor(Color)
-
getOutlineColor
public int getOutlineColor()Returns the ABGR value representing the legend's outline's color.- Returns:
- the legend's outline's color
- Since:
- 8.0
- See Also:
-
setOutlineColor(int)ColorUtils.toJavaColor(int)
-
setOutlineColor
public void setOutlineColor(int outlineColor) Sets the ABGR components of the legend's outline's color.- Parameters:
outlineColor- the color of the legend's outline, may not beRDC.COLOR_NO_COLOR- Throws:
IllegalArgumentException- if the color isRDC.COLOR_NO_COLOR.- Since:
- 8.0
- See Also:
-
getOutlineColor()ColorUtils.toCcColor(Color)DEFAULT_LEGEND_OUTLINE_COLOR
-
getOutlineStyle
public int getOutlineStyle()Returns the legend's outline's style.- Returns:
- the style of the legend's outline
- Since:
- 8.0
- See Also:
-
setOutlineStyle(int)BorderPropertiesConstants.NO_LINEBorderPropertiesConstants.LINE_STYLE_SINGLEBorderPropertiesConstants.LINE_STYLE_DASHEDBorderPropertiesConstants.LINE_STYLE_DOTTED
-
setOutlineStyle
public void setOutlineStyle(int outlineStyle) Sets the style of the legend's outline.- Parameters:
outlineStyle- the legend's outline's style- Throws:
IllegalArgumentException- if an unsupported line style is passed.- Since:
- 8.0
- See Also:
-
getOutlineStyle()BorderPropertiesConstants.NO_LINEBorderPropertiesConstants.LINE_STYLE_SINGLEBorderPropertiesConstants.LINE_STYLE_DASHEDBorderPropertiesConstants.LINE_STYLE_DOTTED
-
getOutlineWidth
public int getOutlineWidth()Returns the width of the legend's outline in twips.- Returns:
- the width
- Since:
- 8.0
- See Also:
-
setOutlineWidth
public void setOutlineWidth(int outlineWidth) Sets the width of the legend's outline in twips.- Parameters:
outlineWidth- the width of the legend's outline- Throws:
IllegalArgumentException- if the width is less than 1.- Since:
- 8.0
- See Also:
-
saveProperties
Writes the properties of this legend toPrintWriteras XML.- Parameters:
out- the output stream to write todepth- the depth of XML indent to prefix each line with- Since:
- 8.0
-
readProperties
Loads the properties of a chart legend from an XML element.- Parameters:
element- DOM element- Since:
- 8.0
-