public class SurveyScaleExpression extends AbstractExpression
SurveyScale
instance that will present those values, and returns that instance as the expression result. The
fields used by the expression are defined using properties named '0', '1', ... 'N', which need to be specified after
the expression is created. These fields should contain Number
instances.The SurveyScale
class
implements the Drawable interface, so it can be displayed using a
ContentFieldType
.Constructor and Description |
---|
SurveyScaleExpression() |
SurveyScaleExpression(int lowest,
int highest)
Creates a new expression.
|
SurveyScaleExpression(int lowest,
int highest,
String lowerBoundsField,
String upperBoundsField,
Shape shape)
Creates a new expression.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Clones the expression.
|
SurveyScaleShapeType |
getDefaultShape() |
String[] |
getField() |
String |
getField(int idx) |
Color |
getFillPaint() |
boolean[] |
getFillShapes() |
boolean |
getFillShapes(int index) |
int |
getFillShapesCount() |
int |
getHighest() |
double |
getLowerMargin() |
int |
getLowest() |
BasicStroke |
getOutlineStroke() |
Shape |
getOverrideShape()
Returns the override shape.
|
Color |
getRangeColor() |
String |
getRangeLowerBoundField()
Returns the name of the field containing the lower bound of the range that is to be highlighted on the scale.
|
Paint |
getRangePaint()
Deprecated.
|
String |
getRangeUpperBoundField()
Returns the name of the field containing the upper bound of the range that is to be highlighted on the scale.
|
Font |
getScaleValueFont() |
Color |
getScaleValuePaint() |
SurveyScaleShapeType[] |
getShapes() |
SurveyScaleShapeType |
getShapes(int index) |
int |
getShapesCount() |
Color |
getTickMarkPaint() |
double |
getUpperMargin() |
Object |
getValue()
Returns a
SurveyScale instance that is set up to display the values in the current row. |
boolean |
isAutoConfigure() |
boolean |
isDrawScaleValues() |
boolean |
isDrawTickMarks() |
boolean |
isOverrideShapeFilled() |
void |
setAutoConfigure(boolean autoConfigure) |
void |
setDefaultShape(SurveyScaleShapeType defaultShape) |
void |
setDrawScaleValues(boolean drawScaleValues) |
void |
setDrawTickMarks(boolean drawTickMarks) |
void |
setField(int index,
String field) |
void |
setField(String[] fields) |
void |
setFillPaint(Color fillPaint) |
void |
setFillShapes(boolean[] fields) |
void |
setFillShapes(int index,
boolean fill) |
void |
setHighest(int highest) |
void |
setLowerMargin(double lowerMargin) |
void |
setLowest(int lowest) |
void |
setOutlineStroke(BasicStroke outlineStroke) |
void |
setOverrideShape(Shape shape)
Sets the override shape.
|
void |
setOverrideShapeFilled(boolean b)
Sets a flag that controls whether the override shape is filled or not.
|
void |
setRangeColor(Color rangeColor) |
void |
setRangeLowerBoundField(String field)
Sets the name of the field containing the lower bound of the range that is to be highlighted on the scale.
|
void |
setRangePaint(Paint rangePaint)
Deprecated.
|
void |
setRangeUpperBoundField(String field)
Sets the name of the field containing the upper bound of the range that is to be highlighted on the scale.
|
void |
setScaleValueFont(Font scaleValueFont) |
void |
setScaleValuePaint(Color scaleValuePaint) |
void |
setShapes(int index,
SurveyScaleShapeType fill) |
void |
setShapes(SurveyScaleShapeType[] fields) |
void |
setTickMarkPaint(Color tickMarkPaint) |
void |
setUpperMargin(double upperMargin) |
getDataRow, getDependencyLevel, getInstance, getName, getReportConfiguration, getResourceBundleFactory, getRuntime, isActive, isDeepTraversing, isPreserve, setActive, setDependencyLevel, setName, setPreserve, setRuntime
public SurveyScaleExpression()
public SurveyScaleExpression(int lowest, int highest)
lowest
- the lowest value on the response scale.highest
- the highest value on the response scale.public SurveyScaleExpression(int lowest, int highest, String lowerBoundsField, String upperBoundsField, Shape shape)
lowest
- the lowest value on the response scale.highest
- the highest value on the response scale.lowerBoundsField
- the name of the field containing the lower bound of the highlighted range (null
permitted).upperBoundsField
- the name of the field containing the upper bound of the highlighted range (null
permitted).shape
- a shape that will be used to override the shape displayed for the first series (null
permitted).public SurveyScaleShapeType getDefaultShape()
public void setDefaultShape(SurveyScaleShapeType defaultShape)
public void setFillShapes(int index, boolean fill)
public boolean getFillShapes(int index)
public int getFillShapesCount()
public boolean[] getFillShapes()
public void setFillShapes(boolean[] fields)
public void setShapes(int index, SurveyScaleShapeType fill)
public SurveyScaleShapeType getShapes(int index)
public int getShapesCount()
public SurveyScaleShapeType[] getShapes()
public void setShapes(SurveyScaleShapeType[] fields)
public boolean isAutoConfigure()
public void setAutoConfigure(boolean autoConfigure)
public String getRangeLowerBoundField()
null
).public void setRangeLowerBoundField(String field)
null
if you have no range to highlight.field
- the field name (null
permitted).public String getRangeUpperBoundField()
null
).public void setRangeUpperBoundField(String field)
null
if you have no range to highlight.field
- the field name (null
permitted).public Shape getOverrideShape()
null
).public void setOverrideShape(Shape shape)
SurveyScale
is created with a set of default shapes, this method allows you to
replace the *first* shape if you need to (leave it as null
otherwise).shape
- the shape (null
permitted).public boolean isOverrideShapeFilled()
public void setOverrideShapeFilled(boolean b)
b
- the flag.public int getLowest()
public void setLowest(int lowest)
public int getHighest()
public void setHighest(int highest)
public Font getScaleValueFont()
public void setScaleValueFont(Font scaleValueFont)
public Color getScaleValuePaint()
public void setScaleValuePaint(Color scaleValuePaint)
public Color getRangeColor()
public void setRangeColor(Color rangeColor)
public Color getFillPaint()
public void setFillPaint(Color fillPaint)
public Color getTickMarkPaint()
public void setTickMarkPaint(Color tickMarkPaint)
public double getUpperMargin()
public void setUpperMargin(double upperMargin)
public double getLowerMargin()
public void setLowerMargin(double lowerMargin)
public boolean isDrawTickMarks()
public void setDrawTickMarks(boolean drawTickMarks)
public boolean isDrawScaleValues()
public void setDrawScaleValues(boolean drawScaleValues)
public BasicStroke getOutlineStroke()
public void setOutlineStroke(BasicStroke outlineStroke)
public Object getValue()
SurveyScale
instance that is set up to display the values in the current row.SurveyScale
instance.public Object clone() throws CloneNotSupportedException
clone
in interface Expression
clone
in class AbstractExpression
CloneNotSupportedException
- this should never happen.public String[] getField()
public void setField(String[] fields)
public String getField(int idx)
public void setField(int index, String field)
@Deprecated public Paint getRangePaint()
@Deprecated public void setRangePaint(Paint rangePaint)