Package org.jfree.chart.plot.dial
Class StandardDialFrame
java.lang.Object
org.jfree.chart.plot.dial.AbstractDialLayer
org.jfree.chart.plot.dial.StandardDialFrame
- All Implemented Interfaces:
Serializable,Cloneable,DialFrame,DialLayer,PublicCloneable
public class StandardDialFrame
extends AbstractDialLayer
implements DialFrame, Cloneable, PublicCloneable, Serializable
A simple circular frame for the
DialPlot class.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate PaintThe color used for the front of the panel.private PaintThe color used for the border around the window.private doubleThe outer radius, relative to the framing rectangle.(package private) static final longFor serialization.private StrokeThe stroke for drawing the frame outline. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()Returns a clone of this instance.voiddraw(Graphics2D g2, DialPlot plot, Rectangle2D frame, Rectangle2D view) Draws the frame.booleanTests this instance for equality with an arbitrary object.Returns the background paint.Returns the foreground paint.doubleReturns the radius, relative to the framing rectangle.Returns the stroke for the frame.getWindow(Rectangle2D frame) Returns the shape for the window for this dial.inthashCode()Returns a hash code for this instance.booleanReturnsfalseto indicate that this dial layer is not clipped to the dial window.private voidreadObject(ObjectInputStream stream) Provides serialization support.voidsetBackgroundPaint(Paint paint) Sets the background paint and sends aDialLayerChangeEventto all registered listeners.voidsetForegroundPaint(Paint paint) Sets the foreground paint and sends aDialLayerChangeEventto all registered listeners.voidsetRadius(double radius) Sets the radius and sends aDialLayerChangeEventto all registered listeners.voidSets the stroke and sends aDialLayerChangeEventto all registered listeners.private voidwriteObject(ObjectOutputStream stream) Provides serialization support.Methods inherited from class org.jfree.chart.plot.dial.AbstractDialLayer
addChangeListener, hasListener, isVisible, notifyListeners, removeChangeListener, setVisibleMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jfree.chart.plot.dial.DialLayer
addChangeListener, hasListener, isVisible, removeChangeListener
-
Field Details
-
serialVersionUID
static final long serialVersionUIDFor serialization.- See Also:
-
radius
private double radiusThe outer radius, relative to the framing rectangle. -
backgroundPaint
The color used for the front of the panel. This field is transient because it requires special handling for serialization. -
foregroundPaint
The color used for the border around the window. This field is transient because it requires special handling for serialization. -
stroke
The stroke for drawing the frame outline. This field is transient because it requires special handling for serialization.
-
-
Constructor Details
-
StandardDialFrame
public StandardDialFrame()Creates a new instance ofStandardDialFrame.
-
-
Method Details
-
getRadius
public double getRadius()Returns the radius, relative to the framing rectangle.- Returns:
- The radius.
- See Also:
-
setRadius
public void setRadius(double radius) Sets the radius and sends aDialLayerChangeEventto all registered listeners.- Parameters:
radius- the radius (must be positive).- See Also:
-
getBackgroundPaint
Returns the background paint.- Returns:
- The background paint (never
null). - See Also:
-
setBackgroundPaint
Sets the background paint and sends aDialLayerChangeEventto all registered listeners.- Parameters:
paint- the paint (nullnot permitted).- See Also:
-
getForegroundPaint
Returns the foreground paint.- Returns:
- The foreground paint (never
null). - See Also:
-
setForegroundPaint
Sets the foreground paint and sends aDialLayerChangeEventto all registered listeners.- Parameters:
paint- the paint (nullnot permitted).- See Also:
-
getStroke
Returns the stroke for the frame.- Returns:
- The stroke (never
null). - See Also:
-
setStroke
Sets the stroke and sends aDialLayerChangeEventto all registered listeners.- Parameters:
stroke- the stroke (nullnot permitted).- See Also:
-
getWindow
Returns the shape for the window for this dial. Some dial layers will request that their drawing be clipped within this window. -
isClippedToWindow
public boolean isClippedToWindow()Returnsfalseto indicate that this dial layer is not clipped to the dial window.- Specified by:
isClippedToWindowin interfaceDialLayer- Returns:
- A boolean.
-
draw
Draws the frame. This method is called by theDialPlotclass, you shouldn't need to call it directly. -
equals
Tests this instance for equality with an arbitrary object.- Overrides:
equalsin classAbstractDialLayer- Parameters:
obj- the object (nullpermitted).- Returns:
- A boolean.
-
hashCode
public int hashCode()Returns a hash code for this instance.- Overrides:
hashCodein classAbstractDialLayer- Returns:
- The hash code.
-
clone
Returns a clone of this instance.- Specified by:
clonein interfacePublicCloneable- Overrides:
clonein classAbstractDialLayer- Returns:
- A clone.
- Throws:
CloneNotSupportedException- if any of the frame's attributes cannot be cloned.
-
writeObject
Provides serialization support.- Parameters:
stream- the output stream.- Throws:
IOException- if there is an I/O error.
-
readObject
Provides serialization support.- Parameters:
stream- the input stream.- Throws:
IOException- if there is an I/O error.ClassNotFoundException- if there is a classpath problem.
-