Package org.jfree.chart.plot.dial
Class ArcDialFrame
- java.lang.Object
-
- org.jfree.chart.plot.dial.AbstractDialLayer
-
- org.jfree.chart.plot.dial.ArcDialFrame
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,DialFrame,DialLayer,PublicCloneable
public class ArcDialFrame extends AbstractDialLayer implements DialFrame, java.lang.Cloneable, PublicCloneable, java.io.Serializable
A standard frame for theDialPlotclass.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.awt.PaintbackgroundPaintThe color used for the front of the panel.private doubleextentThe end angle.private java.awt.PaintforegroundPaintThe color used for the border around the window.private doubleinnerRadiusThe inner radius, relative to the framing rectangle.private doubleouterRadiusThe outer radius, relative to the framing rectangle.(package private) static longserialVersionUIDFor serialization.private doublestartAngleThe start angle.private java.awt.StrokestrokeThe stroke for drawing the frame outline.
-
Constructor Summary
Constructors Constructor Description ArcDialFrame()Creates a new instance ofArcDialFramethat spans 180 degrees.ArcDialFrame(double startAngle, double extent)Creates a new instance ofArcDialFramethat spans the arc specified.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()Returns a clone of this instance.voiddraw(java.awt.Graphics2D g2, DialPlot plot, java.awt.geom.Rectangle2D frame, java.awt.geom.Rectangle2D view)Draws the frame.booleanequals(java.lang.Object obj)Tests this instance for equality with an arbitrary object.java.awt.PaintgetBackgroundPaint()Returns the background paint (nevernull).doublegetExtent()Returns the extent.java.awt.PaintgetForegroundPaint()Returns the foreground paint.doublegetInnerRadius()Returns the inner radius, relative to the framing rectangle.doublegetOuterRadius()Returns the outer radius, relative to the framing rectangle.protected java.awt.ShapegetOuterWindow(java.awt.geom.Rectangle2D frame)Returns the outer window.doublegetStartAngle()Returns the start angle.java.awt.StrokegetStroke()Returns the stroke.java.awt.ShapegetWindow(java.awt.geom.Rectangle2D frame)Returns the shape for the window for this dial.inthashCode()Returns a hash code for this instance.booleanisClippedToWindow()Returnsfalseto indicate that this dial layer is not clipped to the dial window.private voidreadObject(java.io.ObjectInputStream stream)Provides serialization support.voidsetBackgroundPaint(java.awt.Paint paint)Sets the background paint and sends aDialLayerChangeEventto all registered listeners.voidsetExtent(double extent)Sets the extent and sends aDialLayerChangeEventto all registered listeners.voidsetForegroundPaint(java.awt.Paint paint)Sets the foreground paint and sends aDialLayerChangeEventto all registered listeners.voidsetInnerRadius(double radius)Sets the inner radius and sends aDialLayerChangeEventto all registered listeners.voidsetOuterRadius(double radius)Sets the outer radius and sends aDialLayerChangeEventto all registered listeners.voidsetStartAngle(double angle)Sets the start angle and sends aDialLayerChangeEventto all registered listeners.voidsetStroke(java.awt.Stroke stroke)Sets the stroke and sends aDialLayerChangeEventto all registered listeners.private voidwriteObject(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
-
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.
-
startAngle
private double startAngle
The start angle.
-
extent
private double extent
The end angle.
-
innerRadius
private double innerRadius
The inner radius, relative to the framing rectangle.
-
outerRadius
private double outerRadius
The outer radius, relative to the framing rectangle.
-
-
Constructor Detail
-
ArcDialFrame
public ArcDialFrame()
Creates a new instance ofArcDialFramethat spans 180 degrees.
-
ArcDialFrame
public ArcDialFrame(double startAngle, double extent)Creates a new instance ofArcDialFramethat spans the arc specified.- Parameters:
startAngle- the startAngle (in degrees).extent- the extent of the arc (in degrees, counter-clockwise).
-
-
Method Detail
-
getBackgroundPaint
public java.awt.Paint getBackgroundPaint()
Returns the background paint (nevernull).- Returns:
- The background paint.
- See Also:
setBackgroundPaint(Paint)
-
setBackgroundPaint
public void setBackgroundPaint(java.awt.Paint paint)
Sets the background paint and sends aDialLayerChangeEventto all registered listeners.- Parameters:
paint- the paint (nullnot 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 aDialLayerChangeEventto all registered listeners.- Parameters:
paint- the paint (nullnot permitted).- See Also:
getForegroundPaint()
-
getStroke
public java.awt.Stroke getStroke()
Returns the stroke.- Returns:
- The stroke (never
null). - See Also:
setStroke(Stroke)
-
setStroke
public void setStroke(java.awt.Stroke stroke)
Sets the stroke and sends aDialLayerChangeEventto all registered listeners.- Parameters:
stroke- the stroke (nullnot permitted).- See Also:
getStroke()
-
getInnerRadius
public double getInnerRadius()
Returns the inner radius, relative to the framing rectangle.- Returns:
- The inner radius.
- See Also:
setInnerRadius(double)
-
setInnerRadius
public void setInnerRadius(double radius)
Sets the inner radius and sends aDialLayerChangeEventto all registered listeners.- Parameters:
radius- the inner radius.- See Also:
getInnerRadius()
-
getOuterRadius
public double getOuterRadius()
Returns the outer radius, relative to the framing rectangle.- Returns:
- The outer radius.
- See Also:
setOuterRadius(double)
-
setOuterRadius
public void setOuterRadius(double radius)
Sets the outer radius and sends aDialLayerChangeEventto all registered listeners.- Parameters:
radius- the outer radius.- See Also:
getOuterRadius()
-
getStartAngle
public double getStartAngle()
Returns the start angle.- Returns:
- The start angle.
- See Also:
setStartAngle(double)
-
setStartAngle
public void setStartAngle(double angle)
Sets the start angle and sends aDialLayerChangeEventto all registered listeners.- Parameters:
angle- the angle.- See Also:
getStartAngle()
-
getExtent
public double getExtent()
Returns the extent.- Returns:
- The extent.
- See Also:
setExtent(double)
-
setExtent
public void setExtent(double extent)
Sets the extent and sends aDialLayerChangeEventto all registered listeners.- Parameters:
extent- the extent.- See Also:
getExtent()
-
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.
-
getOuterWindow
protected java.awt.Shape getOuterWindow(java.awt.geom.Rectangle2D frame)
Returns the outer window.- Parameters:
frame- the frame.- Returns:
- The outer window.
-
draw
public void draw(java.awt.Graphics2D g2, DialPlot plot, java.awt.geom.Rectangle2D frame, java.awt.geom.Rectangle2D view)Draws the frame.
-
isClippedToWindow
public boolean isClippedToWindow()
Returnsfalseto indicate that this dial layer is not clipped to the dial window.- Specified by:
isClippedToWindowin interfaceDialLayer- Returns:
false.
-
equals
public boolean equals(java.lang.Object obj)
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
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionReturns a clone of this instance.- Specified by:
clonein interfacePublicCloneable- Overrides:
clonein classAbstractDialLayer- Returns:
- A clone.
- Throws:
java.lang.CloneNotSupportedException- if any attribute of this instance cannot be cloned.
-
writeObject
private void writeObject(java.io.ObjectOutputStream stream) throws java.io.IOExceptionProvides 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.ClassNotFoundExceptionProvides 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.
-
-