Class 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 a 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.
    See Also:
    Serialized Form
    • 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

      • 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)
      • getShapesCount

        public int getShapesCount()
      • 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 to null 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 to null 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. The 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).
        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 a SurveyScale instance that is set up to display the values in the current row.
        Returns:
        a SurveyScale instance.
      • getField

        public String[] getField()
      • setField

        public void setField​(String[] fields)
      • getField

        public String getField​(int idx)
      • setField

        public void setField​(int index,
                             String field)
      • setRangePaint

        @Deprecated
        public void setRangePaint​(Paint rangePaint)
        Deprecated.