Changeset 34549 in osm for applications/editors
- Timestamp:
- 2018-08-18T19:35:31+02:00 (6 years ago)
- Location:
- applications/editors/josm/plugins/public_transport_layer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/public_transport_layer/build.xml
r34280 r34549 3 3 4 4 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 5 <property name="plugin.main.version" value="1 3919"/>5 <property name="plugin.main.version" value="14153"/> 6 6 7 7 <!-- Configure these properties (replace "..." accordingly). -
applications/editors/josm/plugins/public_transport_layer/src/ptl/DistanceBetweenStops.java
r34164 r34549 12 12 import javax.swing.JOptionPane; 13 13 14 import org.openstreetmap.josm.Main;15 14 import org.openstreetmap.josm.actions.JosmAction; 16 15 import org.openstreetmap.josm.data.SystemOfMeasurement; … … 22 21 import org.openstreetmap.josm.data.osm.RelationMember; 23 22 import org.openstreetmap.josm.gui.ExtendedDialog; 23 import org.openstreetmap.josm.gui.MainApplication; 24 24 import org.openstreetmap.josm.gui.dialogs.relation.sort.WayConnectionType; 25 25 import org.openstreetmap.josm.gui.dialogs.relation.sort.WayConnectionTypeCalculator; 26 26 import org.openstreetmap.josm.gui.util.GuiHelper; 27 27 import org.openstreetmap.josm.gui.widgets.JosmTextArea; 28 import org.openstreetmap.josm.spi.preferences.Config; 28 29 import org.openstreetmap.josm.tools.CheckParameterUtil; 29 30 import org.openstreetmap.josm.tools.Utils; … … 74 75 double totalLength = 0.0; 75 76 int lengthN = 0; 76 final boolean onlyLowerUnit = Main.pref.getBoolean("system_of_measurement.use_only_lower_unit", false);77 Main.pref.putBoolean("system_of_measurement.use_only_lower_unit", true);77 final boolean onlyLowerUnit = Config.getPref().getBoolean("system_of_measurement.use_only_lower_unit", false); 78 Config.getPref().putBoolean("system_of_measurement.use_only_lower_unit", true); 78 79 try { 79 80 for (Node n : stopNodes) { … … 105 106 sb.insert(0, SystemOfMeasurement.getSystemOfMeasurement().getDistText(totalLength / lengthN, new DecimalFormat("0"), -1)); 106 107 } finally { 107 Main.pref.putBoolean("system_of_measurement.use_only_lower_unit", onlyLowerUnit);108 Config.getPref().putBoolean("system_of_measurement.use_only_lower_unit", onlyLowerUnit); 108 109 } 109 110 … … 142 143 for (Relation relation : getLayerManager().getEditDataSet().getSelectedRelations()) { 143 144 if (!isRouteSupported(relation)) { 144 JOptionPane.showMessageDialog(Main.parent, "<html>" + tr("A valid public_transport:version=2 route is required") 145 JOptionPane.showMessageDialog(MainApplication.getMainFrame(), 146 "<html>" + tr("A valid public_transport:version=2 route is required") 145 147 + Utils.joinAsHtmlUnorderedList(Collections.singleton(relation.getDisplayName(DefaultNameFormatter.getInstance()))), 146 148 tr("Invalid selection"), JOptionPane.WARNING_MESSAGE); … … 151 153 } 152 154 153 new ExtendedDialog(Main .parent, getValue(NAME).toString(), new String[]{tr("Close")}) {155 new ExtendedDialog(MainApplication.getMainFrame(), getValue(NAME).toString(), new String[]{tr("Close")}) { 154 156 { 155 157 setButtonIcons(new String[]{"ok.png"});
Note:
See TracChangeset
for help on using the changeset viewer.