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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Returns the ABGR value representing the background color.int
Returns 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.int
Returns the ABGR value representing the legend's outline's color.int
Returns the legend's outline's style.int
Returns the width of the legend's outline in twips.boolean
Returns whether or not to draw the outline of legend.void
readProperties
(Element element) Loads the properties of a chart legend from an XML element.void
saveProperties
(PrintWriter out, int depth) Writes the properties of this legend toPrintWriter
as XML.void
setBackColor
(int backgroundColor) Sets the ABGR value representing the legend's background color.void
setDrawOutline
(boolean drawOutline) Sets whether or not to draw the outline of legend.void
setLegendColor
(int legendColor) Sets the ABGR value representing the legend color.void
setLegendFont
(Font legendFont) Sets the font for all labels in this legend.void
setLegendPlacement
(LegendPlacement legendPlacement) Sets a placement of the legend in the chart.void
setOutlineColor
(int outlineColor) Sets the ABGR components of the legend's outline's color.void
setOutlineStyle
(int outlineStyle) Sets the style of the legend's outline.void
setOutlineWidth
(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:
true
the 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
-true
if 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 (null
not 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 (null
not 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_LINE
BorderPropertiesConstants.LINE_STYLE_SINGLE
BorderPropertiesConstants.LINE_STYLE_DASHED
BorderPropertiesConstants.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_LINE
BorderPropertiesConstants.LINE_STYLE_SINGLE
BorderPropertiesConstants.LINE_STYLE_DASHED
BorderPropertiesConstants.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 toPrintWriter
as 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
-