Intent of NavigatableComponent$isVisibleOnScreen()

Robert Scott lists at humanleg.org.uk
Tue Nov 21 00:01:44 UTC 2017


On Monday, 20 November 2017 22:45:04 GMT Paul Hartmann wrote:
> ...
> This code is by Michael Zangl, so he would know much more about it. From
> my understanding, isVisibleOnScreen() prevents the recalculation of the
> location state when the component has not been added to the visible window.
> At the same time, the method is intended to be overridden with constant
> true in a situation where the NavigatableComponent is handled completely
> off-screen (RenderingHelper and unit tests, see also [10405]).
> 
> It would be good if RenderingHelper could be compiled without any
> dependency on Swing classes (i.e. JComponent as super class of
> NavigatableComponent). Michael has achieved a lot in this direction, but
> there is still more to be done. :)

Thanks for this. I have actually just been trying the tests with it patched
out to true and indeed it doesn't seem to cause any additional failures or
errors on my system.

I'm thinking it would be extremely useful for the tests if the standard class
were able to have a flag set (and unset) which would hard-wire this to true.
This way, any of the complicated mocking or JOSMFixture re-initialization
that might be required in other solutions I've been investigating would be
necessary.

Hell, it might be as simple as adding a straightforward 
GraphicsEnvironment.isHeadless() || (...) before the existing expression.


robert.




More information about the josm-dev mailing list