Changeset 33714 in osm for applications/editors/josm


Ignore:
Timestamp:
2017-10-09T00:27:00+02:00 (7 years ago)
Author:
donvip
Message:

fix #josm15416 - update to JOSM 12859

Location:
applications/editors/josm/plugins/HouseNumberTaggingTool
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/HouseNumberTaggingTool

    • Property svn:ignore
      •  

        old new  
        44REVISION.XML
        55findbugs-josm-HouseNumberTaggingTool.xml
         6spotbugs-josm-HouseNumberTaggingTool.xml
  • applications/editors/josm/plugins/HouseNumberTaggingTool/build.xml

    r32680 r33714  
    44    <property name="commit.message" value="Initial version."/>
    55    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    6     <property name="plugin.main.version" value="10580"/>
     6    <property name="plugin.main.version" value="12859"/>
    77    <!-- Configure these properties (replace "..." accordingly).
    88         See https://josm.openstreetmap.de/wiki/DevelopersGuide/DevelopingPlugins
  • applications/editors/josm/plugins/HouseNumberTaggingTool/src/org/openstreetmap/josm/plugins/housenumbertool/HouseNumberTaggingToolPlugin.java

    r30775 r33714  
    11package org.openstreetmap.josm.plugins.housenumbertool;
    22
    3 import org.openstreetmap.josm.Main;
     3import org.openstreetmap.josm.gui.MainApplication;
    44import org.openstreetmap.josm.gui.MainMenu;
    55import org.openstreetmap.josm.plugins.Plugin;
     
    1919        super(info);
    2020        action = new LaunchAction(getPluginDir());
    21         MainMenu.add(Main.main.menu.dataMenu, action, false,0);
     21        MainMenu.add(MainApplication.getMenu().dataMenu, action, false,0);
    2222    }
    2323}
  • applications/editors/josm/plugins/HouseNumberTaggingTool/src/org/openstreetmap/josm/plugins/housenumbertool/LaunchAction.java

    r30775 r33714  
    1616
    1717    private String pluginDir;
    18    
     18
     19    /**
     20     * Constructs a new {@code LaunchAction}.
     21     * @param pluginDir plugin directory
     22     */
    1923    public LaunchAction(String pluginDir) {
    2024        super("HouseNumberTaggingTool",
  • applications/editors/josm/plugins/HouseNumberTaggingTool/src/org/openstreetmap/josm/plugins/housenumbertool/TagDialog.java

    r32446 r33714  
    3939import org.openstreetmap.josm.command.SequenceCommand;
    4040import org.openstreetmap.josm.data.osm.OsmPrimitive;
     41import org.openstreetmap.josm.data.tagging.ac.AutoCompletionItem;
    4142import org.openstreetmap.josm.gui.ExtendedDialog;
     43import org.openstreetmap.josm.gui.MainApplication;
    4244import org.openstreetmap.josm.gui.tagging.ac.AutoCompletingComboBox;
    43 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionListItem;
    4445import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionManager;
    4546
     
    9697    private JRadioButton placeRadio;
    9798
     99    /**
     100     * Constructs a new {@code TagDialog}.
     101     * @param pluginDir plugin directory
     102     * @param selection selected primitive
     103     */
    98104    public TagDialog(String pluginDir, OsmPrimitive selection) {
    99105        super(Main.parent, tr("House Number Editor"), new String[] { tr("OK"), tr("Cancel") }, true);
     
    104110
    105111        setContent(editPanel);
    106         setButtonIcons(new String[] { "ok.png", "cancel.png" });
     112        setButtonIcons("ok", "cancel");
    107113        setDefaultButton(1);
    108114        setupDialog();
     
    112118        setLocationRelativeTo(null);
    113119
    114         SwingUtilities.invokeLater(new Runnable()  {
    115             @Override
    116             public void run() {
    117                 housnumber.requestFocus();
    118                 housnumber.selectAll();
    119             }
     120        SwingUtilities.invokeLater(() -> {
     121            housnumber.requestFocus();
     122            housnumber.selectAll();
    120123        });
    121124    }
    122125
    123126    private JPanel createContentPane() {
    124         acm = selection.getDataSet().getAutoCompletionManager();
     127        acm = AutoCompletionManager.of(selection.getDataSet());
    125128
    126129        Dto dto = loadDto();
     
    164167
    165168        country = new AutoCompletingComboBox();
    166         country.setPossibleACItems(acm.getValues(TAG_ADDR_COUNTRY));
     169        country.setPossibleAcItems(acm.getTagValues(TAG_ADDR_COUNTRY));
    167170        country.setPreferredSize(new Dimension(200, 24));
    168171        country.setEditable(true);
     
    189192
    190193        state = new AutoCompletingComboBox();
    191         state.setPossibleACItems(acm.getValues(TAG_ADDR_STATE));
     194        state.setPossibleAcItems(acm.getTagValues(TAG_ADDR_STATE));
    192195        state.setPreferredSize(new Dimension(200, 24));
    193196        state.setEditable(true);
     
    213216
    214217        city = new AutoCompletingComboBox();
    215         city.setPossibleACItems(acm.getValues(TAG_ADDR_CITY));
     218        city.setPossibleAcItems(acm.getTagValues(TAG_ADDR_CITY));
    216219        city.setPreferredSize(new Dimension(200, 24));
    217220        city.setEditable(true);
     
    237240
    238241        postcode = new AutoCompletingComboBox();
    239         postcode.setPossibleACItems(acm.getValues(TAG_ADDR_POSTCODE));
     242        postcode.setPossibleAcItems(acm.getTagValues(TAG_ADDR_POSTCODE));
    240243        postcode.setPreferredSize(new Dimension(200, 24));
    241244        postcode.setEditable(true);
     
    290293            street.setPossibleItems(getPossibleStreets());
    291294        } else {
    292             street.setPossibleACItems(acm.getValues(TAG_ADDR_PLACE));
     295            street.setPossibleAcItems(acm.getTagValues(TAG_ADDR_PLACE));
    293296        }
    294297        street.setPreferredSize(new Dimension(200, 24));
     
    391394                return (String) item;
    392395            }
    393             if (item instanceof AutoCompletionListItem) {
    394                 return ((AutoCompletionListItem) item).getValue();
     396            if (item instanceof AutoCompletionItem) {
     397                return ((AutoCompletionItem) item).getValue();
    395398            }
    396399            return item.toString();
     
    512515         */
    513516        Set<String> names = new TreeSet<>();
    514         for (OsmPrimitive osm : Main.getLayerManager().getEditDataSet().allNonDeletedPrimitives()) {
     517        for (OsmPrimitive osm : MainApplication.getLayerManager().getEditDataSet().allNonDeletedPrimitives()) {
    515518            if (osm.getKeys() != null && osm.keySet().contains("highway") && osm.keySet().contains("name")) {
    516519                names.add(osm.get("name"));
     
    554557                street.setPossibleItems(getPossibleStreets());
    555558            } else {
    556                 street.setPossibleACItems(acm.getValues(TAG_ADDR_PLACE));
     559                street.setPossibleAcItems(acm.getTagValues(TAG_ADDR_PLACE));
    557560            }
    558561        }
Note: See TracChangeset for help on using the changeset viewer.