Changeset 34532 in osm


Ignore:
Timestamp:
2018-08-18T18:53:24+02:00 (6 years ago)
Author:
donvip
Message:

update to JOSM 14153

Location:
applications/editors/josm/plugins/namemanager
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/namemanager/build.xml

    r33872 r34532  
    44    <property name="commit.message" value="..."/>
    55    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    6     <property name="plugin.main.version" value="12758"/>
     6    <property name="plugin.main.version" value="14153"/>
    77
    88    <!-- Configure these properties (replace "..." accordingly).
  • applications/editors/josm/plugins/namemanager/src/org/openstreetmap/josm/plugins/namemanager/dialog/NameManagerDialog.java

    r33872 r34532  
    4040import javax.swing.KeyStroke;
    4141
    42 import org.openstreetmap.josm.Main;
    4342import org.openstreetmap.josm.data.osm.Way;
    4443import org.openstreetmap.josm.gui.MainApplication;
     
    103102
    104103    private NameManagerDialog() {
    105         super((JFrame) Main.parent, "Name Manager", true);
     104        super((JFrame) MainApplication.getMainFrame(), "Name Manager", true);
    106105        Container cp = this.getContentPane();
    107106        cp.setLayout(new BorderLayout());
     
    329328     * Gets reference to the singleton object.
    330329     *
    331      * @return Singleton object of the {@link LaneManagerDialog} class.
     330     * @return Singleton object of the {@link NameManagerDialog} class.
    332331     */
    333332    public static NameManagerDialog getInstance() {
     
    344343     *
    345344     * @param dialog
    346      *            is the {@link LaneManagerDialog} object
     345     *            is the {@link NameManagerDialog} object
    347346     */
    348347    private static void centerDialog(NameManagerDialog dialog) {
  • applications/editors/josm/plugins/namemanager/src/org/openstreetmap/josm/plugins/namemanager/listeners/NameManagerAction.java

    r32549 r34532  
    88
    99import org.openstreetmap.josm.actions.JosmAction;
    10 import org.openstreetmap.josm.data.SelectionChangedListener;
     10import org.openstreetmap.josm.data.osm.DataSelectionListener;
    1111import org.openstreetmap.josm.data.osm.DataSet;
    12 import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1312import org.openstreetmap.josm.data.osm.Way;
     13import org.openstreetmap.josm.data.osm.event.SelectionEventManager;
    1414import org.openstreetmap.josm.plugins.namemanager.dialog.NameManagerDialog;
    1515import org.openstreetmap.josm.plugins.namemanager.utils.NameManagerUtils;
     
    2323 *
    2424 */
    25 public class NameManagerAction extends JosmAction implements SelectionChangedListener {
     25public class NameManagerAction extends JosmAction implements DataSelectionListener {
    2626
    2727    private static final String ATTRIBUTE_DISTRICTS = "Attribute districts";
     
    3838    public NameManagerAction() {
    3939        super(tr(NAME_MANAGER), NAME_MANAGER_MENU, tr(ATTRIBUTE_DISTRICTS), null, true, "namemanager", true);
    40         DataSet.addSelectionListener(this);
     40        SelectionEventManager.getInstance().addSelectionListener(this);
    4141        setEnabled(false);
    4242    }
     
    6565     * This method is responsible for enabling and disabling toolmenu
    6666     * LaneManager button.
    67      *
    68      * @see org.openstreetmap.josm.data.SelectionChangedListener#selectionChanged(java.util.Collection)
    6967     */
    7068    @Override
    71     public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) {
     69    public void selectionChanged(SelectionChangeEvent event) {
    7270        boolean enabledState = false;
    7371        DataSet ds = getLayerManager().getEditDataSet();
    74         if (newSelection != null && ds != null) {
     72        if (event.getSelection() != null && ds != null) {
    7573            Collection<Way> selectedWays = ds.getSelectedWays();
    7674            enabledState = selectedWays.size() == 1 && selectedWays.iterator().next().isClosed();
  • applications/editors/josm/plugins/namemanager/src/org/openstreetmap/josm/plugins/namemanager/utils/NameManagerUtils.java

    r33872 r34532  
    1515
    1616import org.openstreetmap.gui.jmapviewer.Coordinate;
    17 import org.openstreetmap.josm.Main;
    1817import org.openstreetmap.josm.data.osm.Node;
    1918import org.openstreetmap.josm.data.osm.Way;
     
    2221import org.openstreetmap.josm.plugins.namemanager.countryData.Country;
    2322import org.openstreetmap.josm.plugins.namemanager.countryData.CountryDataMemory;
     23import org.openstreetmap.josm.tools.Logging;
    2424import org.openstreetmap.josm.tools.Pair;
    2525import org.w3c.dom.Document;
     
    3838     */
    3939    public static Window getTopWindow() {
    40         Component component = Main.parent;
     40        Component component = MainApplication.getMainFrame();
    4141        if (component != null) {
    4242            while (component.getParent() != null) {
     
    239239                    .getResourceAsStream("/resources/administrative-levels.xml");
    240240            doc = db.parse(xml);
    241         } catch (ParserConfigurationException e) {
    242             e.printStackTrace();
    243         } catch (SAXException e) {
    244             e.printStackTrace();
    245         } catch (IOException e) {
    246             e.printStackTrace();
     241        } catch (ParserConfigurationException | SAXException | IOException e) {
     242            Logging.error(e);
    247243        }
    248244
Note: See TracChangeset for help on using the changeset viewer.