?? pieplot.java
字號(hào):
/**
* Sets the outline paint for ALL sections in the plot. If this is set to
* </code>null</code>, then a list of outline paints is used instead (to allow
* different colors to be used for the outline of each section).
*
* @param paint the paint (<code>null</code> permitted).
*/
public void setSectionOutlinePaint(Paint paint) {
this.sectionOutlinePaint = paint;
notifyListeners(new PlotChangeEvent(this));
}
/**
* Returns the paint used to outline a section of the pie plot.
*
* @param section the section index (zero-based).
*
* @return The paint.
*/
public Paint getSectionOutlinePaint(int section) {
Paint result = null;
if (this.sectionOutlinePaint != null) {
result = this.sectionOutlinePaint;
}
else {
result = this.sectionOutlinePaintList.getPaint(section);
if (result == null && getSectionOutlinePaintListAutoFill()) {
DrawingSupplier supplier = getDrawingSupplier();
if (supplier != null) {
result = supplier.getNextOutlinePaint();
this.sectionOutlinePaintList.setPaint(section, result);
}
}
}
return result;
}
/**
* Sets the paint used to outline a section of the pie.
*
* @param section the section index (zero-based).
* @param paint the paint.
*/
public void setSectionOutlinePaint(int section, Paint paint) {
this.sectionOutlinePaintList.setPaint(section, paint);
notifyListeners(new PlotChangeEvent(this));
}
/**
* Returns a flag that controls whether or not <code>null</code> values are
* automatically replaced with a value from the {@link DrawingSupplier}.
*
* @return A boolean.
*/
public boolean getSectionOutlinePaintListAutoFill() {
return this.sectionOutlinePaintListAutoFill;
}
/**
* Sets a flag that controls whether or not <code>null</code> values are
* automatically replaced with a value from the {@link DrawingSupplier}.
*
* @param fill the flag.
*/
public void setSectionOutlinePaintListAutoFill(boolean fill) {
this.sectionOutlinePaintListAutoFill = fill;
}
/**
* Returns the paint used to outline a section of the pie plot.
*
* @param section the section index (zero-based).
*
* @return The paint.
*
* @deprecated Use getSectionOutlinePaint.
*/
public Paint getOutlinePaint(int section) {
return getSectionOutlinePaint(section);
}
/**
* Sets the paint used to outline a section of the pie.
*
* @param section the section index (zero-based).
* @param paint the paint.
*
* @deprecated Use setSectionOutlinePaint.
*/
public void setOutlinePaint(int section, Paint paint) {
setSectionOutlinePaint(section, paint);
}
/**
* Returns the default outline paint. This is used to outline pie sections when the paint
* table is inactive (the usual case).
*
* @return The paint.
*
* @deprecated Use getSectionOutlinePaint.
*/
public Paint getDefaultOutlinePaint() {
return getSectionOutlinePaint();
}
/**
* Sets the default outline paint.
*
* @param paint the paint.
*
* @deprecated Use setSectionOutlinePaint(paint).
*/
public void setDefaultOutlinePaint(Paint paint) {
setSectionOutlinePaint(paint);
}
/**
* Returns the stroke used to outline a section of the pie plot.
*
* @param section the section index (zero-based).
*
* @return The stroke.
*/
public Stroke getSectionOutlineStroke(int section) {
Stroke result = null;
if (this.sectionOutlinePaint != null) {
result = this.sectionOutlineStroke;
}
else {
result = this.sectionOutlineStrokeList.getStroke(section);
if (result == null && getSectionOutlineStrokeListAutoFill()) {
DrawingSupplier supplier = getDrawingSupplier();
if (supplier != null) {
result = supplier.getNextOutlineStroke();
this.sectionOutlineStrokeList.setStroke(section, result);
}
}
}
return result;
}
/**
* Sets the stroke used to outline a section of the pie.
*
* @param section the section index (zero-based).
* @param stroke the stroke.
*/
public void setSectionOutlineStroke(int section, Stroke stroke) {
this.sectionOutlineStrokeList.setStroke(section, stroke);
notifyListeners(new PlotChangeEvent(this));
}
/**
* Returns the stroke used to outline a section of the pie plot.
*
* @param section the section index (zero-based).
*
* @return The stroke.
*
* @deprecated Use getSectionOutlineStroke.
*/
public Stroke getOutlineStroke(int section) {
return getSectionOutlineStroke(section);
}
/**
* Sets the stroke used to outline a section of the pie.
*
* @param section the section index (zero-based).
* @param stroke the stroke.
*
* @deprecated Use setSectionOutlineStroke.
*/
public void setOutlineStroke(int section, Stroke stroke) {
setSectionOutlineStroke(section, stroke);
}
/**
* Returns the outline stroke for ALL sections in the plot.
*
* @return The stroke (possibly <code>null</code>).
*/
public Stroke getSectionOutlineStroke() {
return this.sectionOutlineStroke;
}
/**
* Sets the outline stroke for ALL sections in the plot.
*
* @param stroke the stroke (<code>null</code> permitted).
*/
public void setSectionOutlineStroke(Stroke stroke) {
this.sectionOutlineStroke = stroke;
notifyListeners(new PlotChangeEvent(this));
}
/**
* Returns the default outline stroke. This is used to outline pie sections when the outline
* stroke table is inactive.
*
* @return The stroke.
*
* @deprecated Use getSectionOutlineStroke.
*/
public Stroke getDefaultOutlineStroke() {
return getSectionOutlineStroke();
}
/**
* Sets the default outline stroke.
*
* @param stroke the stroke.
*
* @deprecated Use setSectionOutlineStroke.
*/
public void setDefaultOutlineStroke(Stroke stroke) {
setSectionOutlineStroke(stroke);
}
/**
* Returns a flag that controls whether or not <code>null</code> values are
* automatically replaced with a value from the {@link DrawingSupplier}.
*
* @return A boolean.
*/
public boolean getSectionOutlineStrokeListAutoFill() {
return this.sectionOutlineStrokeListAutoFill;
}
/**
* Sets a flag that controls whether or not <code>null</code> values are
* automatically replaced with a value from the {@link DrawingSupplier}.
*
* @param fill the flag.
*/
public void setSectionOutlineStrokeListAutoFill(boolean fill) {
this.sectionOutlineStrokeListAutoFill = fill;
}
/**
* Returns the minimum arc angle that will be drawn. Pie sections for an angle smaller than
* this are not drawn, to avoid a JDK bug.
*
* @return The minimum angle.
*/
public double getMinimumArcAngleToDraw() {
return this.minimumArcAngleToDraw;
}
/**
* Sets the minimum arc angle that will be drawn. Pie sections for an angle smaller than
* this are not drawn, to avoid a JDK bug.
*
* @param angle the minimum angle.
*/
public void setMinimumArcAngleToDraw(double angle) {
this.minimumArcAngleToDraw = angle;
}
/**
* Returns a collection of legend items for the pie chart.
*
* @return the legend items.
*/
public LegendItemCollection getLegendItems() {
LegendItemCollection result = new LegendItemCollection();
List keys = null;
Dataset data = getDataset();
if (data instanceof PieDataset) {
PieDataset pieData = (PieDataset) data;
keys = pieData.getKeys();
}
else if (data instanceof CategoryDataset) {
CategoryDataset categoryData = (CategoryDataset) data;
if (this.extractType == PER_ROW) {
keys = categoryData.getColumnKeys();
}
else if (this.extractType == PER_COLUMN) {
keys = categoryData.getRowKeys();
}
}
if (keys != null) {
int section = 0;
Iterator iterator = keys.iterator();
while (iterator.hasNext()) {
String label = iterator.next().toString();
String description = label;
Shape shape = null;
Paint paint = getPaint(section);
Paint outlinePaint = getOutlinePaint(section);
Stroke stroke = getOutlineStroke(section);
LegendItem item = new LegendItem(label, description,
shape, paint, outlinePaint,
stroke);
result.add(item);
section++;
}
}
return result;
}
/**
* Returns the tool-tip generator (possibly <code>null</code>).
*
* @return The tool-tip generator.
*
* @deprecated Use getItemLabelGenerator().
*/
public PieItemLabelGenerator getToolTipGenerator() {
return this.itemLabelGenerator;
}
/**
* Sets the tool tip generator.
* <P>
* If you set the generator to <code>null</code>, no tool tips will be generated for the
* pie chart.
*
* @param generator the new tooltip generator (<code>null</code> permitted).
*
* @deprecated Use setItemLabelGenerator.
*/
public void setToolTipGenerator(PieItemLabelGenerator generator) {
this.itemLabelGenerator = generator;
}
/**
* Returns the label generator.
*
* @return The label generator (possibly <code>null</code>).
*/
public PieItemLabelGenerator getItemLabelGenerator() {
return this.itemLabelGenerator;
}
/**
* Sets the label generator (used for generating tool-tips).
* <P>
* If you set the generator to <code>null</code>, no tool tips will be generated for the pie
* chart.
*
* @param generator the label generator (<code>null</code> permitted).
*/
public void setItemLabelGenerator(PieItemLabelGenerator generator) {
this.itemLabelGenerator = generator;
}
/**
* Returns the URL generator (possibly null).
*
* @return the URL generator.
*/
public PieURLGenerator getURLGenerator() {
return this.urlGenerator;
}
/**
* Sets the URL generator.
*
* @param generator the new URL generator (null permitted).
*/
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -