Changeset 34532 in osm
- Timestamp:
- 2018-08-18T18:53:24+02:00 (6 years ago)
- Location:
- applications/editors/josm/plugins/namemanager
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/namemanager/build.xml
r33872 r34532 4 4 <property name="commit.message" value="..."/> 5 5 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 6 <property name="plugin.main.version" value="1 2758"/>6 <property name="plugin.main.version" value="14153"/> 7 7 8 8 <!-- Configure these properties (replace "..." accordingly). -
applications/editors/josm/plugins/namemanager/src/org/openstreetmap/josm/plugins/namemanager/dialog/NameManagerDialog.java
r33872 r34532 40 40 import javax.swing.KeyStroke; 41 41 42 import org.openstreetmap.josm.Main;43 42 import org.openstreetmap.josm.data.osm.Way; 44 43 import org.openstreetmap.josm.gui.MainApplication; … … 103 102 104 103 private NameManagerDialog() { 105 super((JFrame) Main .parent, "Name Manager", true);104 super((JFrame) MainApplication.getMainFrame(), "Name Manager", true); 106 105 Container cp = this.getContentPane(); 107 106 cp.setLayout(new BorderLayout()); … … 329 328 * Gets reference to the singleton object. 330 329 * 331 * @return Singleton object of the {@link LaneManagerDialog} class.330 * @return Singleton object of the {@link NameManagerDialog} class. 332 331 */ 333 332 public static NameManagerDialog getInstance() { … … 344 343 * 345 344 * @param dialog 346 * is the {@link LaneManagerDialog} object345 * is the {@link NameManagerDialog} object 347 346 */ 348 347 private static void centerDialog(NameManagerDialog dialog) { -
applications/editors/josm/plugins/namemanager/src/org/openstreetmap/josm/plugins/namemanager/listeners/NameManagerAction.java
r32549 r34532 8 8 9 9 import org.openstreetmap.josm.actions.JosmAction; 10 import org.openstreetmap.josm.data. SelectionChangedListener;10 import org.openstreetmap.josm.data.osm.DataSelectionListener; 11 11 import org.openstreetmap.josm.data.osm.DataSet; 12 import org.openstreetmap.josm.data.osm.OsmPrimitive;13 12 import org.openstreetmap.josm.data.osm.Way; 13 import org.openstreetmap.josm.data.osm.event.SelectionEventManager; 14 14 import org.openstreetmap.josm.plugins.namemanager.dialog.NameManagerDialog; 15 15 import org.openstreetmap.josm.plugins.namemanager.utils.NameManagerUtils; … … 23 23 * 24 24 */ 25 public class NameManagerAction extends JosmAction implements SelectionChangedListener {25 public class NameManagerAction extends JosmAction implements DataSelectionListener { 26 26 27 27 private static final String ATTRIBUTE_DISTRICTS = "Attribute districts"; … … 38 38 public NameManagerAction() { 39 39 super(tr(NAME_MANAGER), NAME_MANAGER_MENU, tr(ATTRIBUTE_DISTRICTS), null, true, "namemanager", true); 40 DataSet.addSelectionListener(this);40 SelectionEventManager.getInstance().addSelectionListener(this); 41 41 setEnabled(false); 42 42 } … … 65 65 * This method is responsible for enabling and disabling toolmenu 66 66 * LaneManager button. 67 *68 * @see org.openstreetmap.josm.data.SelectionChangedListener#selectionChanged(java.util.Collection)69 67 */ 70 68 @Override 71 public void selectionChanged( Collection<? extends OsmPrimitive> newSelection) {69 public void selectionChanged(SelectionChangeEvent event) { 72 70 boolean enabledState = false; 73 71 DataSet ds = getLayerManager().getEditDataSet(); 74 if ( newSelection!= null && ds != null) {72 if (event.getSelection() != null && ds != null) { 75 73 Collection<Way> selectedWays = ds.getSelectedWays(); 76 74 enabledState = selectedWays.size() == 1 && selectedWays.iterator().next().isClosed(); -
applications/editors/josm/plugins/namemanager/src/org/openstreetmap/josm/plugins/namemanager/utils/NameManagerUtils.java
r33872 r34532 15 15 16 16 import org.openstreetmap.gui.jmapviewer.Coordinate; 17 import org.openstreetmap.josm.Main;18 17 import org.openstreetmap.josm.data.osm.Node; 19 18 import org.openstreetmap.josm.data.osm.Way; … … 22 21 import org.openstreetmap.josm.plugins.namemanager.countryData.Country; 23 22 import org.openstreetmap.josm.plugins.namemanager.countryData.CountryDataMemory; 23 import org.openstreetmap.josm.tools.Logging; 24 24 import org.openstreetmap.josm.tools.Pair; 25 25 import org.w3c.dom.Document; … … 38 38 */ 39 39 public static Window getTopWindow() { 40 Component component = Main .parent;40 Component component = MainApplication.getMainFrame(); 41 41 if (component != null) { 42 42 while (component.getParent() != null) { … … 239 239 .getResourceAsStream("/resources/administrative-levels.xml"); 240 240 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); 247 243 } 248 244
Note:
See TracChangeset
for help on using the changeset viewer.