### jGauges

Various hints related to the jGauges Custom View.
Change the color of the displayed value to red
Requires the JavaObject Library.
Private Gauge1 As Gauge
Dim jo As JavaObject = Gauge1
jo.RunMethod("setValueColor", Array(fx.Colors.Red))
See next for using as a Sub.
Additional Subs
Example subs using API methods as defined in the source of the jGauges.jar, file gauge.java.
Lookup for the public methods and access those via a JavaObject.
`Sub Gauge_SetValueColor(g As Gauge, Color As Paint) 'ignore
Dim jo As JavaObject = g
jo.RunMethod("setValueColor", Array(Color))
End Sub`
`Sub Gauge_SetTitle(g As Gauge, Title As String) 'ignore
Dim jo As JavaObject = g
jo.RunMethod("setTitle", Array(Title))
End Sub`
`Sub Gauge_SetUnit(g As Gauge, Unit As String) 'ignore
Dim jo As JavaObject = g
jo.RunMethod("setUnit", Array(Unit))
End Sub`
`Sub Gauge_SetKnobColor(g As Gauge, Color As Paint) 'ignore
Dim jo As JavaObject = g
jo.RunMethod("setKnobColor", Array(Color))
End Sub`
`Sub Gauge_SetMinMax(g As Gauge, MinValue As Double, MaxValue As Double)
Dim jo As JavaObject = g
' For the skin gauge, set autoscale to false else runtime error
' jo.RunMethod("setAutoScale", Array(False))
jo.RunMethod("setMinValue", Array(MinValue))
jo.RunMethod("setMaxValue", Array(MaxValue))
End Sub`
`Sub Gauge_SetBackgroundPaint(g As Gauge, Color As Paint)
Dim jo As JavaObject = g
jo.RunMethod("setBackgroundPaint", Array(Color))
End Sub`
`Sub Gauge_SetForegroundBaseColor(g As Gauge, Color As Paint) 'ignore
Dim jo As JavaObject = g
jo.RunMethod("setForegroundBaseColor", Array(Color))
End Sub`
`Sub Gauge_SetBarBackgroundColor(g As Gauge, Color As Paint)
Dim jo As JavaObject = g
jo.RunMethod("setBarBackgroundColor", Array(Color))
End Sub`
`Sub Gauge_SetBarColor(g As Gauge, Color As Paint)
Dim jo As JavaObject = g
jo.RunMethod("setBarColor", Array(Color))
End Sub`
Additional Subs Usage Example
`Sub Process_Globals
Private Gauge_CPUTemperature As Gauge
...
Gauge_SetTitle(Gauge_CPUTemperature, "CPU")
Gauge_SetUnit(Gauge_CPUTemperature, "°C")
Gauge_SetValueColor(Gauge_CPUTemperature, fx.Colors.Blue)
Gauge_SetKnobColor(Gauge_CPUTemperature, fx.Colors.yellow)
`

Changed: 2018-05-09 18:59, Category: Custom Views, File: T6C179M2150.htm, ID: 2150