Class ResultGauge
- Object
-
- ResultGauge
-
- All Implemented Interfaces:
Serializable,ComplexCalculationResult
public class ResultGauge extends Object implements ComplexCalculationResult
The Gauge widget class implements a graphical speedometer-style gauge for displaying a measurement by means of a needle on a dial. The dial is divided into sectors, each having its own color and value.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ResultGauge()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSector(BigDecimal upperBound, String color)Add a GaugeSector contained in this Gauge.BigDecimalgetMax()The maximum dial value.BigDecimalgetMin()The minimum dial value.StringgetPrefix()The label prefix.StringgetResultType()List<Map<String,Object>>getSectors()StringgetSuffix()BigDecimalgetValue()The current value on the dial.voidsetMax(BigDecimal maxValue)The maximum dial value.voidsetMin(BigDecimal minValue)The minimum dial value.voidsetPrefix(String prefix)Set the label prefix.voidsetSuffix(String suffix)The label suffix.voidsetValue(BigDecimal value)The current value on the dial.
-
-
-
Method Detail
-
getValue
public BigDecimal getValue()
The current value on the dial.- Returns:
- BigDecimal
-
setValue
public void setValue(BigDecimal value)
The current value on the dial.- Parameters:
value- the new dial value. Must be between minValue and maxValue. Default value is 0
-
getMin
public BigDecimal getMin()
The minimum dial value.- Returns:
- BigDecimal
-
setMin
public void setMin(BigDecimal minValue)
The minimum dial value.- Parameters:
minValue- the new minimum dial value. Must be at least 1 less than the maximum dial value. IfminValueis not at least 1 less than the maximum value, then it is set tomaxValue - 1.. Default value is 0
-
getMax
public BigDecimal getMax()
The maximum dial value.- Returns:
- BigDecimal
-
setMax
public void setMax(BigDecimal maxValue)
The maximum dial value.- Parameters:
maxValue- the new maximum dial value. Must be at least 1 greater than the minimum dial value. IfmaxValueis not at least 1 greater than the minimum value, then it is set to1 + minValue.. Default value is 100
-
addSector
public void addSector(BigDecimal upperBound, String color)
Add a GaugeSector contained in this Gauge. If this this property is not specified, the gauge will be created with a default sector filling the gauge.- Parameters:
upperBound-color-
-
getSuffix
public String getSuffix()
-
setSuffix
public void setSuffix(String suffix)
The label suffix.- Parameters:
suffix- the new label suffix.. Default value is "%"
-
getPrefix
public String getPrefix()
The label prefix.- Returns:
- String
-
setPrefix
public void setPrefix(String prefix)
Set the label prefix.- Parameters:
prefix- the new label prefix.. Default value is ""
-
getResultType
public String getResultType()
- Specified by:
getResultTypein interfaceComplexCalculationResult
-
-