📄 plot.java
字号:
}
/**
* Returns the font used to display the 'no data' message.
*
* @return The font (never <code>null</code>).
*
* @see #setNoDataMessageFont(Font)
* @see #getNoDataMessage()
*/
public Font getNoDataMessageFont() {
return this.noDataMessageFont;
}
/**
* Sets the font used to display the 'no data' message and sends a
* {@link PlotChangeEvent} to all registered listeners.
*
* @param font the font (<code>null</code> not permitted).
*
* @see #getNoDataMessageFont()
*/
public void setNoDataMessageFont(Font font) {
if (font == null) {
throw new IllegalArgumentException("Null 'font' argument.");
}
this.noDataMessageFont = font;
notifyListeners(new PlotChangeEvent(this));
}
/**
* Returns the paint used to display the 'no data' message.
*
* @return The paint (never <code>null</code>).
*
* @see #setNoDataMessagePaint(Paint)
* @see #getNoDataMessage()
*/
public Paint getNoDataMessagePaint() {
return this.noDataMessagePaint;
}
/**
* Sets the paint used to display the 'no data' message and sends a
* {@link PlotChangeEvent} to all registered listeners.
*
* @param paint the paint (<code>null</code> not permitted).
*
* @see #getNoDataMessagePaint()
*/
public void setNoDataMessagePaint(Paint paint) {
if (paint == null) {
throw new IllegalArgumentException("Null 'paint' argument.");
}
this.noDataMessagePaint = paint;
notifyListeners(new PlotChangeEvent(this));
}
/**
* Returns a short string describing the plot type.
* <P>
* Note: this gets used in the chart property editing user interface,
* but there needs to be a better mechanism for identifying the plot type.
*
* @return A short string describing the plot type (never
* <code>null</code>).
*/
public abstract String getPlotType();
/**
* Returns the parent plot (or <code>null</code> if this plot is not part
* of a combined plot).
*
* @return The parent plot.
*
* @see #setParent(Plot)
* @see #getRootPlot()
*/
public Plot getParent() {
return this.parent;
}
/**
* Sets the parent plot. This method is intended for internal use, you
* shouldn't need to call it directly.
*
* @param parent the parent plot (<code>null</code> permitted).
*
* @see #getParent()
*/
public void setParent(Plot parent) {
this.parent = parent;
}
/**
* Returns the root plot.
*
* @return The root plot.
*
* @see #getParent()
*/
public Plot getRootPlot() {
Plot p = getParent();
if (p == null) {
return this;
}
else {
return p.getRootPlot();
}
}
/**
* Returns <code>true</code> if this plot is part of a combined plot
* structure (that is, {@link #getParent()} returns a non-<code>null</code>
* value), and <code>false</code> otherwise.
*
* @return <code>true</code> if this plot is part of a combined plot
* structure.
*
* @see #getParent()
*/
public boolean isSubplot() {
return (getParent() != null);
}
/**
* Returns the insets for the plot area.
*
* @return The insets (never <code>null</code>).
*
* @see #setInsets(RectangleInsets)
*/
public RectangleInsets getInsets() {
return this.insets;
}
/**
* Sets the insets for the plot and sends a {@link PlotChangeEvent} to
* all registered listeners.
*
* @param insets the new insets (<code>null</code> not permitted).
*
* @see #getInsets()
* @see #setInsets(RectangleInsets, boolean)
*/
public void setInsets(RectangleInsets insets) {
setInsets(insets, true);
}
/**
* Sets the insets for the plot and, if requested, and sends a
* {@link PlotChangeEvent} to all registered listeners.
*
* @param insets the new insets (<code>null</code> not permitted).
* @param notify a flag that controls whether the registered listeners are
* notified.
*
* @see #getInsets()
* @see #setInsets(RectangleInsets)
*/
public void setInsets(RectangleInsets insets, boolean notify) {
if (insets == null) {
throw new IllegalArgumentException("Null 'insets' argument.");
}
if (!this.insets.equals(insets)) {
this.insets = insets;
if (notify) {
notifyListeners(new PlotChangeEvent(this));
}
}
}
/**
* Returns the background color of the plot area.
*
* @return The paint (possibly <code>null</code>).
*
* @see #setBackgroundPaint(Paint)
*/
public Paint getBackgroundPaint() {
return this.backgroundPaint;
}
/**
* Sets the background color of the plot area and sends a
* {@link PlotChangeEvent} to all registered listeners.
*
* @param paint the paint (<code>null</code> permitted).
*
* @see #getBackgroundPaint()
*/
public void setBackgroundPaint(Paint paint) {
if (paint == null) {
if (this.backgroundPaint != null) {
this.backgroundPaint = null;
notifyListeners(new PlotChangeEvent(this));
}
}
else {
if (this.backgroundPaint != null) {
if (this.backgroundPaint.equals(paint)) {
return; // nothing to do
}
}
this.backgroundPaint = paint;
notifyListeners(new PlotChangeEvent(this));
}
}
/**
* Returns the alpha transparency of the plot area background.
*
* @return The alpha transparency.
*
* @see #setBackgroundAlpha(float)
*/
public float getBackgroundAlpha() {
return this.backgroundAlpha;
}
/**
* Sets the alpha transparency of the plot area background, and notifies
* registered listeners that the plot has been modified.
*
* @param alpha the new alpha value (in the range 0.0f to 1.0f).
*
* @see #getBackgroundAlpha()
*/
public void setBackgroundAlpha(float alpha) {
if (this.backgroundAlpha != alpha) {
this.backgroundAlpha = alpha;
notifyListeners(new PlotChangeEvent(this));
}
}
/**
* Returns the drawing supplier for the plot.
*
* @return The drawing supplier (possibly <code>null</code>).
*
* @see #setDrawingSupplier(DrawingSupplier)
*/
public DrawingSupplier getDrawingSupplier() {
DrawingSupplier result = null;
Plot p = getParent();
if (p != null) {
result = p.getDrawingSupplier();
}
else {
result = this.drawingSupplier;
}
return result;
}
/**
* Sets the drawing supplier for the plot. The drawing supplier is
* responsible for supplying a limitless (possibly repeating) sequence of
* <code>Paint</code>, <code>Stroke</code> and <code>Shape</code> objects
* that the plot's renderer(s) can use to populate its (their) tables.
*
* @param supplier the new supplier.
*
* @see #getDrawingSupplier()
*/
public void setDrawingSupplier(DrawingSupplier supplier) {
this.drawingSupplier = supplier;
notifyListeners(new PlotChangeEvent(this));
}
/**
* Returns the background image that is used to fill the plot's background
* area.
*
* @return The image (possibly <code>null</code>).
*
* @see #setBackgroundImage(Image)
*/
public Image getBackgroundImage() {
return this.backgroundImage;
}
/**
* Sets the background image for the plot and sends a
* {@link PlotChangeEvent} to all registered listeners.
*
* @param image the image (<code>null</code> permitted).
*
* @see #getBackgroundImage()
*/
public void setBackgroundImage(Image image) {
this.backgroundImage = image;
notifyListeners(new PlotChangeEvent(this));
}
/**
* Returns the background image alignment. Alignment constants are defined
* in the <code>org.jfree.ui.Align</code> class in the JCommon class
* library.
*
* @return The alignment.
*
* @see #setBackgroundImageAlignment(int)
*/
public int getBackgroundImageAlignment() {
return this.backgroundImageAlignment;
}
/**
* Sets the alignment for the background image and sends a
* {@link PlotChangeEvent} to all registered listeners. Alignment options
* are defined by the {@link org.jfree.ui.Align} class in the JCommon
* class library.
*
* @param alignment the alignment.
*
* @see #getBackgroundImageAlignment()
*/
public void setBackgroundImageAlignment(int alignment) {
if (this.backgroundImageAlignment != alignment) {
this.backgroundImageAlignment = alignment;
notifyListeners(new PlotChangeEvent(this));
}
}
/**
* Returns the alpha transparency used to draw the background image. This
* is a value in the range 0.0f to 1.0f, where 0.0f is fully transparent
* and 1.0f is fully opaque.
*
* @return The alpha transparency.
*
* @see #setBackgroundImageAlpha(float)
*/
public float getBackgroundImageAlpha() {
return this.backgroundImageAlpha;
}
/**
* Sets the alpha transparency used when drawing the background image.
*
* @param alpha the alpha transparency (in the range 0.0f to 1.0f, where
* 0.0f is fully transparent, and 1.0f is fully opaque).
*
* @throws IllegalArgumentException if <code>alpha</code> is not within
* the specified range.
*
* @see #getBackgroundImageAlpha()
*/
public void setBackgroundImageAlpha(float alpha) {
if (alpha < 0.0f || alpha > 1.0f)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -