public class Legend
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static java.awt.Font |
DEFAULT_FONT
Default legend font.
|
static int |
DEFAULT_LABEL_COLOR
Default legend color.
|
static int |
DEFAULT_LEGEND_OUTLINE_COLOR
Default legend outline color.
|
static java.lang.String |
TOKEN_LEGEND
XML token for legend element.
|
Constructor and Description |
---|
Legend()
Creates a legend with default properties.
|
Modifier and Type | Method and Description |
---|---|
int |
getBackColor()
Returns the ABGR value representing the background color.
|
int |
getLegendColor()
Returns the ABGR value representing the legend color.
|
java.awt.Font |
getLegendFont()
Returns the font for all labels in this legend.
|
LegendPlacement |
getLegendPlacement()
Returns the placement of the legend in the chart.
|
int |
getOutlineColor()
Returns the ABGR value representing the legend's outline's color.
|
int |
getOutlineStyle()
Returns the legend's outline's style.
|
int |
getOutlineWidth()
Returns the width of the legend's outline in twips.
|
boolean |
isDrawOutline()
Returns whether or not to draw the outline of legend.
|
void |
readProperties(org.w3c.dom.Element element)
Loads the properties of a chart legend from an XML element.
|
void |
saveProperties(java.io.PrintWriter out,
int depth)
Writes the properties of this legend to
PrintWriter 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(java.awt.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.
|
public static final java.awt.Font DEFAULT_FONT
public static final int DEFAULT_LABEL_COLOR
public static final int DEFAULT_LEGEND_OUTLINE_COLOR
public static final java.lang.String TOKEN_LEGEND
public boolean isDrawOutline()
true
the outline is to be drawn.public void setDrawOutline(boolean drawOutline)
drawOutline
- true
if outline is to be drawn.public LegendPlacement getLegendPlacement()
setLegendPlacement(LegendPlacement)
,
LegendPlacement
public void setLegendPlacement(LegendPlacement legendPlacement)
LegendPlacement.NONE
.legendPlacement
- the placement object (null
not permitted)java.lang.IllegalArgumentException
- if the legend placement is null
.public java.awt.Font getLegendFont()
setLegendFont(Font)
public void setLegendFont(java.awt.Font legendFont)
legendFont
- the legend font (null
not permitted)getLegendFont()
public int getLegendColor()
ColorUtils.toJavaColor(int)
,
setLegendColor(int)
public void setLegendColor(int legendColor)
legendColor
- ABGR components of the legend color - may not be RDC.COLOR_NO_COLOR
java.lang.IllegalArgumentException
- if the color is RDC.COLOR_NO_COLOR
.ColorUtils.toCcColor(Color)
,
getLegendColor()
public int getBackColor()
setBackColor(int)
,
ColorUtils.toJavaColor(int)
public void setBackColor(int backgroundColor)
backgroundColor
- a background colorgetBackColor()
,
ColorUtils.toCcColor(Color)
public int getOutlineColor()
setOutlineColor(int)
,
ColorUtils.toJavaColor(int)
public void setOutlineColor(int outlineColor)
outlineColor
- the color of the legend's outline, may not be RDC.COLOR_NO_COLOR
java.lang.IllegalArgumentException
- if the color is RDC.COLOR_NO_COLOR
.getOutlineColor()
,
ColorUtils.toCcColor(Color)
,
DEFAULT_LEGEND_OUTLINE_COLOR
public int getOutlineStyle()
setOutlineStyle(int)
,
BorderPropertiesConstants.NO_LINE
,
BorderPropertiesConstants.LINE_STYLE_SINGLE
,
BorderPropertiesConstants.LINE_STYLE_DASHED
,
BorderPropertiesConstants.LINE_STYLE_DOTTED
public void setOutlineStyle(int outlineStyle)
outlineStyle
- the legend's outline's stylejava.lang.IllegalArgumentException
- if an unsupported line style is passed.getOutlineStyle()
,
BorderPropertiesConstants.NO_LINE
,
BorderPropertiesConstants.LINE_STYLE_SINGLE
,
BorderPropertiesConstants.LINE_STYLE_DASHED
,
BorderPropertiesConstants.LINE_STYLE_DOTTED
public int getOutlineWidth()
setOutlineWidth(int)
public void setOutlineWidth(int outlineWidth)
outlineWidth
- the width of the legend's outlinejava.lang.IllegalArgumentException
- if the width is less than 1.getOutlineWidth()
public void saveProperties(java.io.PrintWriter out, int depth)
PrintWriter
as XML.out
- the output stream to write todepth
- the depth of XML indent to prefix each line withpublic void readProperties(org.w3c.dom.Element element)
element
- DOM elementCopyright © 1999-2020 by i-net software GmbH