public void setValue ( final double VALUE ) { if ( isEnabled ( ) ) { if ( ! isLogScale ( ) ) { model . setValue ( VALUE ) ; } else { if ( VALUE > 0 ) { model . setValue ( VALUE ) ; } else { model . setValue ( 1 ) ; } } // LED blinking makes only sense when autoResetToZero == OFF if ( ! isAutoResetToZero ( ) ) { // Check if current value exceeds threshold and activate led as indicator if ( ! model . isThresholdBehaviourInverted ( ) ) { if ( Double . compare ( model . getValue ( ) , model . getThreshold ( ) ) >= 0 ) { if ( ! LED_BLINKING_TIMER . isRunning ( ) ) { LED_BLINKING_TIMER . start ( ) ; propertyChangeSupport . firePropertyChange ( THRESHOLD_PROPERTY , false , true ) ; } } else { LED_BLINKING_TIMER . stop ( ) ; setCurrentLedImage ( getLedImageOff ( ) ) ; } } else { if ( Double . compare ( model . getValue ( ) , model . getThreshold ( ) ) <= 0 ) { if ( ! LED_BLINKING_TIMER . isRunning ( ) ) { LED_BLINKING_TIMER . start ( ) ; propertyChangeSupport . firePropertyChange ( THRESHOLD_PROPERTY , false , true ) ; } } else { LED_BLINKING_TIMER . stop ( ) ; setCurrentLedImage ( getLedImageOff ( ) ) ; } } } if ( model . getValue ( ) > ( model . getOldValue ( ) + model . getRange ( ) * model . getRedrawFactor ( ) ) || model . getValue ( ) < ( model . getOldValue ( ) - model . getRange ( ) * model . getRedrawFactor ( ) ) ) { repaint ( getInnerBounds ( ) ) ; } fireStateChanged ( ) ; propertyChangeSupport . firePropertyChange ( VALUE_PROPERTY , model . getOldValue ( ) , model . getValue ( ) ) ; } }
Sets the value of the gauge . This method is primarly used for static gauges or if you really have measurement results that are occuring within the range of a second . If you have slow changing values you should better use the method setValueAnimated .