Plugins: deprecated API to be removed
Vincent Privat
vincent.privat at gmail.com
Sat Dec 2 15:18:39 UTC 2017
Hi Jo,
This should work:
from org.openstreetmap.josm.gui import MainApplication
editLayer = MainApplication.getLayerManager().getEditLayer()
if editLayer and editLayer.data:
selectedElements = editLayer.data.getSelected()
If you don't need editLayer you could simplify it to:
editData = MainApplication.getLayerManager().getEditDataSet()
if editData:
selectedElements = editData.getSelected()
Cheers,
Vincent
2017-12-02 11:00 GMT+01:00 Jo <winfixit at gmail.com>:
> Hi Vincent,
>
> Thank you for cleaning up the source code. Of course I run into a problem
> when using the scripting plugin.
>
> How can I get all the selected elements?
>
> This is what worked untill a few days ago:
>
> from org.openstreetmap.josm import Main
>
> editLayer = Main.getLayerManager().getEditLayer()
> if editLayer and editLayer.data:
> selectedElements = editLayer.data.getSelected()
>
> I tried a few incantations, but no luck.
>
> Cheers,
>
> Polyglot
>
>
> 2017-11-28 1:07 GMT+01:00 Vincent Privat <vincent.privat at gmail.com>:
>
>> First batch of deprecated APIs removed:
>> https://josm.openstreetmap.de/changeset/13173/josm
>> Cheers,
>> Vincent
>>
>> 2017-11-26 16:42 GMT+01:00 Vincent Privat <vincent.privat at gmail.com>:
>>
>> > Hello,
>> > JOSM 13170 has been released. This is the last stable version before we
>> > remove a lot of deprecated APIs.
>> > Make sure your plugins compile without deprecation warning!
>> > Vincent
>> >
>> > 2017-10-30 21:20 GMT+01:00 Vincent Privat <vincent.privat at gmail.com>:
>> >
>> >> Hi Holger,
>> >> Sorry for not responding earlier, but I have already updated a lot of
>> >> plugins, see https://github.com/openstreetm
>> ap/josm-plugins/commits/master
>> >> Still some work to do (around 1100 deprecation warnings)
>> >> Cheers,
>> >> Vincent
>> >>
>> >> 2017-10-30 21:16 GMT+01:00 Holger Mappt <holgerosm at gmx.net>:
>> >>
>> >>> On 2017-10-23 at 00:15 +0200 Paul Hartmann wrote:
>> >>>
>> >>>> On 21.10.2017 17:49, Holger Mappt wrote:
>> >>>>
>> >>>>> Is the sonar the right place to see what is deprecated, i.e. what
>> >>>>> needs to be changed? [1]
>> >>>>> [1] https://josm.openstreetmap.de/sonar/project/issues?id=josm-p
>> >>>>> lugins&resolved=false&rules=squid%3ACallToDeprecatedMethod
>> >>>>>
>> >>>>
>> >>>> Possible, but the normal way would be to have the java compiler
>> output
>> >>>> deprecation warnings (use compiler option -Xlint:deprecation for
>> javac to
>> >>>> see details).
>> >>>>
>> >>>
>> >>> The trick is to call "ant clean" before "ant", otherwise the
>> deprecation
>> >>> messages are not shown. Option -Xlint:deprecation is on by default if
>> >>> ../build-common.xml is imported from build.xml.
>> >>>
>> >>> Thanks,
>> >>> Holger
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>
>> >
>>
>
>
More information about the josm-dev
mailing list