public abstract class AbstractPlot extends java.lang.Object implements ChartPlot
Modifier and Type | Class and Description |
---|---|
static class |
AbstractPlot.GradientSetting
The gradient paint setting for the colorization of the chart items.
|
Modifier and Type | Field and Description |
---|---|
static java.awt.Color[] |
DEFAULT_COLOR_SEQUENCE
The default order of colors.
|
static float |
DEFAULT_FOREGROUND_ALPHA
The default foreground alpha
|
static int |
DEFAULT_ITEM_LABEL_COLOR
Default color of the item labels.
|
static java.awt.Font |
DEFAULT_ITEM_LABEL_FONT
Default font of the item labels.
|
static int |
DEFAULT_OUTLINE_COLOR
Default outline color.
|
static int |
DEFAULT_OUTLINE_STYLE
Default outline style.
|
static int |
DEFAULT_OUTLINE_WIDTH
Default outline width.
|
static java.lang.String |
TOKEN_PLOT
XML token for a plot element.
|
Modifier and Type | Method and Description |
---|---|
int |
getBackColor()
Returns the ABGR value representing the background color.
|
FormulaField |
getColorFormula()
Returns the color formula which determines the color at run-time.
|
java.awt.Color[] |
getColorSequence()
Returns the user defined color sequence of this chart plot.
|
float |
getForegroundAlpha()
Returns the alpha value for the foreground color: 1.0 is fully opaque, while 0.0 is fully transparent.
|
AbstractPlot.GradientSetting |
getGradientSetting()
Returns the gradient paint settings.
|
int |
getItemLabelColor()
Returns the ABGR value representing the color of the item labels.
|
java.awt.Font |
getItemLabelFont()
Returns font for the item labels.
|
ChartFormat |
getItemLabelFormat()
Returns the format for the item value.
|
ItemShape |
getItemShape()
Returns the item shape settings for this plot.
|
int |
getOutlineColor()
Returns the ABGR value representing the chart items outline color.
|
int |
getOutlineStyle()
Returns the chart items' outline style.
|
int |
getOutlineWidth()
Returns the chart outline's width.
|
java.util.List |
getReferencedObject()
|
abstract ChartStyle |
getStyle()
Returns the style of this chart, ie. the general category this plot belongs to.
|
protected java.lang.StringBuilder |
getSubProperties(int depth)
Returns the serialized simple properties of subclasses.
|
boolean |
isColorBySeries()
Returns whether the chart items are colored by series or by groups.
|
boolean |
isDrawOutline()
Returns whether or not to draw the outline.
|
boolean |
isSameColorsForSameGroups()
Returns whether identical groups will have the same color.
|
boolean |
isShowLabel()
Returns whether or not to show labels in the plot.
|
boolean |
isShowValue()
Returns whether or not to show the values in the plot.
|
void |
readProperties(org.w3c.dom.Element element,
Chart2 chart)
Reads the chart properties from the DOMParser Element.
|
abstract void |
refreshAutoTitles(Chart2 chart)
Reads out the data column names from dataset and refreshes the chart labels.
|
void |
saveProperties(java.io.PrintWriter out,
int depth)
Writes the properties of this chart plot to
PrintWriter . |
protected void |
saveSubProperties(java.io.PrintWriter out,
int depth)
Writes the intern properties to output.
|
void |
setBackColor(int backgroundColor)
Sets the ABGR value representing the background color.
|
void |
setColorBySeries(boolean colorBySeries)
Sets whether the chart items are colored by series or by groups.
|
void |
setColorFormula(FormulaField colorFormula)
Sets the color formula which determines the color at run-time.
|
void |
setColorSequence(java.awt.Color[] colorSequence)
Sets the user defined color sequence for this chart plot.
|
void |
setDrawOutline(boolean drawOutline)
Sets whether or not to draw the outline.
|
void |
setForegroundAlpha(float foregroundAlpha)
Sets the alpha (opaqueness) value for the foreground color: 1.0 is fully opaque, while 0.0 is fully transparent.
|
void |
setGradientSetting(AbstractPlot.GradientSetting gradientSetting)
Sets the gradient paint settings.
|
void |
setItemLabelColor(int itemLabelColor)
Sets the ABGR value representing the color of the item labels.
|
void |
setItemLabelFont(java.awt.Font itemLabelFont)
Sets the font of the item labels.
|
void |
setItemLabelFormat(ChartFormat valueFormat)
Sets the format for the item value.
|
void |
setItemShape(ItemShape itemShape)
Sets the item shape properties for this plot.
|
void |
setOutlineColor(int outlineColor)
Sets the ABGR components of the chart items outline color.
|
void |
setOutlineStyle(int outlineStyle)
Sets the chart items' outline style.
|
void |
setOutlineWidth(int outlineWidth)
Sets the chart items' outline width (in twips).
|
void |
setSameColorsForSameGroups(boolean sameColorsForSameGroups)
Sets whether identical groups will have the same color.
|
void |
setShowLabel(boolean showLabel)
Sets whether or not to show labels in the plot.
|
void |
setShowValue(boolean showValue)
Sets whether or not to show the values in the plot.
|
getDataset
public static final java.lang.String TOKEN_PLOT
public static final java.awt.Color[] DEFAULT_COLOR_SEQUENCE
public static final float DEFAULT_FOREGROUND_ALPHA
public static final java.awt.Font DEFAULT_ITEM_LABEL_FONT
public static final int DEFAULT_ITEM_LABEL_COLOR
public static final int DEFAULT_OUTLINE_STYLE
public static final int DEFAULT_OUTLINE_WIDTH
public static final int DEFAULT_OUTLINE_COLOR
public int getBackColor()
setBackColor(int)
,
ColorUtils.toJavaColor(int)
public void setBackColor(int backgroundColor)
backgroundColor
- the background colorgetBackColor()
,
ColorUtils.toCcColor(Color)
public ItemShape getItemShape()
setItemShape(ItemShape)
,
ItemShape
public void setItemShape(ItemShape itemShape)
itemShape
- the properties object (null
not permitted)getItemShape()
,
ItemShape
public int getOutlineColor()
setOutlineColor(int)
,
ColorUtils.toJavaColor(int)
public void setOutlineColor(int outlineColor)
outlineColor
- the chart items' outline colorjava.lang.IllegalArgumentException
- if the color is RDC.COLOR_NO_COLOR
.getOutlineColor()
,
ColorUtils.toCcColor(Color)
public int getOutlineStyle()
BorderPropertiesConstants.LINE_STYLE_DASHED
,
BorderPropertiesConstants.LINE_STYLE_DOTTED
,
BorderPropertiesConstants.LINE_STYLE_SINGLE
,
BorderPropertiesConstants.NO_LINE
public void setOutlineStyle(int outlineStyle)
outlineStyle
- the stylejava.lang.IllegalArgumentException
- if the parameter is not one of the supported outline stylesgetOutlineStyle()
,
BorderPropertiesConstants.LINE_STYLE_DASHED
,
BorderPropertiesConstants.LINE_STYLE_DOTTED
,
BorderPropertiesConstants.LINE_STYLE_SINGLE
,
BorderPropertiesConstants.NO_LINE
public int getOutlineWidth()
public void setOutlineWidth(int outlineWidth)
outlineWidth
- the outline width of the chart itemsjava.lang.IllegalArgumentException
- if width is less than 1.public boolean isDrawOutline()
true
the outline is to be drawn.public void setDrawOutline(boolean drawOutline)
drawOutline
- true
if outline is to be drawn.public boolean isShowLabel()
true
if labels are to be shown.public void setShowLabel(boolean showLabel)
showLabel
- true
if labels are to be shown.public boolean isShowValue()
true
if values are to be shown.public void setShowValue(boolean showValue)
showValue
- set true
if values are to be shown.public ChartFormat getItemLabelFormat()
setItemLabelFormat(ChartFormat)
public void setItemLabelFormat(ChartFormat valueFormat)
null
, which means that
the values are to be formatted automatically.
Note: for chart with number values, only formats extended from NumberFormat
are allowed,
while for date charts, only formats extended from DateFormat
are allowed.valueFormat
- the format (null
permitted)getItemLabelFormat()
public boolean isSameColorsForSameGroups()
true
if the same color is to be used for identical groups.public void setSameColorsForSameGroups(boolean sameColorsForSameGroups)
sameColorsForSameGroups
- true
if the same color is to be used for identical groups.public FormulaField getColorFormula()
null
if there is none.setColorFormula(FormulaField)
,
FormulaField
public void setColorFormula(FormulaField colorFormula)
FormulaField.FORMULA_PROPERTY
.colorFormula
- the color formula (null
permitted)java.lang.IllegalArgumentException
- if the formula has the wrong type.getColorFormula()
,
Fields.addFormulaField(String, String, int)
,
FormulaField
,
FormulaField.getFormulaType()
public java.awt.Color[] getColorSequence()
DEFAULT_COLOR_SEQUENCE
.null
which means the default
color sequence will be usedsetColorSequence(Color[])
public void setColorSequence(java.awt.Color[] colorSequence)
DEFAULT_COLOR_SEQUENCE
.colorSequence
- the array of colors (null
permitted)java.lang.IllegalArgumentException
- if an empty color sequence is passedgetColorSequence()
,
DEFAULT_COLOR_SEQUENCE
public AbstractPlot.GradientSetting getGradientSetting()
null
without gradient paint for chart itemspublic void setGradientSetting(AbstractPlot.GradientSetting gradientSetting)
gradientSetting
- the gradient paint for the chart items (null
permitted)public boolean isColorBySeries()
setColorBySeries(boolean)
public void setColorBySeries(boolean colorBySeries)
colorBySeries
- true if the chart items are colored according to their series, and false if the chart items are colored according to their groupsisColorBySeries()
public float getForegroundAlpha()
public void setForegroundAlpha(float foregroundAlpha)
foregroundAlpha
- the alpha value for the foreground colorjava.lang.IllegalArgumentException
- if foregroundAlpha is less than 0.0 or greater than 1.0.public java.awt.Font getItemLabelFont()
setItemLabelFont(Font)
public void setItemLabelFont(java.awt.Font itemLabelFont)
itemLabelFont
- the font (null
not permitted)getItemLabelFont()
public int getItemLabelColor()
ColorUtils.toJavaColor(int)
to
convert this value to a Java Color.ColorUtils.toJavaColor(int)
,
setItemLabelColor(int)
public void setItemLabelColor(int itemLabelColor)
ColorUtils.toCcColor(Color)
to
convert a Java color to an int value.itemLabelColor
- ABGR components of the item labels' colorjava.lang.IllegalArgumentException
- if RDC.COLOR_NO_COLOR
is passed.ColorUtils.toCcColor(Color)
,
getItemLabelColor()
public abstract void refreshAutoTitles(Chart2 chart)
refreshAutoTitles
in interface ChartPlot
chart
- the chartpublic abstract ChartStyle getStyle()
BarStyle.BAR2D
,
LineStyle.LINE_MARKER
,
AreaStyle.AREA2D_STACKED
public java.util.List getReferencedObject()
getReferencedObject
in interface ChartPlot
public void saveProperties(java.io.PrintWriter out, int depth)
PrintWriter
.saveProperties
in interface ChartPlot
out
- the outputdepth
- the depth of XML indentprotected java.lang.StringBuilder getSubProperties(int depth)
depth
- the depth of XML indentprotected void saveSubProperties(java.io.PrintWriter out, int depth)
PrintWriter
without building a StringBuilder
.out
- the outputdepth
- the depth of XML indentpublic void readProperties(org.w3c.dom.Element element, Chart2 chart)
readProperties
in interface ChartPlot
element
- the DOMParser Elementchart
- the chartCopyright © 1999-2020 by i-net software GmbH