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:
java.io.Serializable
,java.lang.Cloneable
,DialFrame
,DialLayer
,PublicCloneable
public class StandardDialFrame extends AbstractDialLayer implements DialFrame, java.lang.Cloneable, PublicCloneable, java.io.Serializable
A simple circular frame for theDialPlot
class.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.awt.Paint
backgroundPaint
The color used for the front of the panel.private java.awt.Paint
foregroundPaint
The color used for the border around the window.private double
radius
The outer radius, relative to the framing rectangle.(package private) static long
serialVersionUID
For serialization.private java.awt.Stroke
stroke
The stroke for drawing the frame outline.
-
Constructor Summary
Constructors Constructor Description StandardDialFrame()
Creates a new instance ofStandardDialFrame
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
clone()
Returns a clone of this instance.void
draw(java.awt.Graphics2D g2, DialPlot plot, java.awt.geom.Rectangle2D frame, java.awt.geom.Rectangle2D view)
Draws the frame.boolean
equals(java.lang.Object obj)
Tests this instance for equality with an arbitrary object.java.awt.Paint
getBackgroundPaint()
Returns the background paint.java.awt.Paint
getForegroundPaint()
Returns the foreground paint.double
getRadius()
Returns the radius, relative to the framing rectangle.java.awt.Stroke
getStroke()
Returns the stroke for the frame.java.awt.Shape
getWindow(java.awt.geom.Rectangle2D frame)
Returns the shape for the window for this dial.int
hashCode()
Returns a hash code for this instance.boolean
isClippedToWindow()
Returnsfalse
to indicate that this dial layer is not clipped to the dial window.private void
readObject(java.io.ObjectInputStream stream)
Provides serialization support.void
setBackgroundPaint(java.awt.Paint paint)
Sets the background paint and sends aDialLayerChangeEvent
to all registered listeners.void
setForegroundPaint(java.awt.Paint paint)
Sets the foreground paint and sends aDialLayerChangeEvent
to all registered listeners.void
setRadius(double radius)
Sets the radius and sends aDialLayerChangeEvent
to all registered listeners.void
setStroke(java.awt.Stroke stroke)
Sets the stroke and sends aDialLayerChangeEvent
to all registered listeners.private void
writeObject(java.io.ObjectOutputStream stream)
Provides serialization support.-
Methods inherited from class org.jfree.chart.plot.dial.AbstractDialLayer
addChangeListener, hasListener, isVisible, notifyListeners, removeChangeListener, setVisible
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jfree.chart.plot.dial.DialLayer
addChangeListener, hasListener, isVisible, removeChangeListener
-
-
-
-
Field Detail
-
serialVersionUID
static final long serialVersionUID
For serialization.- See Also:
- Constant Field Values
-
radius
private double radius
The outer radius, relative to the framing rectangle.
-
backgroundPaint
private transient java.awt.Paint backgroundPaint
The color used for the front of the panel. This field is transient because it requires special handling for serialization.
-
foregroundPaint
private transient java.awt.Paint foregroundPaint
The color used for the border around the window. This field is transient because it requires special handling for serialization.
-
stroke
private transient java.awt.Stroke stroke
The stroke for drawing the frame outline. This field is transient because it requires special handling for serialization.
-
-
Method Detail
-
getRadius
public double getRadius()
Returns the radius, relative to the framing rectangle.- Returns:
- The radius.
- See Also:
setRadius(double)
-
setRadius
public void setRadius(double radius)
Sets the radius and sends aDialLayerChangeEvent
to all registered listeners.- Parameters:
radius
- the radius (must be positive).- See Also:
getRadius()
-
getBackgroundPaint
public java.awt.Paint getBackgroundPaint()
Returns the background paint.- Returns:
- The background paint (never
null
). - See Also:
setBackgroundPaint(Paint)
-
setBackgroundPaint
public void setBackgroundPaint(java.awt.Paint paint)
Sets the background paint and sends aDialLayerChangeEvent
to all registered listeners.- Parameters:
paint
- the paint (null
not permitted).- See Also:
getBackgroundPaint()
-
getForegroundPaint
public java.awt.Paint getForegroundPaint()
Returns the foreground paint.- Returns:
- The foreground paint (never
null
). - See Also:
setForegroundPaint(Paint)
-
setForegroundPaint
public void setForegroundPaint(java.awt.Paint paint)
Sets the foreground paint and sends aDialLayerChangeEvent
to all registered listeners.- Parameters:
paint
- the paint (null
not permitted).- See Also:
getForegroundPaint()
-
getStroke
public java.awt.Stroke getStroke()
Returns the stroke for the frame.- Returns:
- The stroke (never
null
). - See Also:
setStroke(Stroke)
-
setStroke
public void setStroke(java.awt.Stroke stroke)
Sets the stroke and sends aDialLayerChangeEvent
to all registered listeners.- Parameters:
stroke
- the stroke (null
not permitted).- See Also:
getStroke()
-
getWindow
public java.awt.Shape getWindow(java.awt.geom.Rectangle2D frame)
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()
Returnsfalse
to indicate that this dial layer is not clipped to the dial window.- Specified by:
isClippedToWindow
in interfaceDialLayer
- Returns:
- A boolean.
-
draw
public void draw(java.awt.Graphics2D g2, DialPlot plot, java.awt.geom.Rectangle2D frame, java.awt.geom.Rectangle2D view)
Draws the frame. This method is called by theDialPlot
class, you shouldn't need to call it directly.
-
equals
public boolean equals(java.lang.Object obj)
Tests this instance for equality with an arbitrary object.- Overrides:
equals
in classAbstractDialLayer
- Parameters:
obj
- the object (null
permitted).- Returns:
- A boolean.
-
hashCode
public int hashCode()
Returns a hash code for this instance.- Overrides:
hashCode
in classAbstractDialLayer
- Returns:
- The hash code.
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
Returns a clone of this instance.- Specified by:
clone
in interfacePublicCloneable
- Overrides:
clone
in classAbstractDialLayer
- Returns:
- A clone.
- Throws:
java.lang.CloneNotSupportedException
- if any of the frame's attributes cannot be cloned.
-
writeObject
private void writeObject(java.io.ObjectOutputStream stream) throws java.io.IOException
Provides serialization support.- Parameters:
stream
- the output stream.- Throws:
java.io.IOException
- if there is an I/O error.
-
readObject
private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, java.lang.ClassNotFoundException
Provides serialization support.- Parameters:
stream
- the input stream.- Throws:
java.io.IOException
- if there is an I/O error.java.lang.ClassNotFoundException
- if there is a classpath problem.
-
-