|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ijchart.xychart.render.AbstractRender
com.ijchart.xychart.render.noaxis.AbstractNoAxisRender
com.ijchart.xychart.render.noaxis.MeterRender
public class MeterRender
Title: IJChart
Description: a chart library for the Java(tm) platform.
Draw meter chart shapes.Copyright: Copyright (c) 2013
Company:
Field Summary | |
---|---|
static float |
DEFAULT_BORDER_SIZE
The default border size. |
static float |
DEFAULT_CIRCLE_SIZE
The default circle size. |
static double |
DEFAULT_GAP_SIZE
The default gap size. |
static java.awt.Font |
DEFAULT_LABEL_FONT
The default label font. |
static int |
DEFAULT_METER_ANGLE
The default meter angle. |
static MeterShapeType |
DEFAULT_METER_SHAPE_TYPE
The default dial shape type. |
static java.awt.Paint |
DEFAULT_NEEDLE_PAINT
The default needle paint. |
static java.lang.String |
DEFAULT_NO_NEEDLE_VALUE_LABEL
The needle label when needle value is null. |
static NumberRange |
DEFAULT_RANGE
The default overall range of data values on the dial. |
static java.awt.Paint |
DEFAULT_TICK_LABEL_PAINT
The tick label paint. |
static boolean |
DEFAULT_TICK_LABEL_VISIBLE
A flag that controls whether or not the tick labels are visible. |
static java.awt.Paint |
DEFAULT_TICK_PAINT
The default paint used to draw the ticks. |
static double |
DEFAULT_TICK_SIZE
The default tick size. |
static java.awt.Stroke |
DEFAULT_TICK_STROKE
The default stroke used to draw ticks. |
static java.lang.String |
DEFAULT_UNITS
The default units displayed on the dial. |
static java.awt.Font |
DEFAULT_VALUE_FONT
The default value font. |
static java.awt.Paint |
DEFAULT_VALUE_PAINT
The default value paint. |
Constructor Summary | |
---|---|
MeterRender(SingleRowDataset dataset)
constructor. |
|
MeterRender(SingleRowDataset dataset,
double needleValue)
constructor. |
Method Summary | |
---|---|
protected double |
calculateArcStartTickAngle(double start,
double end)
Calculate the first tick angle of arc. |
protected java.lang.Number[] |
calculateArcTickLables(double start,
double end,
int index)
Calculate the tick labels of arc. |
protected void |
calculateRange()
Calculate the range of data values on the dial. |
java.lang.Object |
clone()
Creates and returns a copy of this object. |
protected IChartShape |
createItemShapeOnly(java.awt.geom.Rectangle2D rect,
java.lang.String text,
java.lang.Object appendParam)
Create a shape with no attribute specified. |
void |
drawAllItems(java.awt.geom.Rectangle2D dataArea,
RenderShapeCollection renderShapes,
float alpha)
Draws all data items. |
void |
drawBackground(java.awt.geom.Rectangle2D dataArea,
ChartOrientation orientation,
RenderShapeCollection renderShapes)
Draws a background for the data area. |
boolean |
equals(java.lang.Object obj)
Tests this instance for equality with an arbitrary object. |
double |
getBorderSize()
Returns the border size. |
float |
getCircleSize()
Returns the circle size. |
double |
getGapSize()
Returns the gap size. |
double |
getMeterAngle()
Returns the dial extent (measured in degrees). |
MeterShapeType |
getMeterShapeType()
Returns the dial shape type. |
java.awt.Paint |
getNeedlePaint()
Returns the paint for the needle. |
java.lang.String |
getNoNeedleValueLabel()
Returns the needle label when needle value is null. |
java.awt.Font |
getTickLabelFont()
Returns the tick label font. |
java.text.NumberFormat |
getTickLabelFormat()
Returns the tick label format. |
java.awt.Paint |
getTickLabelPaint()
Returns the tick label paint. |
java.awt.Paint |
getTickPaint()
Returns the paint used to draw the ticks. |
double |
getTickSize()
Returns the tick size. |
java.awt.Stroke |
getTickStroke()
Returns the stroke used to draw ticks. |
java.lang.String |
getUnits()
Returns the units displayed on the dial. |
double |
getValue()
Returns the needle value. |
java.awt.Font |
getValueFont()
Returns the font for the value displayed in the center of the dial. |
java.awt.Paint |
getValuePaint()
Returns the paint for the value displayed in the center of the dial. |
int |
hashCode()
Returns a hash code value for the object. |
boolean |
isTickLabelVisible()
Sets the flag that controls whether or not the tick labels are visible. |
void |
setBorderSize(double size)
Sets the border size and sends a RenderChangeEvent to all registered listeners. |
void |
setCircleSize(float size)
Sets the circle size and sends a RenderChangeEvent to all registered listeners. |
void |
setGapSize(double size)
Sets the gap size and sends a RenderChangeEvent to all registered listeners. |
void |
setMeterAngle(double angle)
Sets the dial extent (measured in degrees) and sends a RenderChangeEvent to all registered listeners. |
void |
setMeterShapeType(MeterShapeType shapeType)
Sets the dial shape type and sends a RenderChangeEvent to all registered listeners. |
void |
setNeedlePaint(java.awt.Paint paint)
Sets the paint for the needle and sends a RenderChangeEvent to all registered listeners. |
void |
setNoNeedleValueLabel(java.lang.String label)
Sets the needle label when needle value is null and sends a RenderChangeEvent to all registered listeners. |
void |
setTickLabelFont(java.awt.Font font)
Sets the tick label font and sends a RenderChangeEvent to all registered listeners. |
void |
setTickLabelFormat(java.text.NumberFormat format)
Sets the tick label format and sends a RenderChangeEvent to all registered listeners. |
void |
setTickLabelPaint(java.awt.Paint paint)
Sets the tick label paint and sends a RenderChangeEvent to all registered listeners. |
void |
setTickLabelVisible(boolean flag)
Sets the flag that controls whether or not the tick labels are visible and sends a RenderChangeEvent to all registered listeners. |
void |
setTickPaint(java.awt.Paint paint)
Sets the paint used to draw the ticks and sends a RenderChangeEvent to all registered listeners. |
void |
setTickSize(double tickSize)
Sets the tick size and sends a RenderChangeEvent to all registered listeners. |
void |
setTickStroke(java.awt.Stroke stroke)
Sets the stroke used to draw ticks,and sends a ChartShapeChangeEvent to all registered listeners. |
void |
setUnits(java.lang.String units)
Sets the units displayed on the dial and sends a RenderChangeEvent to all registered listeners. |
void |
setValue(double value)
Sets the needle value and sends a RenderChangeEvent to all registered listeners. |
void |
setValueFont(java.awt.Font font)
Sets the font for the value displayed in the center of the dial and sends a RenderChangeEvent to all registered listeners. |
void |
setValuePaint(java.awt.Paint paint)
Sets the paint for the value displayed in the center of the dial and sends a RenderChangeEvent to all registered listeners. |
java.lang.String |
toString()
Returns a string representation of the object. |
double |
valueToAngle(double value)
Translates a data value to an angle on the dial. |
Methods inherited from class com.ijchart.xychart.render.noaxis.AbstractNoAxisRender |
---|
createItemShape |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final MeterShapeType DEFAULT_METER_SHAPE_TYPE
public static final java.awt.Paint DEFAULT_NEEDLE_PAINT
public static final boolean DEFAULT_TICK_LABEL_VISIBLE
public static final java.awt.Font DEFAULT_VALUE_FONT
public static final java.awt.Paint DEFAULT_VALUE_PAINT
public static final int DEFAULT_METER_ANGLE
public static final NumberRange DEFAULT_RANGE
public static final double DEFAULT_TICK_SIZE
public static final java.awt.Paint DEFAULT_TICK_PAINT
public static final java.awt.Stroke DEFAULT_TICK_STROKE
public static final java.lang.String DEFAULT_UNITS
public static final float DEFAULT_BORDER_SIZE
public static final float DEFAULT_CIRCLE_SIZE
public static final java.awt.Font DEFAULT_LABEL_FONT
public static final java.awt.Paint DEFAULT_TICK_LABEL_PAINT
public static final double DEFAULT_GAP_SIZE
public static final java.lang.String DEFAULT_NO_NEEDLE_VALUE_LABEL
Constructor Detail |
---|
public MeterRender(SingleRowDataset dataset)
dataset
- SingleRowDataset
The dataset (null not permitted).public MeterRender(SingleRowDataset dataset, double needleValue)
dataset
- SingleRowDataset
The dataset (null not permitted).needleValue
-
The needle value.Method Detail |
---|
public MeterShapeType getMeterShapeType()
public void setMeterShapeType(MeterShapeType shapeType)
RenderChangeEvent
to all registered listeners.
shapeType
- MeterShapeType
The dial shape type (null not permitted).public double getMeterAngle()
public void setMeterAngle(double angle)
RenderChangeEvent
to all registered listeners.
angle
- double
The dial extent.public double getTickSize()
public void setTickSize(double tickSize)
RenderChangeEvent
to all registered listeners.
tickSize
- double
The tick size.public java.awt.Paint getTickPaint()
public void setTickPaint(java.awt.Paint paint)
RenderChangeEvent
to all registered listeners.
paint
- Paint
The paint (null not permitted).public java.awt.Stroke getTickStroke()
public void setTickStroke(java.awt.Stroke stroke)
ChartShapeChangeEvent
to all registered listeners.
stroke
- Stroke
The stroke (null not permitted).public java.lang.String getUnits()
public void setUnits(java.lang.String units)
RenderChangeEvent
to all registered listeners.
units
- String
The unit name (null permitted).public double getBorderSize()
public void setBorderSize(double size)
RenderChangeEvent
to all registered listeners.
size
- double
The border size.public float getCircleSize()
public void setCircleSize(float size)
RenderChangeEvent
to all registered listeners.
size
- float
The size.public java.awt.Font getValueFont()
public void setValueFont(java.awt.Font font)
RenderChangeEvent
to all registered listeners.
font
- Font
The font (null not permitted).public java.awt.Paint getValuePaint()
public void setValuePaint(java.awt.Paint paint)
RenderChangeEvent
to all registered listeners.
paint
- Paint
The paint (null not permitted).public double getValue()
public void setValue(double value)
RenderChangeEvent
to all registered listeners.
value
- double
The needle value.public java.awt.Paint getNeedlePaint()
public void setNeedlePaint(java.awt.Paint paint)
RenderChangeEvent
to all registered listeners.
paint
- Paint
The paint (null not permitted).public java.lang.String getNoNeedleValueLabel()
public void setNoNeedleValueLabel(java.lang.String label)
RenderChangeEvent
to all registered listeners.
label
- String
The label.public boolean isTickLabelVisible()
public void setTickLabelVisible(boolean flag)
RenderChangeEvent
to all registered listeners.
flag
- boolean
A boolean.public java.awt.Font getTickLabelFont()
public void setTickLabelFont(java.awt.Font font)
RenderChangeEvent
to all registered listeners.
font
- Font
The font (null not permitted).public java.awt.Paint getTickLabelPaint()
public void setTickLabelPaint(java.awt.Paint paint)
RenderChangeEvent
to all registered listeners.
paint
- Paint
The paint (null not permitted).public java.text.NumberFormat getTickLabelFormat()
public void setTickLabelFormat(java.text.NumberFormat format)
RenderChangeEvent
to all registered listeners.
format
- NumberFormat
The number format object (null not permitted).public double getGapSize()
public void setGapSize(double size)
RenderChangeEvent
to all registered listeners.
size
- double
The gap size.public void drawAllItems(java.awt.geom.Rectangle2D dataArea, RenderShapeCollection renderShapes, float alpha)
drawAllItems
in class AbstractNoAxisRender
dataArea
- Rectangle2D
The chart data area (null not permitted).renderShapes
- RenderShapeCollection
Collects information about the render (null not permitted).alpha
- float
The alpha transparency (in the range 0.0f to 1.0f, where 0.0f is fully transparent,
and 1.0f is fully opaque).protected double calculateArcStartTickAngle(double start, double end)
start
- double
The start value.end
- double
The end value.
protected java.lang.Number[] calculateArcTickLables(double start, double end, int index)
start
- double
The start value.end
- double
The end value.index
- int
The index of arc.
protected IChartShape createItemShapeOnly(java.awt.geom.Rectangle2D rect, java.lang.String text, java.lang.Object appendParam)
createItemShapeOnly
in class AbstractRender
rect
- Rectangle2D
The bar rectangle (null not permitted).text
- String
The text (null permitted).appendParam
- Object
The append parameter,used for special propose (null permitted).
protected void calculateRange()
public double valueToAngle(double value)
value
-
The value.
public void drawBackground(java.awt.geom.Rectangle2D dataArea, ChartOrientation orientation, RenderShapeCollection renderShapes)
drawBackground
in interface IRender
drawBackground
in class AbstractRender
dataArea
- Rectangle2D
The chart data area (null not permitted).orientation
- ChartOrientation
The chart draw orientation (null not permitted).renderShapes
- RenderShapeCollection
Collects information about the render (null not permitted).public boolean equals(java.lang.Object obj)
equals
in class AbstractNoAxisRender
obj
- the object (null permitted).
public int hashCode()
hashCode
in class AbstractNoAxisRender
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class AbstractNoAxisRender
java.lang.CloneNotSupportedException
- if the object's class does not
support the Cloneable interface. Subclasses
that override the clone method can also
throw this exception to indicate that an instance cannot
be cloned.public java.lang.String toString()
toString
in class AbstractNoAxisRender
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |