?? jfreechart.java
字號:
* Sets a flag that controls whether or not a border is drawn around the outside of the
* chart.
*
* @param visible the flag.
*/
public void setBorderVisible(boolean visible) {
this.borderVisible = visible;
fireChartChanged();
}
/**
* Returns the stroke used to draw the chart border (if visible).
*
* @return The border stroke.
*/
public Stroke getBorderStroke() {
return this.borderStroke;
}
/**
* Sets the stroke used to draw the chart border (if visible).
*
* @param stroke the stroke.
*/
public void setBorderStroke(Stroke stroke) {
this.borderStroke = stroke;
fireChartChanged();
}
/**
* Returns the paint used to draw the chart border (if visible).
*
* @return The border paint.
*/
public Paint getBorderPaint() {
return this.borderPaint;
}
/**
* Sets the paint used to draw the chart border (if visible).
*
* @param paint the paint.
*/
public void setBorderPaint(Paint paint) {
this.borderPaint = paint;
fireChartChanged();
}
/**
* Returns the chart title.
*
* @return the chart title.
*/
public TextTitle getTitle() {
return this.title;
}
/**
* Sets the title for the chart.
*
* @param title the new title.
*/
public void setTitle(TextTitle title) {
this.title = title;
fireChartChanged();
}
/**
* Sets the chart title.
*
* @param title the new title.
*/
public void setTitle(String title) {
if (title != null) {
if (this.title == null) {
setTitle(new TextTitle(title, JFreeChart.DEFAULT_TITLE_FONT));
}
else {
this.title.setText(title);
}
}
else {
setTitle((TextTitle) null);
}
}
/**
* Returns the list of subtitles.
*
* @return the subtitle list.
*/
public List getSubtitles() {
return this.subtitles;
}
/**
* Sets the title list for the chart (completely replaces any existing titles).
*
* @param subtitles the new list of subtitles.
*/
public void setSubtitles(List subtitles) {
this.subtitles = subtitles;
fireChartChanged();
}
/**
* Returns the number of titles for the chart.
*
* @return the number of titles for the chart.
*/
public int getSubtitleCount() {
return this.subtitles.size();
}
/**
* Returns a chart subtitle.
*
* @param index the index of the chart subtitle (zero based).
*
* @return a chart subtitle.
*/
public AbstractTitle getSubtitle(int index) {
// check arguments...
if ((index < 0) || (index == getSubtitleCount())) {
throw new IllegalArgumentException("JFreeChart.getSubtitle(...): index out of range.");
}
return (AbstractTitle) this.subtitles.get(index);
}
/**
* Adds a chart subtitle, and notifies registered listeners that the chart has been modified.
*
* @param subtitle the subtitle.
*/
public void addSubtitle(AbstractTitle subtitle) {
if (subtitle != null) {
this.subtitles.add(subtitle);
subtitle.addChangeListener(this);
fireChartChanged();
}
}
/**
* Returns the chart legend.
*
* @return the chart legend (possibly <code>null</code>).
*/
public Legend getLegend() {
return legend;
}
/**
* Sets the chart legend. Registered listeners are notified that the chart
* has been modified.
*
* @param legend the new chart legend (null permitted).
*/
public void setLegend(Legend legend) {
// if there is an existing legend, remove the chart from the list of
// change listeners...
Legend existing = this.legend;
if (existing != null) {
existing.removeChangeListener(this);
}
// set the new legend, and register the chart as a change listener...
this.legend = legend;
if (legend != null) {
legend.addChangeListener(this);
}
// notify chart change listeners...
fireChartChanged();
}
/**
* Returns the plot for the chart. The plot is a class responsible for
* coordinating the visual representation of the data, including the axes
* (if any).
*
* @return the plot.
*/
public Plot getPlot() {
return this.plot;
}
/**
* Returns the plot cast as a {@link CategoryPlot}.
* <p>
* NOTE: if the plot is not an instance of {@link CategoryPlot}, then a
* <code>ClassCastException</code> is thrown.
*
* @return the plot.
*/
public CategoryPlot getCategoryPlot() {
return (CategoryPlot) this.plot;
}
/**
* Returns the plot cast as an {@link XYPlot}.
* <p>
* NOTE: if the plot is not an instance of {@link XYPlot}, then a
* <code>ClassCastException</code> is thrown.
*
* @return the plot.
*/
public XYPlot getXYPlot() {
return (XYPlot) this.plot;
}
/**
* Returns a flag that indicates whether or not anti-aliasing is used when
* the chart is drawn.
*
* @return the flag.
* @deprecated Add hints using the getRenderingHints()/setRenderingHints() methods.
*/
public boolean getAntiAlias() {
return antialias;
}
/**
* Sets a flag that indicates whether or not anti-aliasing is used when the
* chart is drawn.
* <P>
* Anti-aliasing usually improves the appearance of charts.
*
* @param flag the new value of the flag.
* @deprecated Add hints using the getRenderingHints()/setRenderingHints() methods.
*/
public void setAntiAlias(boolean flag) {
if (this.antialias != flag) {
this.antialias = flag;
fireChartChanged();
}
}
/**
* Returns the color/shade used to fill the chart background.
*
* @return the color/shade used to fill the chart background.
*/
public Paint getBackgroundPaint() {
return this.backgroundPaint;
}
/**
* Sets the color/shade used to fill the chart background. All registered
* listeners are notified that the chart has been changed.
*
* @param paint the new background color/shade.
*/
public void setBackgroundPaint(Paint paint) {
if (this.backgroundPaint != null) {
if (!this.backgroundPaint.equals(paint)) {
this.backgroundPaint = paint;
fireChartChanged();
}
}
else {
if (paint != null) {
this.backgroundPaint = paint;
fireChartChanged();
}
}
}
/**
* Returns the chart's background image (possibly null).
*
* @return the image.
*/
public Image getBackgroundImage() {
return this.backgroundImage;
}
/**
* Sets the chart's background image (null permitted). Registered listeners
* are notified that the chart has been changed.
*
* @param image the image.
*/
public void setBackgroundImage(Image image) {
if (this.backgroundImage != null) {
if (!this.backgroundImage.equals(image)) {
this.backgroundImage = image;
fireChartChanged();
}
}
else {
if (image != null) {
this.backgroundImage = image;
fireChartChanged();
}
}
}
/**
* Returns the background image alignment. Alignment constants are defined in the
* <code>com.jrefinery.ui.Align</code> class in the JCommon class library.
*
* @return The alignment.
*/
public int getBackgroundImageAlignment() {
return this.backgroundImageAlignment;
}
/**
* Sets the background alignment.
* <p>
* Alignment options are defined by the {@link org.jfree.ui.Align} class.
*
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -