public abstract class AbstractSVGChart extends java.lang.Object implements TWebView
Modifier and Type | Field and Description |
---|---|
protected java.awt.Rectangle |
backgroundBounds |
protected java.awt.Color |
backgroundColor |
protected java.awt.Color |
backgroundFillColor |
protected float |
backgroundFillOpacity |
protected boolean |
backgroundGradient |
protected java.awt.Color |
backgroundGradientColor |
protected int |
backgroundGradientFactory |
protected java.awt.Color |
backgroundOutlineColor |
protected java.lang.String |
backgroundStroke |
protected boolean |
backgroundVisible |
protected TDataBox |
box |
protected boolean |
enableZoomAndPan |
protected java.awt.Color |
foregroundColor |
protected java.text.NumberFormat |
format |
protected boolean |
gradient |
protected java.awt.Color |
gradientColor |
protected java.awt.Font |
legendFont |
protected int |
legendPosition |
protected int |
legendSize
Deprecated.
As of TWaver version 3.6
|
protected boolean |
legendVisible |
protected double |
lowerLimit |
protected double |
max |
protected double |
min |
protected java.util.Map |
proportions |
protected java.util.List |
proportionsOfRange |
protected java.util.List |
proportionsOfSum |
protected java.util.List |
publishedElements |
protected double |
range |
protected java.awt.Color |
selectedColor |
protected int |
selectedOffset |
protected java.lang.String |
selectedStroke |
protected int |
shadowOffset |
protected java.util.Comparator |
sortComparator |
protected java.lang.String |
stroke |
protected double |
sum |
protected java.lang.String |
svgXMLNS |
protected int |
textGap |
protected java.lang.String |
unit |
protected double |
upperLimit |
protected boolean |
valueTextCenter |
protected java.awt.Color |
valueTextColor |
protected java.awt.Font |
valueTextFont |
protected int |
valueTextPosition |
protected boolean |
valueTextVisible |
protected java.util.List |
visibleFilters |
protected int |
xGap |
protected int |
yGap |
Constructor and Description |
---|
AbstractSVGChart() |
AbstractSVGChart(TDataBox box) |
AbstractSVGChart(TDataBox box,
java.lang.String title,
java.awt.Color backgroundColor) |
AbstractSVGChart(TDataBox box,
java.lang.String title,
java.awt.Color backgroundColor,
java.awt.Color foregroundColor) |
Modifier and Type | Method and Description |
---|---|
void |
addVisibleFilter(VisibleFilter visibleFilter) |
protected void |
appendElementAttributesSVG(java.lang.StringBuffer result,
Element element)
Gets the element's attribute string.
|
protected void |
appendElementSelectionAttribute(java.lang.StringBuffer result) |
protected void |
appendSVGBackground(SVGContext context,
java.lang.StringBuffer result) |
protected void |
appendSVGPreDefine(SVGContext context,
java.lang.StringBuffer result) |
protected abstract void |
calculate() |
java.awt.Rectangle |
getBackgroundBounds() |
java.awt.Color |
getBackgroundColor() |
java.awt.Color |
getBackgroundFillColor() |
float |
getBackgroundFillOpacity() |
java.awt.Color |
getBackgroundGradientColor() |
int |
getBackgroundGradientFactory() |
java.awt.Color |
getBackgroundOutlineColor() |
java.lang.String |
getBackgroundStroke() |
java.awt.Color |
getColor(Element element)
Gets the color of a specified
Element object. |
TDataBox |
getDataBox()
Gets the databox connect to this view
This databox provides data for this view.
|
java.awt.Color |
getForegroundColor() |
java.text.NumberFormat |
getFormat()
Gets the number format of the chart panel,
the number format is used to format the value text.
|
java.text.NumberFormat |
getFormat(Element element)
Gets the number format of a specified
Element object. |
protected java.lang.String |
getFormatedText(Element element,
double value)
Gets the format text of the value by the number format of a specified
Element object. |
protected java.lang.String |
getFormatedText(Element element,
double value,
int index)
Gets the format text of the value by the number format of a specified
Element object. |
java.awt.Color |
getGradientColor()
Gets the gradient color.
|
protected java.awt.Color |
getGradientColor(Element element)
Gets the gradient color.
|
protected java.lang.String |
getGradientID(SVGContext context,
int type,
java.awt.Color gradientColor,
java.awt.Color fillColor)
Gets the gradient ID of the element.
|
java.awt.Font |
getLegendFont()
Gets the font of the legend.
|
java.lang.String |
getLegendLabel(Element element)
Gets the label of a specified
Element object,
which is shown in the legendPane. |
int |
getLegendPosition()
Gets the position of the legend.
|
int |
getLegendSize()
Deprecated.
As of TWaver version 3.6
replaced by
this.legendFont.getSize() |
double |
getLowerLimit()
Gets the lower limit of the chart panel,
the lowerLimit is the minimal scale of the y-axis
|
double |
getMax(Element element)
Gets the maximal of a specified
Element object. |
double |
getMin(Element element)
Gets the minimal value of a specified
Element object. |
java.awt.Color |
getSelectedColor(Element element)
Gets the color of the specified
Element object when it is selected. |
int |
getSelectedOffset()
Gets the offset which is used to show selected chart item.
|
java.awt.Stroke |
getSelectedStroke(Element element)
Gets the stroke of the specified
Element object when the element is selected. |
int |
getShadowOffset()
Gets the offset of the shadow,
the shadow is painted along x-axis and y-axis.
|
java.util.Comparator |
getSortComparator() |
java.lang.String |
getStroke()
Get the stroke of the chartPane.
|
java.awt.Stroke |
getStroke(Element element)
Gets the stroke of a specified
Element object. |
java.lang.String |
getSVGXMLNS()
Gets the svg xml namespace string
|
int |
getTextGap()
Gets the gap of the text which is shown in the chartPane,
such as scale along y-axis,the text of the point value in graphics panel.
|
java.lang.String |
getType() |
java.lang.String |
getUnit() |
double |
getUpperLimit()
Gets the upper limit of this chart,
the UpperLimit is the maximal scale value for the y-axis.
|
double |
getValue(Element element)
Gets the value of a specified
Element object. |
java.util.List |
getValues(Element element)
Gets the value list of a specified
Element object. |
java.awt.Color |
getValueTextColor() |
java.awt.Font |
getValueTextFont()
Gets the font of the value text .
|
int |
getValueTextPosition()
Gets the position of the value text.
|
int |
getXGap()
Gets the margin space of the chart panel on x coordinate.
|
int |
getYGap()
Gets the margin space of the chart panel on y coordinate.
|
protected java.lang.StringBuffer |
insertSVGHeadBefore(SVGContext context,
java.lang.StringBuffer result,
int width,
int height) |
boolean |
isBackgroundGradient() |
boolean |
isBackgroundVisible() |
boolean |
isEnableZoomAndPan() |
boolean |
isGradient()
Determines whether the graphics uses a GradientPaint to fill
|
boolean |
isLegendVisible()
Gets whether the legend is visible.
|
boolean |
isValueTextCenter() |
boolean |
isValueTextVisible()
Determines whether the value text is visible.
|
boolean |
isVisible(Element element)
Determines whether a specified
Element object is visible on this chart. |
protected void |
paintBackground(SVGContext context,
java.lang.StringBuffer result) |
protected void |
paintLegend(SVGContext context,
java.lang.StringBuffer result,
int width,
int height) |
void |
publishData() |
void |
removeVisibleFilter(VisibleFilter visibleFilter) |
void |
setBackgroundColor(java.awt.Color backgroundColor) |
void |
setBackgroundFillColor(java.awt.Color backgroundFillColor) |
void |
setBackgroundFillOpacity(float backgroundFillOpacity) |
void |
setBackgroundGradient(boolean backgroundGradient) |
void |
setBackgroundGradientColor(java.awt.Color backgroundGradientColor) |
void |
setBackgroundGradientFactory(int backgroundGradientFactory) |
void |
setBackgroundOutlineColor(java.awt.Color backgroundOutlineColor) |
void |
setBackgroundStroke(java.lang.String backgroundStroke) |
void |
setBackgroundVisible(boolean backgroundVisible) |
void |
setDataBox(TDataBox box)
Sets databox for this view.
|
void |
setEnableZoomAndPan(boolean enableZoomAndPan) |
void |
setForegroundColor(java.awt.Color foregroundColor) |
void |
setFormat(java.text.NumberFormat format) |
void |
setGradient(boolean gradient)
Sets whether the graphics uses a gradient paint to fill.
|
void |
setGradientColor(java.awt.Color gradientColor)
Sets the gradient color.
|
void |
setLegendFont(java.awt.Font legendFont)
Sets the font for the legend.
|
void |
setLegendPosition(int legendPosition)
Sets the position of the legend.
|
void |
setLegendSize(int legendSize)
Deprecated.
As of TWaver version 3.6
replaced by
this.setLegendFont(this.legendFont.deriveFont(legendSize)) |
void |
setLegendVisible(boolean legendVisible)
Sets whether the legend is visible.
|
void |
setLowerLimit(double lowerLimit)
Sets a new lower limit of the chart panel,
the lowerLimit is the minimal scale of the y-axis.
|
void |
setSelectedOffset(int selectedOffset)
Sets a new offset which will be used to show selected chart item.
|
void |
setShadowOffset(int shadowOffset)
Sets a new offset for the shadow,
the shadow is painted along x-axis and y-axis.
|
void |
setSortComparator(java.util.Comparator sortComparator) |
void |
setStroke(java.lang.String stroke)
Set a new stroke for the chartPane.
|
void |
setSVGXMLNS(java.lang.String svgXMLNS)
Sets the svg xml namespace by the string
|
void |
setTextGap(int textGap)
Sets a new gap for the text which is shown in the chartPane,
such as scale along y-axis,the text of the item value in the graphics panel.
|
void |
setType(java.lang.String type) |
void |
setUnit(java.lang.String unit) |
void |
setUpperLimit(double upperLimit)
Sets a new upper limit for this chart,
the UpperLimit is the maximal scale value for the y-axis.
|
void |
setValueTextCenter(boolean valueTextCenter) |
void |
setValueTextColor(java.awt.Color valueTextColor) |
void |
setValueTextFont(java.awt.Font valueTextFont)
Sets a new font for the value text.
|
void |
setValueTextPosition(int valueTextPosition)
Sets the position of the value text.
|
void |
setValueTextVisible(boolean valueTextVisible)
Sets whether the value text is visible.
|
void |
setXGap(int gap)
Sets the margin space of the chart panel on x coordinate.
|
void |
setYGap(int gap)
Sets the margin space of the chart panel on y coordinate.
|
java.lang.String |
toSVG(SVGContext context,
int width,
int height)
export svg
|
abstract java.lang.StringBuffer |
toSVGContent(SVGContext context,
int width,
int height) |
void |
updateTViewUI()
Uses the method to update TView's UI.
|
protected java.lang.String svgXMLNS
protected boolean enableZoomAndPan
protected TDataBox box
protected java.util.List proportionsOfSum
protected java.util.List proportionsOfRange
protected java.util.List publishedElements
protected java.util.List visibleFilters
protected java.util.Comparator sortComparator
protected boolean valueTextVisible
protected int xGap
protected int yGap
protected int textGap
protected java.lang.String stroke
protected java.awt.Color backgroundColor
protected java.awt.Color foregroundColor
protected java.awt.Rectangle backgroundBounds
protected float backgroundFillOpacity
protected java.lang.String unit
protected java.text.NumberFormat format
protected boolean gradient
protected int shadowOffset
protected boolean valueTextCenter
protected java.awt.Color valueTextColor
protected java.awt.Font valueTextFont
protected double upperLimit
protected double lowerLimit
protected int selectedOffset
protected java.lang.String selectedStroke
protected java.awt.Color selectedColor
protected int valueTextPosition
protected boolean backgroundVisible
protected java.awt.Color backgroundFillColor
protected java.awt.Color backgroundOutlineColor
protected java.lang.String backgroundStroke
protected boolean backgroundGradient
protected java.awt.Color backgroundGradientColor
protected int backgroundGradientFactory
protected java.awt.Color gradientColor
protected boolean legendVisible
protected int legendPosition
protected java.awt.Font legendFont
protected int legendSize
protected double sum
protected double max
protected double min
protected double range
protected java.util.Map proportions
public AbstractSVGChart()
public AbstractSVGChart(TDataBox box)
public AbstractSVGChart(TDataBox box, java.lang.String title, java.awt.Color backgroundColor)
public AbstractSVGChart(TDataBox box, java.lang.String title, java.awt.Color backgroundColor, java.awt.Color foregroundColor)
public void setDataBox(TDataBox box)
TView
setDataBox
in interface TView
box
- TDataBox the databox of this viewTView.getDataBox()
public void publishData()
public boolean isVisible(Element element)
Element
object is visible on this chart.element
- a specified Element
object to be checked.protected java.lang.String getGradientID(SVGContext context, int type, java.awt.Color gradientColor, java.awt.Color fillColor)
context
- type
- gradientColor
- fillColor
- public TDataBox getDataBox()
TView
getDataBox
in interface TView
TView.setDataBox(twaver.TDataBox)
public java.awt.Color getColor(Element element)
Element
object.element
- a specified Element
objectprotected java.awt.Color getGradientColor(Element element)
protected java.lang.String getFormatedText(Element element, double value)
Element
object.element
- a specified Element
objectvalue
- the value which is need to be formatedprotected java.lang.String getFormatedText(Element element, double value, int index)
Element
object.element
- a specified Element
objectvalue
- the value which is need to be formatedpublic java.text.NumberFormat getFormat()
public java.text.NumberFormat getFormat(Element element)
Element
object.element
- a specified Element
objectpublic java.awt.Color getBackgroundColor()
public void setBackgroundColor(java.awt.Color backgroundColor)
public java.awt.Color getForegroundColor()
public void setForegroundColor(java.awt.Color foregroundColor)
public java.lang.String getSVGXMLNS()
public void setSVGXMLNS(java.lang.String svgXMLNS)
svgXMLNS
- public boolean isEnableZoomAndPan()
public void setEnableZoomAndPan(boolean enableZoomAndPan)
public java.util.List getValues(Element element)
Element
object.element
- a specified Element
objectprotected java.lang.StringBuffer insertSVGHeadBefore(SVGContext context, java.lang.StringBuffer result, int width, int height)
protected void appendSVGPreDefine(SVGContext context, java.lang.StringBuffer result)
protected void appendSVGBackground(SVGContext context, java.lang.StringBuffer result)
protected void paintBackground(SVGContext context, java.lang.StringBuffer result)
protected void paintLegend(SVGContext context, java.lang.StringBuffer result, int width, int height)
public double getLowerLimit()
public void setLowerLimit(double lowerLimit)
lowerLimit
- a new minimal scale of the y-axispublic double getUpperLimit()
public void setUpperLimit(double upperLimit)
upperLimit
- a new upper limit valuepublic int getXGap()
public void setXGap(int gap)
gap
- the margin space of the chart panel on x coordinate.public int getYGap()
public void setYGap(int gap)
gap
- the margin space of the chart panel on y coordinate.public boolean isValueTextVisible()
public void setValueTextVisible(boolean valueTextVisible)
valueTextVisible
- if true the value text is visible, false otherwisepublic java.awt.Font getValueTextFont()
public void setValueTextFont(java.awt.Font valueTextFont)
valueTextFont
- a new Font
object for the value textpublic int getTextGap()
public void setTextGap(int textGap)
textGap
- a new gap for the text which is shown in the chartPanepublic java.awt.Stroke getStroke(Element element)
Element
object.element
- a specified Element
object.public java.lang.String getStroke()
public void setStroke(java.lang.String stroke)
stroke
- a new stroke for the chartPanepublic double getValue(Element element)
Element
object.element
- a specified Element
objectpublic int getShadowOffset()
public void setShadowOffset(int shadowOffset)
shadowOffset
- a new offset for the shadowpublic boolean isGradient()
public void setGradient(boolean gradient)
gradient
- if true graphics will set a gradient paint to fill,false otherwise.public double getMax(Element element)
Element
object.element
- a specified Element
objectpublic double getMin(Element element)
Element
object.element
- a specified Element
objectpublic java.lang.String getLegendLabel(Element element)
Element
object,
which is shown in the legendPane.element
- a specified Element
objectpublic int getSelectedOffset()
public void setSelectedOffset(int selectedOffset)
selectedOffset
- a new offset which will be used to show selected chart item.protected void appendElementAttributesSVG(java.lang.StringBuffer result, Element element)
context
- protected void appendElementSelectionAttribute(java.lang.StringBuffer result)
public java.lang.String toSVG(SVGContext context, int width, int height)
public abstract java.lang.StringBuffer toSVGContent(SVGContext context, int width, int height)
protected abstract void calculate()
public float getBackgroundFillOpacity()
public void setBackgroundFillOpacity(float backgroundFillOpacity)
public java.util.Comparator getSortComparator()
public void setSortComparator(java.util.Comparator sortComparator)
public void addVisibleFilter(VisibleFilter visibleFilter)
public void removeVisibleFilter(VisibleFilter visibleFilter)
public java.lang.String getUnit()
public void setUnit(java.lang.String unit)
public boolean isValueTextCenter()
public void setValueTextCenter(boolean valueTextCenter)
public java.awt.Color getValueTextColor()
public void setValueTextColor(java.awt.Color valueTextColor)
public void setFormat(java.text.NumberFormat format)
public java.awt.Stroke getSelectedStroke(Element element)
Element
object when the element is selected.element
- a specified Element
objectpublic java.awt.Color getSelectedColor(Element element)
Element
object when it is selected.element
- a specified Element
objectpublic int getValueTextPosition()
setValueTextPosition(int)
public void setValueTextPosition(int valueTextPosition)
valueTextPosition
- the position of the value text.getValueTextPosition()
public boolean isBackgroundVisible()
public void setBackgroundVisible(boolean backgroundVisible)
public java.awt.Color getBackgroundFillColor()
public void setBackgroundFillColor(java.awt.Color backgroundFillColor)
public java.awt.Color getBackgroundOutlineColor()
public void setBackgroundOutlineColor(java.awt.Color backgroundOutlineColor)
public java.lang.String getBackgroundStroke()
public void setBackgroundStroke(java.lang.String backgroundStroke)
public boolean isBackgroundGradient()
public void setBackgroundGradient(boolean backgroundGradient)
public java.awt.Color getBackgroundGradientColor()
public void setBackgroundGradientColor(java.awt.Color backgroundGradientColor)
public int getBackgroundGradientFactory()
public void setBackgroundGradientFactory(int backgroundGradientFactory)
public java.awt.Rectangle getBackgroundBounds()
public java.awt.Color getGradientColor()
setGradientColor(Color)
public void setGradientColor(java.awt.Color gradientColor)
gradientColor
- the gradient color.getGradientColor()
public boolean isLegendVisible()
setLegendVisible(boolean)
public void setLegendVisible(boolean legendVisible)
legendVisible
- if true, the legend will be visible, false otherwise.isLegendVisible()
public int getLegendPosition()
setLegendPosition(int)
public void setLegendPosition(int legendPosition)
legendPosition
- the new position of the legendgetLegendPosition()
public int getLegendSize()
this.legendFont.getSize()
setLegendSize(int)
public void setLegendSize(int legendSize)
this.setLegendFont(this.legendFont.deriveFont(legendSize))
legendSize
- the new size of the legend.getLegendSize()
public java.awt.Font getLegendFont()
setLegendFont(Font)
public void setLegendFont(java.awt.Font legendFont)
legendFont
- the new font of the legend.getLegendFont()
public void updateTViewUI()
TView
updateTViewUI
in interface TView
public void setType(java.lang.String type)
Copyright © 2002 - 2010 Serva Software. All Rights Reserved.