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 void
addSector(BigDecimal upperBound, String color)
Add a GaugeSector contained in this Gauge.BigDecimal
getMax()
The maximum dial value.BigDecimal
getMin()
The minimum dial value.String
getPrefix()
The label prefix.String
getResultType()
List<Map<String,Object>>
getSectors()
String
getSuffix()
BigDecimal
getValue()
The current value on the dial.void
setMax(BigDecimal maxValue)
The maximum dial value.void
setMin(BigDecimal minValue)
The minimum dial value.void
setPrefix(String prefix)
Set the label prefix.void
setSuffix(String suffix)
The label suffix.void
setValue(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. IfminValue
is 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. IfmaxValue
is 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:
getResultType
in interfaceComplexCalculationResult
-
-