@ -216,93 +216,66 @@ public class RaceViewController extends Controller {
*Createspeedometer
*Createspeedometer
*/
*/
privatevoidinitialiseSpeedometer(){
privatevoidinitialiseSpeedometer(){
//Create the Medusa Gauge
/**
*CreatetheMedusaGaugewithmostofit'soptions
*/
gauge=GaugeBuilder.create()
gauge=GaugeBuilder.create()
.prefSize(200,200)// Set the preferred size of the control
.prefSize(200,200)
// Related to Foreground Elements
.foregroundBaseColor(Color.WHITE)
.foregroundBaseColor(Color.WHITE)// Defines a color for title, subtitle, unit, value, tick label, tick mark, major tick mark, medium tick mark and minor tick mark
.title("Title")
// Related to Title Text
.subTitle("Speed")
.title("Title")// Set the text for the title
.unit("Knots")
// Related to Sub Title Text
.decimals(2)
.subTitle("Speed")// Set the text for the subtitle
.lcdVisible(true)
// Related to Unit Text
.lcdDesign(LcdDesign.STANDARD)
.unit("Knots")// Set the text for the unit
.lcdFont(LcdFont.DIGITAL_BOLD)
// Related to Value Text
.scaleDirection(Gauge.ScaleDirection.CLOCKWISE)
.decimals(2)// Set the number of decimals for the value/lcd text
.minValue(0)
// Related to LCD
.maxValue(50)
.lcdVisible(true)// Display a LCD instead of the plain value text
.startAngle(320)
.lcdDesign(LcdDesign.STANDARD)// Set the design for the LCD
.angleRange(280)
.lcdFont(LcdFont.DIGITAL_BOLD)// Set the font for the LCD (STANDARD, LCD, SLIM, DIGITAL_BOLD, ELEKTRA)
.tickLabelDecimals(0)
// Related to scale
.tickLabelLocation(TickLabelLocation.INSIDE)
.scaleDirection(Gauge.ScaleDirection.CLOCKWISE)// Define the direction of the Scale (CLOCKWISE, COUNTER_CLOCKWISE)
.startFromZero(false)// Defines if the needle should start from the 0 value
.gradientBarStops(newStop(0.0,Color.BLUE),
.returnToZero(false)// Defines if the needle should always return to the 0 value (only makes sense when animated==true)
// Related to Knob
.knobType(Gauge.KnobType.METAL)// Defines the type for the center knob (STANDARD, PLAIN, METAL, FLAT)
.knobColor(Color.LIGHTGRAY)// Defines the color that should be used for the center knob
.interactive(false)// Defines if it should be possible to press the center knob
.onButtonPressed(buttonEvent->System.out.println("Knob pressed"))// Defines a handler that will be triggered when the center knob was pressed
.onButtonReleased(buttonEvent->System.out.println("Knob released"))// Defines a handler that will be triggered when the center knob was released
// Related to Threshold
.thresholdVisible(true)// Defines if the threshold indicator should be visible
.threshold(50)// Defines the value for the threshold
.thresholdColor(Color.RED)// Defines the color for the threshold
.checkThreshold(true)// Defines if each value should be checked against the threshold
.onThresholdExceeded(thresholdEvent->System.out.println("Threshold exceeded"))// Defines a handler that will be triggered if checkThreshold==true and the threshold is exceeded
.onThresholdUnderrun(thresholdEvent->System.out.println("Threshold underrun"))// Defines a handler that will be triggered if checkThreshold==true and the threshold is underrun
// Related to Gradient Bar
.gradientBarEnabled(true)// Defines if a gradient filled bar should be visible to visualize a range
.gradientBarStops(newStop(0.0,Color.BLUE),// Defines a conical color gradient that will be use to color the gradient bar
newStop(0.25,Color.CYAN),
newStop(0.25,Color.CYAN),
newStop(0.5,Color.LIME),
newStop(0.5,Color.LIME),
newStop(0.75,Color.YELLOW),
newStop(0.75,Color.YELLOW),
newStop(1.0,Color.RED))
newStop(1.0,Color.RED))
// Related to Markers
.markersVisible(true)
.markersVisible(true)// Defines if markers will be visible
//.markers(marker1, marker2) // Defines markers that will be drawn
// Related to Value
//.animated(true) // Defines if the needle will be animated
//.animationDuration(500) // Defines the speed of the needle in milliseconds (10 - 10000 ms)