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 Rectangle2D |
border |
private PieChartPNode.ClassNameLabeler |
classNameLabeler |
private String[] |
classNames |
private PieChartPNode.CountLabeler |
countLabeler |
private Font |
defaultLabelFont |
private double |
height |
private int |
itemCount |
private PieChartPNode.PercentageLabeler |
percentageLabeler |
private org.jfree.chart.plot.PiePlot |
plot |
private static long |
serialVersionUID |
private 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
NO_SUCH_PAGE, PAGE_EXISTS
Constructor and Description |
---|
PieChartPNode(double x,
double y,
double w,
double h,
int[] values,
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(Graphics2D g2d,
int[] values,
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. |
Color |
getLegendColor(int index)
Returns the colour used in the diagram at the specified index.
|
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,
Color color) |
void |
setColors(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 String[] classNames
private int itemCount
private org.jfree.chart.plot.PiePlot plot
private 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 Font defaultLabelFont
private final Font smallLabelFont
public PieChartPNode(double x, double y, double w, double h, int[] values, 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(Graphics2D g2d, int[] values, 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 Color[] getLegendColors()
Color
.public org.jfree.util.PaintList getPaintList()
public Color getLegendColor(int index)
public void setColor(int index, Color color)
public void setColors(Color[] colors)
public int[] getValues()
public void setShowLegend(PieChartPNode.PieChartLabelMode mode)