Improvements to the Linear Meter widget#3514
Conversation
…roving the performance on multi-core processors.
…ar instead of a needle.
… the max value of the linear meter.
…so when the value is larger than the max value of the linear meter.
… when the value is larger than the max value of the linear meter.
…m PV" to the widget property "Limits from PV".
…micReference" with base types.
…k instead to use '<T> T withReadLock()' instead of 'void withReadLock()'
…and calling ImageView.setImage().
…) { ... } in 'LinearMeterRepresentation'.
kasemir
left a comment
There was a problem hiding this comment.
I think we should increase the version number, since the behavior of "limits from PV" changes and there's the new bar mode
1.0.0: ...based on 3rd party library
2.0.0: Simple linear meter,....
3.0.0: Meter and bar mode; more ‘LimitsFromPV’ options
Without the scale, is it possible to narrow it further, down to 3 or 1 pixel? |
I did increase the version number in the following comment: 729bfa8.
The limit is currently set to |
| } | ||
| // Draw the bar: | ||
| gc.fillRect(marginLeft, currentIndicatorPosition, meterBreadth, linearMeterScale.getBounds().height-currentIndicatorPosition-marginBelow); | ||
| gc.fillRect(marginLeft, currentIndicatorPosition, meterBreadth - 1, linearMeterScale.getBounds().height-currentIndicatorPosition-marginBelow); |
There was a problem hiding this comment.
Found in several commits:
Math symbols (minus) could be surrounded by space for better readability.
|
Seting the width or height to 1 pixel doesn't work (no bar is visible), but setting it to 2 pixels results in a 1-pixel wide bar, given that the color "Foreground Color" is set to transparent. I have therefore updated the minimum width & height to be 2 pixels. |
f32b1ff to
279e108
Compare

This pull request implements several improvements to the Linear Meter widget:
Platform.runLater(). This pull request replaces that strategy by instead relying on aReentrantReadWriteLock, allowing for simultaneous read-accesses while write-operations are sequential.