public class CompassPlot extends Plot implements java.lang.Cloneable, java.io.Serializable
ValueDataset.| Modifier and Type | Field and Description |
|---|---|
private java.awt.geom.Area |
a1
A working area.
|
private java.awt.geom.Area |
a2
A working area.
|
private java.awt.geom.Ellipse2D |
circle1
A working shape.
|
private java.awt.geom.Ellipse2D |
circle2
A working shape.
|
private java.awt.Font |
compassFont
The compass font.
|
private ValueDataset[] |
datasets
An array of value datasets.
|
static java.awt.Font |
DEFAULT_LABEL_FONT
The default label font.
|
private boolean |
drawBorder
A flag that controls whether or not a border is drawn.
|
private java.awt.Font |
labelFont
The label font.
|
private int |
labelType
The label type (NO_LABELS, VALUE_LABELS).
|
protected static java.util.ResourceBundle |
localizationResources
The resourceBundle for the localization.
|
static int |
NO_LABELS
A constant for the label type.
|
private java.awt.geom.Rectangle2D |
rect1
A working shape.
|
protected double |
revolutionDistance
The count to complete one revolution.
|
private java.awt.Paint |
roseCenterPaint
The rose center paint.
|
private java.awt.Paint |
roseHighlightPaint
The rose highlight paint.
|
private java.awt.Paint |
rosePaint
The rose paint.
|
private static long |
serialVersionUID
For serialization.
|
private MeterNeedle[] |
seriesNeedle
An array of needles.
|
static int |
VALUE_LABELS
A constant for the label type.
|
DEFAULT_BACKGROUND_ALPHA, DEFAULT_BACKGROUND_PAINT, DEFAULT_FOREGROUND_ALPHA, DEFAULT_INSETS, DEFAULT_LEGEND_ITEM_BOX, DEFAULT_LEGEND_ITEM_CIRCLE, DEFAULT_OUTLINE_PAINT, DEFAULT_OUTLINE_STROKE, MINIMUM_HEIGHT_TO_DRAW, MINIMUM_WIDTH_TO_DRAW, ZERO| Constructor and Description |
|---|
CompassPlot()
Default constructor.
|
CompassPlot(ValueDataset dataset)
Constructs a new compass plot.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addDataset(ValueDataset dataset)
Adds a dataset to the compass.
|
void |
addDataset(ValueDataset dataset,
MeterNeedle needle)
Adds a dataset to the compass.
|
java.lang.Object |
clone()
Returns a clone of the plot.
|
void |
draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D area,
java.awt.geom.Point2D anchor,
PlotState parentState,
PlotRenderingInfo info)
Draws the plot on a Java 2D graphics device (such as the screen or a
printer).
|
boolean |
equals(java.lang.Object obj)
Tests an object for equality with this plot.
|
protected java.awt.Font |
getCompassFont(int radius)
Returns the font for the compass, adjusted for the size of the plot.
|
ValueDataset[] |
getDatasets()
Returns an array of dataset references for the plot.
|
boolean |
getDrawBorder()
Returns a flag that controls whether or not a border is drawn.
|
java.awt.Font |
getLabelFont()
Returns the label font.
|
int |
getLabelType()
Returns the label type.
|
LegendItemCollection |
getLegendItems()
Returns the legend items for the plot.
|
java.lang.String |
getPlotType()
Returns a short string describing the type of plot.
|
double |
getRevolutionDistance()
Gets the count to complete one revolution.
|
java.awt.Paint |
getRoseCenterPaint()
Returns the paint used to fill the inner background area of the
compass.
|
java.awt.Paint |
getRoseHighlightPaint()
Returns the paint used to draw the circles, symbols and labels on the
compass.
|
java.awt.Paint |
getRosePaint()
Returns the paint used to fill the outer circle of the compass.
|
private void |
readObject(java.io.ObjectInputStream stream)
Provides serialization support.
|
void |
setDrawBorder(boolean status)
Sets a flag that controls whether or not a border is drawn.
|
void |
setLabelFont(java.awt.Font font)
Sets the label font and sends a
PlotChangeEvent to all
registered listeners. |
void |
setLabelType(int type)
Sets the label type (either
NO_LABELS or VALUE_LABELS. |
void |
setRevolutionDistance(double size)
Sets the count to complete one revolution.
|
void |
setRoseCenterPaint(java.awt.Paint paint)
Sets the paint used to fill the inner background area of the compass,
and sends a
PlotChangeEvent to all registered listeners. |
void |
setRoseHighlightPaint(java.awt.Paint paint)
Sets the paint used to draw the circles, symbols and labels of the
compass, and sends a
PlotChangeEvent to all registered listeners. |
void |
setRosePaint(java.awt.Paint paint)
Sets the paint used to fill the outer circle of the compass,
and sends a
PlotChangeEvent to all registered listeners. |
void |
setSeriesNeedle(int type)
Sets the needle type.
|
void |
setSeriesNeedle(int index,
int type)
Sets the needle for a series.
|
void |
setSeriesNeedle(int index,
MeterNeedle needle)
Sets the needle for a series and sends a
PlotChangeEvent to all
registered listeners. |
void |
setSeriesOutlinePaint(int series,
java.awt.Paint p)
Sets the series outline paint.
|
void |
setSeriesOutlineStroke(int series,
java.awt.Stroke stroke)
Sets the series outline stroke.
|
void |
setSeriesPaint(int series,
java.awt.Paint paint)
Sets the series paint.
|
private void |
writeObject(java.io.ObjectOutputStream stream)
Provides serialization support.
|
void |
zoom(double percent)
No zooming is implemented for compass plot, so this method is empty.
|
addChangeListener, annotationChanged, axisChanged, createAndAddEntity, datasetChanged, drawBackground, drawBackgroundImage, drawNoDataMessage, drawOutline, fillBackground, fillBackground, fireChangeEvent, getBackgroundAlpha, getBackgroundImage, getBackgroundImageAlignment, getBackgroundImageAlpha, getBackgroundPaint, getDatasetGroup, getDrawingSupplier, getForegroundAlpha, getInsets, getNoDataMessage, getNoDataMessageFont, getNoDataMessagePaint, getOutlinePaint, getOutlineStroke, getParent, getRectX, getRectY, getRootPlot, handleClick, isNotify, isOutlineVisible, isSubplot, markerChanged, notifyListeners, removeChangeListener, resolveDomainAxisLocation, resolveRangeAxisLocation, setBackgroundAlpha, setBackgroundImage, setBackgroundImageAlignment, setBackgroundImageAlpha, setBackgroundPaint, setDatasetGroup, setDrawingSupplier, setDrawingSupplier, setForegroundAlpha, setInsets, setInsets, setNoDataMessage, setNoDataMessageFont, setNoDataMessagePaint, setNotify, setOutlinePaint, setOutlineStroke, setOutlineVisible, setParentprivate static final long serialVersionUID
public static final java.awt.Font DEFAULT_LABEL_FONT
public static final int NO_LABELS
public static final int VALUE_LABELS
private int labelType
private java.awt.Font labelFont
private boolean drawBorder
private transient java.awt.Paint roseHighlightPaint
private transient java.awt.Paint rosePaint
private transient java.awt.Paint roseCenterPaint
private java.awt.Font compassFont
private transient java.awt.geom.Ellipse2D circle1
private transient java.awt.geom.Ellipse2D circle2
private transient java.awt.geom.Area a1
private transient java.awt.geom.Area a2
private transient java.awt.geom.Rectangle2D rect1
private ValueDataset[] datasets
private MeterNeedle[] seriesNeedle
protected static java.util.ResourceBundle localizationResources
protected double revolutionDistance
public CompassPlot()
public CompassPlot(ValueDataset dataset)
dataset - the dataset for the plot (null permitted).public int getLabelType()
NO_LABELS
and VALUE_LABELS.setLabelType(int)public void setLabelType(int type)
NO_LABELS or VALUE_LABELS.type - the type.getLabelType()public java.awt.Font getLabelFont()
setLabelFont(Font)public void setLabelFont(java.awt.Font font)
PlotChangeEvent to all
registered listeners.font - the new label font.getLabelFont()public java.awt.Paint getRosePaint()
null).setRosePaint(Paint)public void setRosePaint(java.awt.Paint paint)
PlotChangeEvent to all registered listeners.paint - the paint (null not permitted).getRosePaint()public java.awt.Paint getRoseCenterPaint()
null).setRoseCenterPaint(Paint)public void setRoseCenterPaint(java.awt.Paint paint)
PlotChangeEvent to all registered listeners.paint - the paint (null not permitted).getRoseCenterPaint()public java.awt.Paint getRoseHighlightPaint()
null).setRoseHighlightPaint(Paint)public void setRoseHighlightPaint(java.awt.Paint paint)
PlotChangeEvent to all registered listeners.paint - the paint (null not permitted).getRoseHighlightPaint()public boolean getDrawBorder()
setDrawBorder(boolean)public void setDrawBorder(boolean status)
status - the flag status.getDrawBorder()public void setSeriesPaint(int series,
java.awt.Paint paint)
series - the series index.paint - the paint.setSeriesOutlinePaint(int, Paint)public void setSeriesOutlinePaint(int series,
java.awt.Paint p)
series - the series index.p - the paint.setSeriesPaint(int, Paint)public void setSeriesOutlineStroke(int series,
java.awt.Stroke stroke)
series - the series index.stroke - the stroke.setSeriesOutlinePaint(int, Paint)public void setSeriesNeedle(int type)
type - the type.setSeriesNeedle(int, int)public void setSeriesNeedle(int index,
int type)
ArrowNeedle;LineNeedle;LongNeedle;PinNeedle;PlumNeedle;PointerNeedle;ShipNeedle;WindNeedle;ArrowNeedle;MiddlePinNeedle;index - the series index.type - the needle type.setSeriesNeedle(int)public void setSeriesNeedle(int index,
MeterNeedle needle)
PlotChangeEvent to all
registered listeners.index - the series index.needle - the needle.public ValueDataset[] getDatasets()
addDataset(ValueDataset)public void addDataset(ValueDataset dataset)
dataset - the new dataset (null ignored).addDataset(ValueDataset, MeterNeedle)public void addDataset(ValueDataset dataset, MeterNeedle needle)
dataset - the new dataset (null ignored).needle - the needle (null permitted).public void draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D area,
java.awt.geom.Point2D anchor,
PlotState parentState,
PlotRenderingInfo info)
public java.lang.String getPlotType()
getPlotType in class Plotpublic LegendItemCollection getLegendItems()
getLegendItems in interface LegendItemSourcegetLegendItems in class Plotpublic void zoom(double percent)
protected java.awt.Font getCompassFont(int radius)
radius - the radius.public boolean equals(java.lang.Object obj)
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
public void setRevolutionDistance(double size)
size - the count to complete one revolution.getRevolutionDistance()public double getRevolutionDistance()
setRevolutionDistance(double)private void writeObject(java.io.ObjectOutputStream stream)
throws java.io.IOException
stream - the output stream.java.io.IOException - if there is an I/O error.private void readObject(java.io.ObjectInputStream stream)
throws java.io.IOException,
java.lang.ClassNotFoundException
stream - the input stream.java.io.IOException - if there is an I/O error.java.lang.ClassNotFoundException - if there is a classpath problem.