public class PieChart extends AbstractChart
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
antialias, backgroundBounds, backgroundFillColor, backgroundGradient, backgroundGradientColor, backgroundGradientFactory, backgroundOutlineColor, backgroundStroke, backgroundVisible, box, chartPane, fixedValueCount, format, gradient, gradientColor, highlightBackground, highlightForeground, iconHeight, iconWidth, legendFont, legendLayout, legendOrientation, legendPane, lowerLimit, max, min, proportions, proportionsOfRange, proportionsOfSum, publishedElements, range, selectedColor, selectedOffset, selectedStroke, shadowOffset, shapeStructs, sortComparator, stroke, sum, textGap, titleLabel, unit, upperLimit, valueTextCenter, valueTextColor, valueTextFont, valueTextPosition, valueTextVisible, visibleFilters, xGap, yGap
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
PieChart()
Creates a new
PieChart object |
PieChart(java.util.List items)
Creates a new
PieChart object initialized with an explicit
list |
PieChart(java.util.List items,
java.lang.String title)
Creates a new
PieChart object initialized with an explicit
list and a title. |
PieChart(java.util.List items,
java.lang.String title,
java.awt.Color backgroundColor)
Creates a new
PieChart object initialized with an explicit
list, a title and a background color. |
PieChart(java.util.List items,
java.lang.String title,
java.awt.Color backgroundColor,
java.awt.Color foregroundColor)
Creates a new
PieChart object initialized with an explicit
list, a title, a background color and a foreground color. |
PieChart(TDataBox box)
Creates a new
PieChart object initialized with an explicit
data box. |
PieChart(TDataBox box,
java.lang.String title,
java.awt.Color backgroundColor)
Creates a new
PieChart object initialized with an explicit
data box,a title and a background color. |
PieChart(TDataBox box,
java.lang.String title,
java.awt.Color backgroundColor,
java.awt.Color foregroundColor)
Creates a new
PieChart 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()
An abstract method that will be called when this chart is publishing data,
The subclass overrides this method to calculate some values.
|
protected void |
calculateLabelSize() |
protected void |
drawBody(java.awt.Graphics2D g2d,
int width,
int height,
double start,
Element element,
double value)
Paints the body of this chart.
|
void |
exportSVG(java.lang.String fileName,
int width,
int height) |
protected java.awt.geom.Rectangle2D.Double |
getDrawBound() |
double |
getHollowPercent()
Gets the percent of hollow.
|
protected int |
getLabelTextPosition(double angle)
Gets the position of the text of the label.
|
protected java.util.List |
getLegendElements() |
java.awt.Color |
getShadowColor()
Gets the shadow color of this chart
|
double |
getStartAngle()
Gets the start angle of this chart
|
double |
getValueTextPositionScale() |
boolean |
is3D() |
protected boolean |
isAppearable(Element element) |
boolean |
isHollow()
Determines whether this pie chart is hollow.
|
boolean |
isValueTextPercent()
Determines whether the value text percent of this chart is visible
|
void |
paintChart(java.awt.Graphics2D g2d,
int width,
int height)
Paints the chart graphics.
|
void |
set3D(boolean is3D) |
protected void |
setChartSVGAttribute(AbstractSVGChart abschart) |
void |
setHollow(boolean hollow)
Sets whether this pie chart is hollow.
|
void |
setHollowPercent(double hollowPercent)
Sets a new percent of hollow.
|
void |
setShadowColor(java.awt.Color shadowColor)
Sets a shadow color for this chart
|
void |
setStartAngle(double startAngle)
Sets a start angle for this chart
|
void |
setValueTextPercent(boolean valueTextPercent)
Sets whether the value text percent of this chart should be shown on view component.
|
void |
setValueTextPositionScale(double valueTextPositionScale) |
addElementClickedActionListener, addElementDoubleClickedActionListener, addItem, addSelectableFilter, addVisibleFilter, cleanDirtyState, clearItems, clearSelectableFilters, exportImage, exportImage, exportSVG, exportToImageIcon, fireElementClicked, fireElementDoubleClicked, getBackgroundBounds, getBackgroundFillColor, getBackgroundGradientColor, getBackgroundGradientFactory, getBackgroundOutlineColor, getBackgroundStroke, getChartPane, getColor, getDataBox, getElementAt, getElementClickedActionListeners, getElementDoubleClickedActionListeners, getFormat, getFormat, getFormatedText, getFormatedText, getGradientColor, getGradientColor, getHighlightBackground, getHighlightForeground, getIconHeight, getIconWidth, getItemByIndex, getItemCount, getItems, getLegendFont, getLegendLabel, getLegendLayout, getLegendOrientation, getLegendPane, getLowerLimit, getMax, getMaxZoom, getMin, getMinZoom, getPopupMenuGenerator, getPublishedElements, getSelectableFilters, getSelectedColor, getSelectedColor, getSelectedOffset, getSelectedStroke, getSelectedStroke, getShadowOffset, getShapeStructAt, getSortComparator, getStroke, getStroke, getTextGap, getTitle, getTitleLabel, getToolTipText, getUnit, getUpperLimit, getValue, getValues, getValueTextColor, getValueTextFont, getValueTextPosition, getVisibleFilters, getXGap, getXTranslate, getXZoom, getYGap, getYTranslate, getYZoom, getZoomIncrement, isAntialias, isBackgroundGradient, isBackgroundVisible, isClearSelectionOnMarginClicked, isEnableDoubleClickToReset, isEnableToolTipText, isEnableXTranslate, isEnableXZoom, isEnableYTranslate, isEnableYZoom, isGradient, isIteratorByHiberarchy, isLazyPublishMode, isLocked, isSelectable, isSelectableOnRightClick, isValueTextCenter, isValueTextVisible, isVisible, lock, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, paint, paintBackground, paintComponent, publishData, publishData, removeElementClickedActionListener, removeElementDoubleClickedActionListener, removeItem, removeSelectableFilter, removeVisibleFilter, reset, setAntialias, setBackgroundFillColor, setBackgroundGradient, setBackgroundGradientColor, setBackgroundGradientFactory, setBackgroundOutlineColor, setBackgroundStroke, setBackgroundVisible, setClearSelectionOnMarginClicked, setDataBox, setEnableDoubleClickToReset, setEnableToolTipText, setEnableXTranslate, setEnableXZoom, setEnableYTranslate, setEnableYZoom, setForeground, setFormat, setGradient, setGradientColor, setHighlightBackground, setHighlightForeground, setIconHeight, setIconWidth, setItems, setIteratorByHiberarchy, setLazyPublishMode, setLegendFont, setLegendLayout, setLegendOrientation, setLowerLimit, setMaxZoom, setMinZoom, setPopupMenuGenerator, setSelectableOnRightClick, setSelectedColor, setSelectedOffset, setSelectedStroke, setShadowOffset, setSortComparator, setStroke, setTextGap, setTitle, setTranslate, setUnit, setUpperLimit, setValueTextCenter, setValueTextColor, setValueTextFont, setValueTextPosition, setValueTextVisible, setXGap, setXTranslate, setXZoom, setYGap, setYTranslate, setYZoom, setZoomIncrement, unlock, updateTViewUI, zoomIn, zoomOut
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public PieChart()
PieChart
objectpublic PieChart(TDataBox box)
PieChart
object initialized with an explicit
data box.box
- an explicit data box object.public PieChart(TDataBox box, java.lang.String title, java.awt.Color backgroundColor)
PieChart
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 PieChart(TDataBox box, java.lang.String title, java.awt.Color backgroundColor, java.awt.Color foregroundColor)
PieChart
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
objectpublic PieChart(java.util.List items)
PieChart
object initialized with an explicit
listitems
- an explicit listpublic PieChart(java.util.List items, java.lang.String title)
PieChart
object initialized with an explicit
list and a title.items
- an explicit listtitle
- a title textpublic PieChart(java.util.List items, java.lang.String title, java.awt.Color backgroundColor)
PieChart
object initialized with an explicit
list, a title and a background color.items
- an explicit listtitle
- a String
textbackgroundColor
- a background Color
public PieChart(java.util.List items, java.lang.String title, java.awt.Color backgroundColor, java.awt.Color foregroundColor)
PieChart
object initialized with an explicit
list, a title, a background color and a foreground color.items
- an explicit listtitle
- a String
textbackgroundColor
- a background Color
foreroundColor
- a foreground Color
protected boolean isAppearable(Element element)
protected java.awt.geom.Rectangle2D.Double getDrawBound()
protected java.util.List getLegendElements()
getLegendElements
in class AbstractChart
protected void calculate()
AbstractChart
calculate
in class AbstractChart
public void paintChart(java.awt.Graphics2D g2d, int width, int height)
paintChart
in class AbstractChart
g
- the Graphics
context in which to paintwidth
- the width of the chart panelheight
- the height of the chart panelprotected void calculateLabelSize()
protected int getLabelTextPosition(double angle)
protected void drawBody(java.awt.Graphics2D g2d, int width, int height, double start, Element element, double value)
g2d
- the Graphics2D
context in which to paintwidth
- the overall width of the full ellipse of which this
arc is a partial section.height
- the overall height of the full ellipse of which this
arc is a partial section.start
- The starting angle of the arc in degreeselement
- The element that is paintedvalue
- The angular extent of the arc in degreespublic double getStartAngle()
public void setStartAngle(double startAngle)
startAngle
- new start anglepublic boolean isValueTextPercent()
public void setValueTextPercent(boolean valueTextPercent)
valueTextPercent
- if true, shows value text percent, false otherwise.public java.awt.Color getShadowColor()
public void setShadowColor(java.awt.Color shadowColor)
shadowColor
- new shadow colorpublic boolean isHollow()
public void setHollow(boolean hollow)
hollow
- True if this pie chart is hollow, false otherwise.public double getHollowPercent()
public void setHollowPercent(double hollowPercent)
hollowPercent
- a new percent of hollow.public boolean is3D()
public void set3D(boolean is3D)
public double getValueTextPositionScale()
public void setValueTextPositionScale(double valueTextPositionScale)
protected void setChartSVGAttribute(AbstractSVGChart abschart)
setChartSVGAttribute
in class AbstractChart
public void exportSVG(java.lang.String fileName, int width, int height)
exportSVG
in class AbstractChart
Copyright © 2002 - 2010 Serva Software. All Rights Reserved.