|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jfree.report.modules.misc.survey.SurveyScale
public class SurveyScale
Draws a survey scale. By implementing the Drawable interface, instances can be displayed within a report using the DrawableElement class.
Constructor Summary | |
---|---|
SurveyScale()
Creates a new default instance. |
|
SurveyScale(int lowest,
int highest,
java.lang.Number[] values)
Creates a new instance. |
Method Summary | |
---|---|
static java.awt.Shape |
createDiamond(float s)
Creates a diamond shape. |
static java.awt.Shape |
createDownTriangle(float s)
Creates a triangle shape that points downwards. |
protected java.util.ArrayList |
createShapeList()
Creates the shape list used when drawing the scale. |
static java.awt.Shape |
createUpTriangle(float s)
Creates a triangle shape that points upwards. |
void |
draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D area)
Draws the survey scale. |
protected void |
drawBorder(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D area)
|
protected void |
drawRangeArea(java.awt.geom.Rectangle2D area,
java.awt.Graphics2D g2)
|
protected void |
drawScaleValues(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D area)
|
protected void |
drawTickMarks(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D area)
|
protected void |
drawValues(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D area)
|
java.awt.Paint |
getBorderPaint()
|
java.awt.Shape |
getDefaultShape()
Returns the default shape, which is used, if a shape for a certain value is not defined. |
java.awt.Paint |
getFillPaint()
|
int |
getHighest()
|
protected double |
getLowerBound()
|
double |
getLowerMargin()
|
int |
getLowest()
|
java.awt.Stroke |
getOutlineStroke()
|
protected int |
getRange()
|
java.lang.Number |
getRangeLowerBound()
Returns the lower bound of the highlighted range. |
java.awt.Paint |
getRangePaint()
Returns the paint used to highlight the range. |
java.lang.Number |
getRangeUpperBound()
Returns the upper bound of the highlighted range. |
java.awt.Font |
getScaleValueFont()
Returns the font used to display the scale values. |
java.awt.Paint |
getScaleValuePaint()
Returns the color used to draw the scale values (if they are visible). |
java.awt.Shape |
getShape(int index)
Returns the shape used to indicate the value of a response. |
java.awt.Paint |
getTickMarkPaint()
|
protected double |
getUpperBound()
|
double |
getUpperMargin()
|
java.lang.Number[] |
getValues()
|
boolean |
isAutoConfigure()
|
boolean |
isDrawBorder()
Returns a flag that controls whether or not a border is drawn around the scale. |
boolean |
isDrawScaleValues()
Returns a flag that controls whether or not scale values are drawn. |
boolean |
isDrawTickMarks()
Returns the flag that controls whether the tick marks are drawn. |
boolean |
isShapeFilled(int index)
Returns a flag that controls whether the shape for a particular value should be filled. |
protected void |
recompute()
This method is called whenever lowest or highest has changed. |
void |
setAutoConfigure(boolean autoConfigure)
|
void |
setBorderPaint(java.awt.Paint borderPaint)
|
void |
setDefaultShape(java.awt.Shape defaultShape)
Redefines the default shape. |
void |
setDrawBorder(boolean flag)
Sets a flag that controls whether or not a border is drawn around the scale. |
void |
setDrawScaleValues(boolean flag)
Sets a flag that controls whether or not scale values are drawn. |
void |
setDrawTickMarks(boolean flag)
Sets the flag that controls whether the tick marks are drawn. |
void |
setFillPaint(java.awt.Paint fillPaint)
|
void |
setHighest(int highest)
|
protected void |
setLowerBound(double lowerBound)
|
void |
setLowerMargin(double lowerMargin)
|
void |
setLowest(int lowest)
|
void |
setOutlineStroke(java.awt.Stroke outlineStroke)
|
protected void |
setRange(int range)
|
void |
setRangeLowerBound(java.lang.Number bound)
Sets the lower bound for the range that is highlighted on the scale. |
void |
setRangePaint(java.awt.Paint paint)
Sets the paint used to highlight the range (if one is specified). |
void |
setRangeUpperBound(java.lang.Number bound)
Sets the upper bound for the range that is highlighted on the scale. |
void |
setScaleValueFont(java.awt.Font font)
Sets the font used to display the scale values. |
void |
setScaleValuePaint(java.awt.Paint paint)
Sets the color used to draw the scale values. |
void |
setShape(int index,
java.awt.Shape shape)
Sets the shape used to mark a particular value in the dataset. |
void |
setShapeFilled(int index,
boolean fill)
Sets the flag that controls whether the shape for a particular value should be filled. |
void |
setTickMarkPaint(java.awt.Paint tickMarkPaint)
|
protected void |
setUpperBound(double upperBound)
|
void |
setUpperMargin(double upperMargin)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SurveyScale()
public SurveyScale(int lowest, int highest, java.lang.Number[] values)
lowest
- the lowest response value on the scale.highest
- the highest response value on the scale.values
- the values to display.Method Detail |
---|
public boolean isAutoConfigure()
public void setAutoConfigure(boolean autoConfigure)
public int getLowest()
public void setLowest(int lowest)
public int getHighest()
public void setHighest(int highest)
protected void recompute()
protected int getRange()
protected void setRange(int range)
protected double getLowerBound()
protected void setLowerBound(double lowerBound)
protected double getUpperBound()
protected void setUpperBound(double upperBound)
protected java.util.ArrayList createShapeList()
public static java.awt.Shape createDiamond(float s)
s
- the size factor (equal to half the height of the diamond).
public static java.awt.Shape createUpTriangle(float s)
s
- the size factor (equal to half the height of the triangle).
public static java.awt.Shape createDownTriangle(float s)
s
- the size factor (equal to half the height of the triangle).
public java.lang.Number getRangeLowerBound()
null
value indicates that no range is set for
highlighting.
null
).public void setRangeLowerBound(java.lang.Number bound)
bound
- the lower bound (null
permitted).public java.lang.Number getRangeUpperBound()
null
value indicates that no range is set for
highlighting.
null
).public void setRangeUpperBound(java.lang.Number bound)
bound
- the upper bound (null
permitted).public boolean isDrawBorder()
public void setDrawBorder(boolean flag)
flag
- the flag.public boolean isDrawTickMarks()
public void setDrawTickMarks(boolean flag)
flag
- a boolean.public boolean isDrawScaleValues()
public void setDrawScaleValues(boolean flag)
flag
- the flag.public java.awt.Font getScaleValueFont()
null
).public void setScaleValueFont(java.awt.Font font)
font
- the font (null
not permitted).public java.awt.Paint getScaleValuePaint()
null
).public void setScaleValuePaint(java.awt.Paint paint)
paint
- the paint (null
not permitted).public java.awt.Shape getShape(int index)
index
- the value index (zero-based).
public void setShape(int index, java.awt.Shape shape)
index
- the value index (zero-based).shape
- the shape (null
not permitted).public boolean isShapeFilled(int index)
index
- the value index (zero-based).
public void setShapeFilled(int index, boolean fill)
index
- the value index (zero-based).fill
- the flag.public java.awt.Paint getRangePaint()
Paint
object (never null
).public void setRangePaint(java.awt.Paint paint)
paint
- the paint (null
not permitted).public java.awt.Paint getBorderPaint()
public void setBorderPaint(java.awt.Paint borderPaint)
public java.awt.Shape getDefaultShape()
public void setDefaultShape(java.awt.Shape defaultShape)
defaultShape
- the default shape
java.lang.NullPointerException
- if the given shape is null.public java.awt.Paint getTickMarkPaint()
public void setTickMarkPaint(java.awt.Paint tickMarkPaint)
public java.lang.Number[] getValues()
public java.awt.Paint getFillPaint()
public void setFillPaint(java.awt.Paint fillPaint)
public java.awt.Stroke getOutlineStroke()
public void setOutlineStroke(java.awt.Stroke outlineStroke)
public double getUpperMargin()
public void setUpperMargin(double upperMargin)
public double getLowerMargin()
public void setLowerMargin(double lowerMargin)
public void draw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D area)
g2
- the graphics device.area
- the area.protected void drawValues(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D area)
protected void drawScaleValues(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D area)
protected void drawTickMarks(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D area)
protected void drawRangeArea(java.awt.geom.Rectangle2D area, java.awt.Graphics2D g2)
protected void drawBorder(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D area)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |