public class PercentChart extends AbstractChart
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
static javax.swing.JLabel |
renderer |
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 |
---|
PercentChart()
Creates a new
PercentChart object. |
PercentChart(java.util.List items)
Creates a new
PercentChart object initialized with an
explicit list |
PercentChart(java.util.List items,
java.lang.String title)
Creates a new
PercentChart object initialized with an
explicit list and a title. |
PercentChart(java.util.List items,
java.lang.String title,
java.awt.Color backgroundColor)
Creates a new
PercentChart with a List ,a
title and a background color |
PercentChart(java.util.List items,
java.lang.String title,
java.awt.Color backgroundColor,
java.awt.Color foregroundColor)
Creates a new
PercentChart object initialized with an
explicit list, a title, a background color and a foreground color. |
PercentChart(TDataBox box)
Creates a new
PercentChart object initialized with an
explicit data box. |
PercentChart(TDataBox box,
java.lang.String title,
java.awt.Color backgroundColor)
Creates a new
PercentChart object initialized with an
explicit data box, a title and a background color. |
PercentChart(TDataBox box,
java.lang.String title,
java.awt.Color backgroundColor,
java.awt.Color foregroundColor)
Creates a new
PercentChart 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.
|
void |
exportSVG(java.lang.String fileName,
int width,
int height) |
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.
|
protected double |
getSpanSize(double allSize)
Gets the size of the every span.
|
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(java.awt.Graphics2D g,
int width,
int height)
Paints the chart graphics.
|
protected void |
paintMarkerScale(java.awt.Graphics2D g,
Marker marker,
java.awt.geom.Point2D.Double startPoint,
java.awt.geom.Point2D.Double endPoint) |
protected void |
setChartSVGAttribute(AbstractSVGChart abschart) |
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.
|
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, getLegendElements, 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 PercentChart()
PercentChart
object.public PercentChart(TDataBox box)
PercentChart
object initialized with an
explicit data box.box
- an explicit data boxpublic PercentChart(TDataBox box, java.lang.String title, java.awt.Color backgroundColor)
PercentChart
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 PercentChart(TDataBox box, java.lang.String title, java.awt.Color backgroundColor, java.awt.Color foregroundColor)
PercentChart
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 PercentChart(java.util.List items)
PercentChart
object initialized with an
explicit listitems
- an explicit listpublic PercentChart(java.util.List items, java.lang.String title)
PercentChart
object initialized with an
explicit list and a title.items
- an explicit listtitle
- a title textpublic PercentChart(java.util.List items, java.lang.String title, java.awt.Color backgroundColor)
PercentChart
with a List
,a
title and a background coloritems
- an explicit listtitle
- the tile of the chart panelbackgroundColor
- the background color of the chart panelpublic PercentChart(java.util.List items, java.lang.String title, java.awt.Color backgroundColor, java.awt.Color foregroundColor)
PercentChart
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 void init()
protected void calculate()
AbstractChart
calculate
in class AbstractChart
public void paintChart(java.awt.Graphics2D g, 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 double getSpanSize(double allSize)
protected java.awt.Color getSpareGradientColor(Element element)
protected double getMarkerSize(Marker marker, int w, int h)
protected int getMarkerPosition(Element element)
protected void paintMarkerScale(java.awt.Graphics2D g, 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()
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.