📄 pieplot.java
字号:
}
/**
* Sets the section label generator and sends a {@link PlotChangeEvent} to
* all registered listeners.
*
* @param generator the generator (<code>null</code> permitted).
*
* @see #getLabelGenerator()
*/
public void setLabelGenerator(PieSectionLabelGenerator generator) {
this.labelGenerator = generator;
notifyListeners(new PlotChangeEvent(this));
}
/**
* Returns the gap between the edge of the pie and the labels, expressed as
* a percentage of the plot width.
*
* @return The gap (a percentage, where 0.05 = five percent).
*
* @see #setLabelGap(double)
*/
public double getLabelGap() {
return this.labelGap;
}
/**
* Sets the gap between the edge of the pie and the labels (expressed as a
* percentage of the plot width) and sends a {@link PlotChangeEvent} to all
* registered listeners.
*
* @param gap the gap (a percentage, where 0.05 = five percent).
*
* @see #getLabelGap()
*/
public void setLabelGap(double gap) {
this.labelGap = gap;
notifyListeners(new PlotChangeEvent(this));
}
/**
* Returns the maximum label width as a percentage of the plot width.
*
* @return The width (a percentage, where 0.20 = 20 percent).
*
* @see #setMaximumLabelWidth(double)
*/
public double getMaximumLabelWidth() {
return this.maximumLabelWidth;
}
/**
* Sets the maximum label width as a percentage of the plot width and sends
* a {@link PlotChangeEvent} to all registered listeners.
*
* @param width the width (a percentage, where 0.20 = 20 percent).
*
* @see #getMaximumLabelWidth()
*/
public void setMaximumLabelWidth(double width) {
this.maximumLabelWidth = width;
notifyListeners(new PlotChangeEvent(this));
}
/**
* Returns the flag that controls whether or not label linking lines are
* visible.
*
* @return A boolean.
*
* @see #setLabelLinksVisible(boolean)
*/
public boolean getLabelLinksVisible() {
return this.labelLinksVisible;
}
/**
* Sets the flag that controls whether or not label linking lines are
* visible and sends a {@link PlotChangeEvent} to all registered listeners.
* Please take care when hiding the linking lines - depending on the data
* values, the labels can be displayed some distance away from the
* corresponding pie section.
*
* @param visible the flag.
*
* @see #getLabelLinksVisible()
*/
public void setLabelLinksVisible(boolean visible) {
this.labelLinksVisible = visible;
notifyListeners(new PlotChangeEvent(this));
}
/**
* Returns the margin (expressed as a percentage of the width or height)
* between the edge of the pie and the link point.
*
* @return The link margin (as a percentage, where 0.05 is five percent).
*
* @see #setLabelLinkMargin(double)
*/
public double getLabelLinkMargin() {
return this.labelLinkMargin;
}
/**
* Sets the link margin and sends a {@link PlotChangeEvent} to all
* registered listeners.
*
* @param margin the margin.
*
* @see #getLabelLinkMargin()
*/
public void setLabelLinkMargin(double margin) {
this.labelLinkMargin = margin;
notifyListeners(new PlotChangeEvent(this));
}
/**
* Returns the paint used for the lines that connect pie sections to their
* corresponding labels.
*
* @return The paint (never <code>null</code>).
*
* @see #setLabelLinkPaint(Paint)
*/
public Paint getLabelLinkPaint() {
return this.labelLinkPaint;
}
/**
* Sets the paint used for the lines that connect pie sections to their
* corresponding labels, and sends a {@link PlotChangeEvent} to all
* registered listeners.
*
* @param paint the paint (<code>null</code> not permitted).
*
* @see #getLabelLinkPaint()
*/
public void setLabelLinkPaint(Paint paint) {
if (paint == null) {
throw new IllegalArgumentException("Null 'paint' argument.");
}
this.labelLinkPaint = paint;
notifyListeners(new PlotChangeEvent(this));
}
/**
* Returns the stroke used for the label linking lines.
*
* @return The stroke.
*
* @see #setLabelLinkStroke(Stroke)
*/
public Stroke getLabelLinkStroke() {
return this.labelLinkStroke;
}
/**
* Sets the link stroke and sends a {@link PlotChangeEvent} to all
* registered listeners.
*
* @param stroke the stroke.
*
* @see #getLabelLinkStroke()
*/
public void setLabelLinkStroke(Stroke stroke) {
if (stroke == null) {
throw new IllegalArgumentException("Null 'stroke' argument.");
}
this.labelLinkStroke = stroke;
notifyListeners(new PlotChangeEvent(this));
}
/**
* Returns the section label font.
*
* @return The font (never <code>null</code>).
*
* @see #setLabelFont(Font)
*/
public Font getLabelFont() {
return this.labelFont;
}
/**
* Sets the section label font and sends a {@link PlotChangeEvent} to all
* registered listeners.
*
* @param font the font (<code>null</code> not permitted).
*
* @see #getLabelFont()
*/
public void setLabelFont(Font font) {
if (font == null) {
throw new IllegalArgumentException("Null 'font' argument.");
}
this.labelFont = font;
notifyListeners(new PlotChangeEvent(this));
}
/**
* Returns the section label paint.
*
* @return The paint (never <code>null</code>).
*
* @see #setLabelPaint(Paint)
*/
public Paint getLabelPaint() {
return this.labelPaint;
}
/**
* Sets the section label paint and sends a {@link PlotChangeEvent} to all
* registered listeners.
*
* @param paint the paint (<code>null</code> not permitted).
*
* @see #getLabelPaint()
*/
public void setLabelPaint(Paint paint) {
if (paint == null) {
throw new IllegalArgumentException("Null 'paint' argument.");
}
this.labelPaint = paint;
notifyListeners(new PlotChangeEvent(this));
}
/**
* Returns the section label background paint.
*
* @return The paint (possibly <code>null</code>).
*
* @see #setLabelBackgroundPaint(Paint)
*/
public Paint getLabelBackgroundPaint() {
return this.labelBackgroundPaint;
}
/**
* Sets the section label background paint and sends a
* {@link PlotChangeEvent} to all registered listeners.
*
* @param paint the paint (<code>null</code> permitted).
*
* @see #getLabelBackgroundPaint()
*/
public void setLabelBackgroundPaint(Paint paint) {
this.labelBackgroundPaint = paint;
notifyListeners(new PlotChangeEvent(this));
}
/**
* Returns the section label outline paint.
*
* @return The paint (possibly <code>null</code>).
*
* @see #setLabelOutlinePaint(Paint)
*/
public Paint getLabelOutlinePaint() {
return this.labelOutlinePaint;
}
/**
* Sets the section label outline paint and sends a
* {@link PlotChangeEvent} to all registered listeners.
*
* @param paint the paint (<code>null</code> permitted).
*
* @see #getLabelOutlinePaint()
*/
public void setLabelOutlinePaint(Paint paint) {
this.labelOutlinePaint = paint;
notifyListeners(new PlotChangeEvent(this));
}
/**
* Returns the section label outline stroke.
*
* @return The stroke (possibly <code>null</code>).
*
* @see #setLabelOutlineStroke(Stroke)
*/
public Stroke getLabelOutlineStroke() {
return this.labelOutlineStroke;
}
/**
* Sets the section label outline stroke and sends a
* {@link PlotChangeEvent} to all registered listeners.
*
* @param stroke the stroke (<code>null</code> permitted).
*
* @see #getLabelOutlineStroke()
*/
public void setLabelOutlineStroke(Stroke stroke) {
this.labelOutlineStroke = stroke;
notifyListeners(new PlotChangeEvent(this));
}
/**
* Returns the section label shadow paint.
*
* @return The paint (possibly <code>null</code>).
*
* @see #setLabelShadowPaint(Paint)
*/
public Paint getLabelShadowPaint() {
return this.labelShadowPaint;
}
/**
* Sets the section label shadow paint and sends a {@link PlotChangeEvent}
* to all registered listeners.
*
* @param paint the paint (<code>null</code> permitted).
*
* @see #getLabelShadowPaint()
*/
public void setLabelShadowPaint(Paint paint) {
this.labelShadowPaint = paint;
notifyListeners(new PlotChangeEvent(this));
}
/**
* Returns the label padding.
*
* @return The label padding (never <code>null</code>).
*
* @since 1.0.7
*
* @see #setLabelPadding(RectangleInsets)
*/
public RectangleInsets getLabelPadding() {
return this.labelPadding;
}
/**
* Sets the padding between each label and its outline and sends a
* {@link PlotChangeEvent} to all registered listeners.
*
* @param padding the padding (<code>null</code> not permitted).
*
* @since 1.0.7
*
* @see #getLabelPadding()
*/
public void setLabelPadding(RectangleInsets padding) {
if (padding == null) {
throw new IllegalArgumentException("Null 'padding' argument.");
}
this.labelPadding = padding;
notifyListeners(new PlotChangeEvent(this));
}
/**
* Returns the flag that controls whether simple or extended labels are
* displayed on the plot.
*
* @return A boolean.
*
* @since 1.0.7
*/
public boolean getSimpleLabels() {
return this.simpleLabels;
}
/**
* Sets the flag that controls whether simple or extended labels are
* displayed on the plot, and sends a {@link PlotChangeEvent} to all
* registered listeners.
*
* @param simple the new flag value.
*
* @since 1.0.7
*/
public void setSimpleLabels(boolean simple) {
this.simpleLabels = simple;
notifyListeners(new PlotChangeEvent(this));
}
/**
* Returns the offset used for the simple labels, if they are displayed.
*
* @return Th
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -