public class SVGPercentChart extends AbstractSVGChart
Modifier and Type | Field and Description |
---|---|
static javax.swing.JLabel |
renderer |
backgroundBounds, backgroundColor, backgroundFillColor, backgroundFillOpacity, backgroundGradient, backgroundGradientColor, backgroundGradientFactory, backgroundOutlineColor, backgroundStroke, backgroundVisible, box, enableZoomAndPan, foregroundColor, format, gradient, gradientColor, legendFont, legendPosition, legendSize, legendVisible, lowerLimit, max, min, proportions, proportionsOfRange, proportionsOfSum, publishedElements, range, selectedColor, selectedOffset, selectedStroke, shadowOffset, sortComparator, stroke, sum, svgXMLNS, textGap, unit, upperLimit, valueTextCenter, valueTextColor, valueTextFont, valueTextPosition, valueTextVisible, visibleFilters, xGap, yGap
Constructor and Description |
---|
SVGPercentChart()
Creates a new
SVGPercentChart object. |
SVGPercentChart(TDataBox box)
Creates a new
SVGPercentChart object initialized with an
explicit data box. |
SVGPercentChart(TDataBox box,
java.lang.String title,
java.awt.Color backgroundColor)
Creates a new
SVGPercentChart object initialized with an
explicit data box, a title and a background color. |
SVGPercentChart(TDataBox box,
java.lang.String title,
java.awt.Color backgroundColor,
java.awt.Color foregroundColor)
Creates a new
SVGPercentChart object initialized with an
explicit data box,a title , a background color and a foreground color. |
Modifier and Type | Method and Description |
---|---|
protected void |
calculate() |
int |
getMarkerPosition()
Gets the marker position.
|
protected int |
getMarkerPosition(Element element) |
protected double |
getMarkerSize(Marker marker,
int w,
int h)
Gets the size of the marker.
|
int |
getMarkerStartPosition()
Gets the start position of the marker.
|
java.awt.Color |
getOutlineColor()
Gets the color of the outline.
|
java.awt.Color |
getPercentColor(Element element)
Gets the color of an explicit element.
|
int |
getPercentGap()
Gets the gap of the percent chart.
|
java.lang.String |
getPercentLabel(Element element)
Gets the label text of an explicit element.
|
java.awt.Color |
getPercentLabelColor()
Gets the label color of the percent chart.
|
java.awt.Font |
getPercentLabelFont()
Gets the label font of the percent chart.
|
int |
getPercentType()
Gets the type of the percent chart.
|
int |
getSegmentCount()
Gets the count of the segment.
|
double |
getSegmentSectionProrate()
Gets the prorate of the section in segment.
|
java.awt.Color |
getSpareColor()
Gets the color of the spare space.
|
java.awt.Color |
getSpareColor(Element element)
Gets the spare color of the element, if the element does not has this
attribute, it will return spareColor.
|
java.awt.Color |
getSpareCoverColor(Element element)
Gets the spare cover color of the element.
|
boolean |
getSpareFill(Element element)
Gets whether the spare is filled.
|
java.awt.Color |
getSpareGradientColor()
Gets the gradient color of the spare.
|
protected java.awt.Color |
getSpareGradientColor(Element element)
Gets the gradient color of the spare.
|
int |
getThickness()
Gets the thickness of the percent chart.
|
protected void |
init()
initializes the percent chart.
|
boolean |
isPercentLabelCenter()
Determines whether percent label is displayed at center.
|
boolean |
isPercentLabelVisible()
Gets whether the label of the percent is visible.
|
boolean |
isShowLabel()
Determines whether the label is shown.
|
boolean |
isSpareFill()
Gets whether the spare of the chart is filled.
|
void |
paintChart(SVGContext context,
java.lang.StringBuffer result,
int width,
int height)
Paints the chart graphics.
|
protected void |
paintMarkerScale(SVGContext context,
java.lang.StringBuffer result,
Marker marker,
java.awt.geom.Point2D.Double startPoint,
java.awt.geom.Point2D.Double endPoint) |
void |
setMarkerPosition(int markerPosition)
Sets the marker position.
|
void |
setMarkerStartPosition(int markStartPosition)
Sets the start position of the marker.
|
void |
setOutlineColor(java.awt.Color outlineColor)
Sets a new color for the outline.
|
void |
setPercentGap(int percentGap)
Sets a new gap for the percent chart.
|
void |
setPercentLabelCenter(boolean percentLabelCenter)
Sets whether percent label is displayed at center.
|
void |
setPercentLabelColor(java.awt.Color percentLabelColor)
Sets the label color of the percent chart.
|
void |
setPercentLabelFont(java.awt.Font percentLabelFont)
Sets the label font for the percent chart.
|
void |
setPercentLabelVisible(boolean percentLabelVisible)
Sets whether the label of the percent should be visible.
|
void |
setPercentType(int percentType)
Sets the type for the percent chart.
|
void |
setSegmentCount(int segmentCount)
Sets a new count for the segment.
|
void |
setSegmentSectionProrate(double segmentSectionProrate)
Sets the prorate of the section in segment.
segmentSectionProrate must be a floating point number in the inclusive range [0.0, 1.0]. |
void |
setShowLabel(boolean showLabel)
Sets whether the label should be shown.
|
void |
setSpareColor(java.awt.Color spareColor)
Sets a new color for the spare space.
|
void |
setSpareFill(boolean spareFill)
Sets whether the spare of the chart is filled.
|
void |
setSpareGradientColor(java.awt.Color spareGradientColor)
Sets the gradient color for the spare.
|
void |
setThickness(int thickness)
Sets a new thickness for the percent chart.
|
java.lang.StringBuffer |
toSVGContent(SVGContext context,
int width,
int height) |
addVisibleFilter, appendElementAttributesSVG, appendElementSelectionAttribute, appendSVGBackground, appendSVGPreDefine, getBackgroundBounds, getBackgroundColor, getBackgroundFillColor, getBackgroundFillOpacity, getBackgroundGradientColor, getBackgroundGradientFactory, getBackgroundOutlineColor, getBackgroundStroke, getColor, getDataBox, getForegroundColor, getFormat, getFormat, getFormatedText, getFormatedText, getGradientColor, getGradientColor, getGradientID, getLegendFont, getLegendLabel, getLegendPosition, getLegendSize, getLowerLimit, getMax, getMin, getSelectedColor, getSelectedOffset, getSelectedStroke, getShadowOffset, getSortComparator, getStroke, getStroke, getSVGXMLNS, getTextGap, getType, getUnit, getUpperLimit, getValue, getValues, getValueTextColor, getValueTextFont, getValueTextPosition, getXGap, getYGap, insertSVGHeadBefore, isBackgroundGradient, isBackgroundVisible, isEnableZoomAndPan, isGradient, isLegendVisible, isValueTextCenter, isValueTextVisible, isVisible, paintBackground, paintLegend, publishData, removeVisibleFilter, setBackgroundColor, setBackgroundFillColor, setBackgroundFillOpacity, setBackgroundGradient, setBackgroundGradientColor, setBackgroundGradientFactory, setBackgroundOutlineColor, setBackgroundStroke, setBackgroundVisible, setDataBox, setEnableZoomAndPan, setForegroundColor, setFormat, setGradient, setGradientColor, setLegendFont, setLegendPosition, setLegendSize, setLegendVisible, setLowerLimit, setSelectedOffset, setShadowOffset, setSortComparator, setStroke, setSVGXMLNS, setTextGap, setType, setUnit, setUpperLimit, setValueTextCenter, setValueTextColor, setValueTextFont, setValueTextPosition, setValueTextVisible, setXGap, setYGap, toSVG, updateTViewUI
public SVGPercentChart()
SVGPercentChart
object.public SVGPercentChart(TDataBox box)
SVGPercentChart
object initialized with an
explicit data box.box
- an explicit data boxpublic SVGPercentChart(TDataBox box, java.lang.String title, java.awt.Color backgroundColor)
SVGPercentChart
object initialized with an
explicit data box, a title and a background color.box
- an explicit data box object.title
- a String
titlebackgroundColor
- a background Color
objectpublic SVGPercentChart(TDataBox box, java.lang.String title, java.awt.Color backgroundColor, java.awt.Color foregroundColor)
SVGPercentChart
object initialized with an
explicit data box,a title , a background color and a foreground color.box
- an explicit data box object.title
- a String
titlebackgroundColor
- a background Color
objectforegroundColor
- a foreground Color
objectprotected void init()
protected void calculate()
calculate
in class AbstractSVGChart
public void paintChart(SVGContext context, java.lang.StringBuffer result, int width, int height)
g
- the Graphics
context in which to paintwidth
- the width of the chart panelheight
- the height of the chart panelprotected java.awt.Color getSpareGradientColor(Element element)
protected double getMarkerSize(Marker marker, int w, int h)
protected int getMarkerPosition(Element element)
protected void paintMarkerScale(SVGContext context, java.lang.StringBuffer result, Marker marker, java.awt.geom.Point2D.Double startPoint, java.awt.geom.Point2D.Double endPoint)
public java.awt.Color getSpareColor(Element element)
element
- getSpareCoverColor(Element)
public java.awt.Color getSpareCoverColor(Element element)
element
- getSpareColor()
public boolean getSpareFill(Element element)
element
- public java.awt.Color getPercentColor(Element element)
element
- an explicit Element
object.public java.lang.String getPercentLabel(Element element)
element
- an explicit elementpublic int getThickness()
public void setThickness(int thickness)
thickness
- a new thickness for the percent chartpublic boolean isShowLabel()
setShowLabel(boolean)
public void setShowLabel(boolean showLabel)
showLabel
- if true the label should be shown ,false otherwise.isShowLabel()
public java.awt.Color getSpareColor()
setSpareColor(Color)
public void setSpareColor(java.awt.Color spareColor)
spareColor
- a new Color
object for the spare spacegetSpareColor()
public java.awt.Color getOutlineColor()
setOutlineColor(Color)
public void setOutlineColor(java.awt.Color outlineColor)
outlineColor
- a new Color
object for the outlinegetOutlineColor()
public int getSegmentCount()
setSegmentCount(int)
public void setSegmentCount(int segmentCount)
segmentCount
- a new count for the segment.getSegmentCount()
public int getPercentGap()
setPercentGap(int)
public void setPercentGap(int percentGap)
percentGap
- a new gap for the percent chartgetPercentGap()
public boolean isPercentLabelCenter()
setPercentLabelCenter(boolean)
public void setPercentLabelCenter(boolean percentLabelCenter)
percentLabelCenter
- True to display at center, false at left.isPercentLabelCenter()
public java.awt.Color getPercentLabelColor()
setPercentLabelColor(Color)
public void setPercentLabelColor(java.awt.Color percentLabelColor)
percentLabelColor
- the label color of the percent chart.getPercentLabelColor()
public java.awt.Font getPercentLabelFont()
setPercentLabelFont(Font)
public void setPercentLabelFont(java.awt.Font percentLabelFont)
percentLabelFont
- the label font for the percent chart.getPercentLabelFont()
public boolean isPercentLabelVisible()
setPercentLabelVisible(boolean)
public void setPercentLabelVisible(boolean percentLabelVisible)
percentLabelVisible
- if true the label of the percent should be visible, false otherwise.isPercentLabelVisible()
public int getPercentType()
setPercentType(int)
public void setPercentType(int percentType)
TWaverConst.PERCENT_TYPE_HORIZONTAL
TWaverConst.PERCENT_TYPE_VERTICAL
percentType
- the type for the percent chart.getPercentType()
public int getMarkerStartPosition()
setMarkerStartPosition(int)
public void setMarkerStartPosition(int markStartPosition)
TWaverConst.PERCENT_MARKER_START_WITH_EDGE
TWaverConst.PERCENT_MARKER_START_WITH_BOTTOM
markStartPosition
- the start position of the marker.getMarkerStartPosition()
public double getSegmentSectionProrate()
setSegmentSectionProrate(double)
public void setSegmentSectionProrate(double segmentSectionProrate)
segmentSectionProrate
must be a floating point number in the inclusive range [0.0, 1.0].segmentSectionProrate
- the prorate of the section in segment.getSegmentSectionProrate()
public int getMarkerPosition()
setMarkerPosition(int)
public void setMarkerPosition(int markerPosition)
TWaverConst.PERCENT_MARKER_POSITION_DEFAULT
TWaverConst.PERCENT_MARKER_POSITION_INNER_DEFAULT
TWaverConst.PERCENT_MARKER_POSITION_TOP
TWaverConst.PERCENT_MARKER_POSITION_INNER_TOP
TWaverConst.PERCENT_MARKER_POSITION_BOTTOM
TWaverConst.PERCENT_MARKER_POSITION_INNER_BOTTOM
TWaverConst.PERCENT_MARKER_POSITION_LEFT
TWaverConst.PERCENT_MARKER_POSITION_INNER_LEFT
TWaverConst.PERCENT_MARKER_POSITION_RIGHT
TWaverConst.PERCENT_MARKER_POSITION_INNER_RIGHT
markerPosition
- the marker position.getMarkerPosition()
public java.awt.Color getSpareGradientColor()
setSpareGradientColor(Color)
public void setSpareGradientColor(java.awt.Color spareGradientColor)
spareGradientColor
- the gradient color for the spare.getSpareGradientColor()
public boolean isSpareFill()
setSpareFill(boolean)
public void setSpareFill(boolean spareFill)
spareFill
- if true the spare of the chart will be filled, false otherwise.isSpareFill()
public java.lang.StringBuffer toSVGContent(SVGContext context, int width, int height)
toSVGContent
in class AbstractSVGChart
Copyright © 2002 - 2010 Serva Software. All Rights Reserved.