public class PieChartPNode
extends edu.umd.cs.piccolo.PNode
Modifier and Type | Class and Description |
---|---|
private class |
PieChartPNode.ClassNameLabeler |
private class |
PieChartPNode.CountLabeler |
private class |
PieChartPNode.PercentageLabeler |
static class |
PieChartPNode.PieChartLabelMode |
Modifier and Type | Field and Description |
---|---|
private java.awt.geom.Rectangle2D |
border |
private PieChartPNode.ClassNameLabeler |
classNameLabeler |
private java.lang.String[] |
classNames |
private PieChartPNode.CountLabeler |
countLabeler |
private java.awt.Font |
defaultLabelFont |
private double |
height |
private int |
itemCount |
private PieChartPNode.PercentageLabeler |
percentageLabeler |
private org.jfree.chart.plot.PiePlot |
plot |
private static long |
serialVersionUID |
private java.awt.Font |
smallLabelFont |
private int[] |
values |
private double |
width |
private double |
X |
private double |
Y |
PROPERTY_BOUNDS, PROPERTY_CHILDREN, PROPERTY_CHILDREN_PICKABLE, PROPERTY_CLIENT_PROPERTIES, PROPERTY_CODE_BOUNDS, PROPERTY_CODE_CHILDREN, PROPERTY_CODE_CHILDREN_PICKABLE, PROPERTY_CODE_CLIENT_PROPERTIES, PROPERTY_CODE_FULL_BOUNDS, PROPERTY_CODE_PAINT, PROPERTY_CODE_PARENT, PROPERTY_CODE_PICKABLE, PROPERTY_CODE_TRANSFORM, PROPERTY_CODE_TRANSPARENCY, PROPERTY_CODE_VISIBLE, PROPERTY_FULL_BOUNDS, PROPERTY_PAINT, PROPERTY_PARENT, PROPERTY_PICKABLE, PROPERTY_TRANSFORM, PROPERTY_TRANSPARENCY, PROPERTY_VISIBLE, SCENE_GRAPH_DELEGATE
Constructor and Description |
---|
PieChartPNode(double x,
double y,
double w,
double h,
int[] values,
java.lang.String[] classNames,
int itemCount)
Creates a PieChartPNode at the given coordinates with the given values.
|
Modifier and Type | Method and Description |
---|---|
static org.jfree.chart.plot.PiePlot |
createPiechartPlot(int[] values)
Creates a piechart from the given count values
|
static void |
drawPlot(java.awt.Graphics2D g2d,
int[] values,
java.awt.Color[] colors,
double x,
double y,
double width,
double height)
Draw pie-charts on the given
Graphics2D object, with the provided values and colours, and unit width. |
java.awt.Color |
getLegendColor(int index)
Returns the colour used in the diagram at the specified index.
|
java.awt.Color[] |
getLegendColors()
Returns the colors used in the diagram.
|
org.jfree.util.PaintList |
getPaintList() |
int[] |
getValues() |
protected void |
paint(edu.umd.cs.piccolo.util.PPaintContext paintContext) |
boolean |
setBounds(double x,
double y,
double width,
double height) |
void |
setColor(int index,
java.awt.Color color) |
void |
setColors(java.awt.Color[] colors) |
void |
setShowLegend(PieChartPNode.PieChartLabelMode mode) |
addActivity, addAttribute, addChild, addChild, addChildren, addClientProperty, addInputEventListener, addPropertyChangeListener, addPropertyChangeListener, animateToBounds, animateToColor, animateToPositionScaleRotation, animateToTransform, animateToTransparency, animateTransformToBounds, centerBoundsOnPoint, centerFullBoundsOnPoint, clone, computeFullBounds, endResizeBounds, findIntersectingNodes, fireChildPropertyChange, firePropertyChange, fullIntersects, fullPaint, fullPick, getAllNodes, getAllNodes, getAttribute, getAttribute, getBooleanAttribute, getBounds, getBoundsChanged, getBoundsReference, getBoundsVolatile, getChild, getChildBoundsInvalid, getChildBoundsVolatile, getChildPaintInvalid, getChildrenCount, getChildrenIterator, getChildrenPickable, getChildrenReference, getClientProperties, getClientProperty, getClientPropertyKeysEnumeration, getClientPropertyKeysIterator, getDoubleAttribute, getFullBounds, getFullBoundsInvalid, getFullBoundsReference, getGlobalBounds, getGlobalFullBounds, getGlobalRotation, getGlobalScale, getGlobalToLocalTransform, getGlobalTranslation, getHeight, getIntegerAttribute, getInverseTransform, getListenerList, getLocalToGlobalTransform, getOccluded, getOffset, getPaint, getPaintInvalid, getParent, getPickable, getPropertyChangeParentMask, getRoot, getRotation, getScale, getTransform, getTransformReference, getTransparency, getUnionOfChildrenBounds, getVisible, getWidth, getX, getXOffset, getY, getYOffset, globalToLocal, globalToLocal, globalToLocal, indexOfChild, internalUpdateBounds, intersects, invalidateFullBounds, invalidateLayout, invalidatePaint, isAncestorOf, isDescendentOf, isDescendentOfRoot, isOpaque, layoutChildren, lerp, localToGlobal, localToGlobal, localToGlobal, localToParent, localToParent, localToParent, moveInBackOf, moveInFrontOf, moveToBack, moveToFront, offset, paintAfterChildren, paramString, parentBoundsChanged, parentToLocal, parentToLocal, parentToLocal, pick, pickAfterChildren, position, print, print, removeAllChildren, removeChild, removeChild, removeChildren, removeFromParent, removeInputEventListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaintFrom, reparent, replaceWith, resetBounds, rotate, rotateAboutPoint, rotateAboutPoint, rotateInPlace, scale, scaleAboutPoint, scaleAboutPoint, setBounds, setBoundsChanged, setChildBoundsInvalid, setChildBoundsVolatile, setChildPaintInvalid, setChildrenPickable, setFullBoundsInvalid, setGlobalRotation, setGlobalScale, setGlobalTranslation, setHeight, setOccluded, setOffset, setOffset, setPaint, setPaintInvalid, setParent, setPickable, setPropertyChangeParentMask, setRotation, setScale, setTransform, setTransparency, setVisible, setWidth, setX, setY, signalBoundsChanged, startResizeBounds, toImage, toImage, toImage, toString, transformBy, translate, validateFullBounds, validateFullPaint
private static final long serialVersionUID
private int[] values
private java.lang.String[] classNames
private int itemCount
private org.jfree.chart.plot.PiePlot plot
private java.awt.geom.Rectangle2D border
private double X
private double Y
private double width
private double height
private final PieChartPNode.CountLabeler countLabeler
private final PieChartPNode.PercentageLabeler percentageLabeler
private final PieChartPNode.ClassNameLabeler classNameLabeler
private final java.awt.Font defaultLabelFont
private final java.awt.Font smallLabelFont
public PieChartPNode(double x, double y, double w, double h, int[] values, java.lang.String[] classNames, int itemCount)
x
- X coordinate of the chart.y
- Y coordinate of the chart.values
- Array of double
containing the values.public static org.jfree.chart.plot.PiePlot createPiechartPlot(int[] values)
public static void drawPlot(java.awt.Graphics2D g2d, int[] values, java.awt.Color[] colors, double x, double y, double width, double height)
Graphics2D
object, with the provided values and colours, and unit width.
Used when exporting pie charts as stand-alone image, or for superimposing them on an exported visualisation.public boolean setBounds(double x, double y, double width, double height)
setBounds
in class edu.umd.cs.piccolo.PNode
protected void paint(edu.umd.cs.piccolo.util.PPaintContext paintContext)
paint
in class edu.umd.cs.piccolo.PNode
public java.awt.Color[] getLegendColors()
Color
.public org.jfree.util.PaintList getPaintList()
public java.awt.Color getLegendColor(int index)
public void setColor(int index, java.awt.Color color)
public void setColors(java.awt.Color[] colors)
public int[] getValues()
public void setShowLegend(PieChartPNode.PieChartLabelMode mode)