Cannot display: file marked as a binary type.
svn:mime-type = application/java-archive
|
|
|
|
| 4 | 4 | import static org.openstreetmap.josm.tools.I18n.tr; |
| 5 | 5 | |
| 6 | 6 | import java.awt.event.ActionEvent; |
| | 7 | import java.awt.event.KeyEvent; |
| 7 | 8 | import java.util.ArrayList; |
| 8 | 9 | import java.util.Arrays; |
| 9 | 10 | import java.util.Collections; |
| … |
… |
|
| 13 | 14 | import java.util.Map; |
| 14 | 15 | import java.util.Set; |
| 15 | 16 | |
| 16 | | import javax.swing.AbstractAction; |
| 17 | 17 | import javax.swing.JOptionPane; |
| 18 | 18 | |
| | 19 | import org.openstreetmap.josm.actions.JosmAction; |
| 19 | 20 | import org.openstreetmap.josm.command.AddCommand; |
| 20 | 21 | import org.openstreetmap.josm.command.ChangeCommand; |
| 21 | 22 | import org.openstreetmap.josm.command.Command; |
| … |
… |
|
| 33 | 34 | import org.openstreetmap.josm.data.osm.Way; |
| 34 | 35 | import org.openstreetmap.josm.gui.MainApplication; |
| 35 | 36 | import org.openstreetmap.josm.tools.ImageProvider; |
| | 37 | import org.openstreetmap.josm.tools.Shortcut; |
| 36 | 38 | |
| 37 | 39 | import relcontext.ChosenRelation; |
| 38 | 40 | import relcontext.ChosenRelationListener; |
| … |
… |
|
| 41 | 43 | * Make a single polygon out of the multipolygon relation. The relation must have only outer members. |
| 42 | 44 | * @author Zverik |
| 43 | 45 | */ |
| 44 | | public class ReconstructPolygonAction extends AbstractAction implements ChosenRelationListener { |
| | 46 | public class ReconstructPolygonAction extends JosmAction implements ChosenRelationListener { |
| 45 | 47 | private ChosenRelation rel; |
| 46 | 48 | |
| 47 | 49 | private static final List<String> IRRELEVANT_KEYS = Arrays.asList(new String[] { |
| … |
… |
|
| 48 | 50 | "source", "created_by", "note"}); |
| 49 | 51 | |
| 50 | 52 | public ReconstructPolygonAction(ChosenRelation rel) { |
| 51 | | super(tr("Reconstruct polygon")); |
| 52 | | putValue(SMALL_ICON, ImageProvider.get("dialogs", "filter")); |
| 53 | | putValue(LONG_DESCRIPTION, "Reconstruct polygon from multipolygon relation"); |
| | 53 | super(tr("Reconstruct polygon"), "dialogs/filter", tr("Reconstruct polygon from multipolygon relation"), |
| | 54 | Shortcut.registerShortcut("reltoolbox:reconstructpoly", tr("Relation Toolbox: {0}", tr("Reconstruct polygon from multipolygon relation")), |
| | 55 | KeyEvent.CHAR_UNDEFINED, Shortcut.NONE), false); |
| 54 | 56 | this.rel = rel; |
| 55 | 57 | rel.addChosenRelationListener(this); |
| 56 | 58 | setEnabled(isSuitableRelation(rel.get())); |