Class SurveyScaleExpression
- java.lang.Object
-
- org.pentaho.reporting.engine.classic.core.function.AbstractExpression
-
- org.pentaho.reporting.engine.classic.core.modules.misc.survey.SurveyScaleExpression
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Expression
public class SurveyScaleExpression extends AbstractExpression
An expression that takes values from one or more fields in the current row of the report, builds aSurveyScale
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 containNumber
instances.TheSurveyScale
class implements the Drawable interface, so it can be displayed using aContentFieldType
.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method 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 aSurveyScale
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)
-
Methods inherited from class org.pentaho.reporting.engine.classic.core.function.AbstractExpression
getDataRow, getDependencyLevel, getInstance, getName, getReportConfiguration, getResourceBundleFactory, getRuntime, isActive, isDeepTraversing, isPreserve, setActive, setDependencyLevel, setName, setPreserve, setRuntime
-
-
-
-
Constructor Detail
-
SurveyScaleExpression
public SurveyScaleExpression()
-
SurveyScaleExpression
public SurveyScaleExpression(int lowest, int highest)
Creates a new expression.- Parameters:
lowest
- the lowest value on the response scale.highest
- the highest value on the response scale.
-
SurveyScaleExpression
public SurveyScaleExpression(int lowest, int highest, String lowerBoundsField, String upperBoundsField, Shape shape)
Creates a new expression.- Parameters:
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).
-
-
Method Detail
-
getDefaultShape
public SurveyScaleShapeType getDefaultShape()
-
setDefaultShape
public void setDefaultShape(SurveyScaleShapeType defaultShape)
-
setFillShapes
public void setFillShapes(int index, boolean fill)
-
getFillShapes
public boolean getFillShapes(int index)
-
getFillShapesCount
public int getFillShapesCount()
-
getFillShapes
public boolean[] getFillShapes()
-
setFillShapes
public void setFillShapes(boolean[] fields)
-
setShapes
public void setShapes(int index, SurveyScaleShapeType fill)
-
getShapes
public SurveyScaleShapeType getShapes(int index)
-
getShapesCount
public int getShapesCount()
-
getShapes
public SurveyScaleShapeType[] getShapes()
-
setShapes
public void setShapes(SurveyScaleShapeType[] fields)
-
isAutoConfigure
public boolean isAutoConfigure()
-
setAutoConfigure
public void setAutoConfigure(boolean autoConfigure)
-
getRangeLowerBoundField
public String getRangeLowerBoundField()
Returns the name of the field containing the lower bound of the range that is to be highlighted on the scale.- Returns:
- A string (possibly
null
).
-
setRangeLowerBoundField
public 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. Set this tonull
if you have no range to highlight.- Parameters:
field
- the field name (null
permitted).
-
getRangeUpperBoundField
public String getRangeUpperBoundField()
Returns the name of the field containing the upper bound of the range that is to be highlighted on the scale.- Returns:
- A string (possibly
null
).
-
setRangeUpperBoundField
public 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. Set this tonull
if you have no range to highlight.- Parameters:
field
- the field name (null
permitted).
-
getOverrideShape
public Shape getOverrideShape()
Returns the override shape.- Returns:
- The override shape (possibly
null
).
-
setOverrideShape
public void setOverrideShape(Shape shape)
Sets the override shape. TheSurveyScale
is created with a set of default shapes, this method allows you to replace the *first* shape if you need to (leave it asnull
otherwise).- Parameters:
shape
- the shape (null
permitted).
-
isOverrideShapeFilled
public boolean isOverrideShapeFilled()
-
setOverrideShapeFilled
public void setOverrideShapeFilled(boolean b)
Sets a flag that controls whether the override shape is filled or not.- Parameters:
b
- the flag.
-
getLowest
public int getLowest()
-
setLowest
public void setLowest(int lowest)
-
getHighest
public int getHighest()
-
setHighest
public void setHighest(int highest)
-
getScaleValueFont
public Font getScaleValueFont()
-
setScaleValueFont
public void setScaleValueFont(Font scaleValueFont)
-
getScaleValuePaint
public Color getScaleValuePaint()
-
setScaleValuePaint
public void setScaleValuePaint(Color scaleValuePaint)
-
getRangeColor
public Color getRangeColor()
-
setRangeColor
public void setRangeColor(Color rangeColor)
-
getFillPaint
public Color getFillPaint()
-
setFillPaint
public void setFillPaint(Color fillPaint)
-
getTickMarkPaint
public Color getTickMarkPaint()
-
setTickMarkPaint
public void setTickMarkPaint(Color tickMarkPaint)
-
getUpperMargin
public double getUpperMargin()
-
setUpperMargin
public void setUpperMargin(double upperMargin)
-
getLowerMargin
public double getLowerMargin()
-
setLowerMargin
public void setLowerMargin(double lowerMargin)
-
isDrawTickMarks
public boolean isDrawTickMarks()
-
setDrawTickMarks
public void setDrawTickMarks(boolean drawTickMarks)
-
isDrawScaleValues
public boolean isDrawScaleValues()
-
setDrawScaleValues
public void setDrawScaleValues(boolean drawScaleValues)
-
getOutlineStroke
public BasicStroke getOutlineStroke()
-
setOutlineStroke
public void setOutlineStroke(BasicStroke outlineStroke)
-
getValue
public Object getValue()
Returns aSurveyScale
instance that is set up to display the values in the current row.- Returns:
- a
SurveyScale
instance.
-
clone
public Object clone() throws CloneNotSupportedException
Clones the expression.- Specified by:
clone
in interfaceExpression
- Overrides:
clone
in classAbstractExpression
- Returns:
- a copy of this expression.
- Throws:
CloneNotSupportedException
- this should never happen.
-
getField
public String[] getField()
-
setField
public void setField(String[] fields)
-
getField
public String getField(int idx)
-
setField
public void setField(int index, String field)
-
getRangePaint
@Deprecated public Paint getRangePaint()
Deprecated.
-
setRangePaint
@Deprecated public void setRangePaint(Paint rangePaint)
Deprecated.
-
-