[josm-dev] How to update changes in dataSet ?

Flávio Henrique yoshimit at gmail.com
Tue Jan 4 17:26:40 GMT 2011


Hello Dirk.
Thank you for the information.


> CombineWayAction().combineWaysWorker(similarWays)
>
> return a way and a command (Pair<Way, Command>. You need to pass the
> command to
>
> Main.main.undoRedo.add(command)
>
> or all you do is locally.
>
> As you do a loop, you should rather use a SequenceCommand to group them:
>
> LinkedList<Command> cmds = new LinkedList<Command>();
> for...
>  cmds.add(...command part of combinewayaction result...);
>
> Main.main.undoRedo.add(new SequenceCommand(tr("Your job"), cmds));
>
> Ciao
>

It worked but remains one problem: after running

Main.main.undoRedo.add(new SequenceCommand(tr("Your job"), cmds));

I can see the combined way on GUI (before there was 24 segments, after 23.
Nice). But after selecting the data again, the
method nc.getCurrentDataSet().getWays() returns the same ways (24 segments).
Seems I need to remove the combined segment from dataSet. How can I do that?

Thank you!

Flávio Henrique


More information about the josm-dev mailing list