Package org.jfree.chart.plot
Class DefaultDrawingSupplier
- java.lang.Object
-
- org.jfree.chart.plot.DefaultDrawingSupplier
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,DrawingSupplier,PublicCloneable
public class DefaultDrawingSupplier extends java.lang.Object implements DrawingSupplier, java.lang.Cloneable, PublicCloneable, java.io.Serializable
A default implementation of theDrawingSupplierinterface. AllPlotinstances have a new instance of this class installed by default.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.awt.Paint[]DEFAULT_FILL_PAINT_SEQUENCEThe default fill paint sequence.static java.awt.Paint[]DEFAULT_OUTLINE_PAINT_SEQUENCEThe default outline paint sequence.static java.awt.Stroke[]DEFAULT_OUTLINE_STROKE_SEQUENCEThe default outline stroke sequence.static java.awt.Paint[]DEFAULT_PAINT_SEQUENCEThe default fill paint sequence.static java.awt.Shape[]DEFAULT_SHAPE_SEQUENCEThe default shape sequence.static java.awt.Stroke[]DEFAULT_STROKE_SEQUENCEThe default stroke sequence.private intfillPaintIndexThe current fill paint index.private java.awt.Paint[]fillPaintSequenceThe fill paint sequence.private intoutlinePaintIndexThe current outline paint index.private java.awt.Paint[]outlinePaintSequenceThe outline paint sequence.private intoutlineStrokeIndexThe current outline stroke index.private java.awt.Stroke[]outlineStrokeSequenceThe outline stroke sequence.private intpaintIndexThe current paint index.private java.awt.Paint[]paintSequenceThe paint sequence.private static longserialVersionUIDFor serialization.private intshapeIndexThe current shape index.private java.awt.Shape[]shapeSequenceThe shape sequence.private intstrokeIndexThe current stroke index.private java.awt.Stroke[]strokeSequenceThe stroke sequence.
-
Constructor Summary
Constructors Constructor Description DefaultDrawingSupplier()Creates a new supplier, with default sequences for fill paint, outline paint, stroke and shapes.DefaultDrawingSupplier(java.awt.Paint[] paintSequence, java.awt.Paint[] fillPaintSequence, java.awt.Paint[] outlinePaintSequence, java.awt.Stroke[] strokeSequence, java.awt.Stroke[] outlineStrokeSequence, java.awt.Shape[] shapeSequence)Creates a new supplier.DefaultDrawingSupplier(java.awt.Paint[] paintSequence, java.awt.Paint[] outlinePaintSequence, java.awt.Stroke[] strokeSequence, java.awt.Stroke[] outlineStrokeSequence, java.awt.Shape[] shapeSequence)Creates a new supplier.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()Returns a clone.static java.awt.Shape[]createStandardSeriesShapes()Creates an array of standard shapes to display for the items in series on charts.booleanequals(java.lang.Object obj)Tests this object for equality with another object.private booleanequalShapes(java.awt.Shape[] s1, java.awt.Shape[] s2)A utility method for testing the equality of two arrays of shapes.java.awt.PaintgetNextFillPaint()Returns the next fill paint in the sequence.java.awt.PaintgetNextOutlinePaint()Returns the next outline paint in the sequence.java.awt.StrokegetNextOutlineStroke()Returns the next outline stroke in the sequence.java.awt.PaintgetNextPaint()Returns the next paint in the sequence.java.awt.ShapegetNextShape()Returns the next shape in the sequence.java.awt.StrokegetNextStroke()Returns the next stroke in the sequence.private static int[]intArray(double a, double b, double c)Helper method to avoid lots of explicit casts in getShape().private static int[]intArray(double a, double b, double c, double d)Helper method to avoid lots of explicit casts in getShape().private voidreadObject(java.io.ObjectInputStream stream)Restores a serialized object.private voidwriteObject(java.io.ObjectOutputStream stream)Handles serialization.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
For serialization.- See Also:
- Constant Field Values
-
DEFAULT_PAINT_SEQUENCE
public static final java.awt.Paint[] DEFAULT_PAINT_SEQUENCE
The default fill paint sequence.
-
DEFAULT_OUTLINE_PAINT_SEQUENCE
public static final java.awt.Paint[] DEFAULT_OUTLINE_PAINT_SEQUENCE
The default outline paint sequence.
-
DEFAULT_FILL_PAINT_SEQUENCE
public static final java.awt.Paint[] DEFAULT_FILL_PAINT_SEQUENCE
The default fill paint sequence.
-
DEFAULT_STROKE_SEQUENCE
public static final java.awt.Stroke[] DEFAULT_STROKE_SEQUENCE
The default stroke sequence.
-
DEFAULT_OUTLINE_STROKE_SEQUENCE
public static final java.awt.Stroke[] DEFAULT_OUTLINE_STROKE_SEQUENCE
The default outline stroke sequence.
-
DEFAULT_SHAPE_SEQUENCE
public static final java.awt.Shape[] DEFAULT_SHAPE_SEQUENCE
The default shape sequence.
-
paintSequence
private transient java.awt.Paint[] paintSequence
The paint sequence.
-
paintIndex
private int paintIndex
The current paint index.
-
outlinePaintSequence
private transient java.awt.Paint[] outlinePaintSequence
The outline paint sequence.
-
outlinePaintIndex
private int outlinePaintIndex
The current outline paint index.
-
fillPaintSequence
private transient java.awt.Paint[] fillPaintSequence
The fill paint sequence.
-
fillPaintIndex
private int fillPaintIndex
The current fill paint index.
-
strokeSequence
private transient java.awt.Stroke[] strokeSequence
The stroke sequence.
-
strokeIndex
private int strokeIndex
The current stroke index.
-
outlineStrokeSequence
private transient java.awt.Stroke[] outlineStrokeSequence
The outline stroke sequence.
-
outlineStrokeIndex
private int outlineStrokeIndex
The current outline stroke index.
-
shapeSequence
private transient java.awt.Shape[] shapeSequence
The shape sequence.
-
shapeIndex
private int shapeIndex
The current shape index.
-
-
Constructor Detail
-
DefaultDrawingSupplier
public DefaultDrawingSupplier()
Creates a new supplier, with default sequences for fill paint, outline paint, stroke and shapes.
-
DefaultDrawingSupplier
public DefaultDrawingSupplier(java.awt.Paint[] paintSequence, java.awt.Paint[] outlinePaintSequence, java.awt.Stroke[] strokeSequence, java.awt.Stroke[] outlineStrokeSequence, java.awt.Shape[] shapeSequence)Creates a new supplier.- Parameters:
paintSequence- the fill paint sequence.outlinePaintSequence- the outline paint sequence.strokeSequence- the stroke sequence.outlineStrokeSequence- the outline stroke sequence.shapeSequence- the shape sequence.
-
DefaultDrawingSupplier
public DefaultDrawingSupplier(java.awt.Paint[] paintSequence, java.awt.Paint[] fillPaintSequence, java.awt.Paint[] outlinePaintSequence, java.awt.Stroke[] strokeSequence, java.awt.Stroke[] outlineStrokeSequence, java.awt.Shape[] shapeSequence)Creates a new supplier.- Parameters:
paintSequence- the paint sequence.fillPaintSequence- the fill paint sequence.outlinePaintSequence- the outline paint sequence.strokeSequence- the stroke sequence.outlineStrokeSequence- the outline stroke sequence.shapeSequence- the shape sequence.
-
-
Method Detail
-
getNextPaint
public java.awt.Paint getNextPaint()
Returns the next paint in the sequence.- Specified by:
getNextPaintin interfaceDrawingSupplier- Returns:
- The paint.
-
getNextOutlinePaint
public java.awt.Paint getNextOutlinePaint()
Returns the next outline paint in the sequence.- Specified by:
getNextOutlinePaintin interfaceDrawingSupplier- Returns:
- The paint.
-
getNextFillPaint
public java.awt.Paint getNextFillPaint()
Returns the next fill paint in the sequence.- Specified by:
getNextFillPaintin interfaceDrawingSupplier- Returns:
- The paint.
-
getNextStroke
public java.awt.Stroke getNextStroke()
Returns the next stroke in the sequence.- Specified by:
getNextStrokein interfaceDrawingSupplier- Returns:
- The stroke.
-
getNextOutlineStroke
public java.awt.Stroke getNextOutlineStroke()
Returns the next outline stroke in the sequence.- Specified by:
getNextOutlineStrokein interfaceDrawingSupplier- Returns:
- The stroke.
-
getNextShape
public java.awt.Shape getNextShape()
Returns the next shape in the sequence.- Specified by:
getNextShapein interfaceDrawingSupplier- Returns:
- The shape.
-
createStandardSeriesShapes
public static java.awt.Shape[] createStandardSeriesShapes()
Creates an array of standard shapes to display for the items in series on charts.- Returns:
- The array of shapes.
-
equals
public boolean equals(java.lang.Object obj)
Tests this object for equality with another object.- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- the object (nullpermitted).- Returns:
- A boolean.
-
equalShapes
private boolean equalShapes(java.awt.Shape[] s1, java.awt.Shape[] s2)A utility method for testing the equality of two arrays of shapes.- Parameters:
s1- the first array (nullpermitted).s2- the second array (nullpermitted).- Returns:
- A boolean.
-
writeObject
private void writeObject(java.io.ObjectOutputStream stream) throws java.io.IOExceptionHandles serialization.- Parameters:
stream- the output stream.- Throws:
java.io.IOException- if there is an I/O problem.
-
readObject
private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, java.lang.ClassNotFoundExceptionRestores a serialized object.- Parameters:
stream- the input stream.- Throws:
java.io.IOException- if there is an I/O problem.java.lang.ClassNotFoundException- if there is a problem loading a class.
-
intArray
private static int[] intArray(double a, double b, double c)Helper method to avoid lots of explicit casts in getShape(). Returns an array containing the provided doubles cast to ints.- Parameters:
a- xb- yc- z- Returns:
- int[3] with converted params.
-
intArray
private static int[] intArray(double a, double b, double c, double d)Helper method to avoid lots of explicit casts in getShape(). Returns an array containing the provided doubles cast to ints.- Parameters:
a- xb- yc- zd- t- Returns:
- int[4] with converted params.
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionReturns a clone.- Specified by:
clonein interfacePublicCloneable- Overrides:
clonein classjava.lang.Object- Returns:
- A clone.
- Throws:
java.lang.CloneNotSupportedException- if a component of the supplier does not support cloning.
-
-