Changeset 34555 in osm for applications/editors/josm/plugins/seachartedit/src
- Timestamp:
- 2018-08-18T20:15:48+02:00 (6 years ago)
- Location:
- applications/editors/josm/plugins/seachartedit/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/seachartedit/src/panels/PanelMain.java
r33030 r34555 28 28 import javax.swing.JTextField; 29 29 30 import org.openstreetmap.josm.Main; 30 import org.openstreetmap.josm.gui.MainApplication; 31 import org.openstreetmap.josm.spi.preferences.Config; 31 32 32 33 import messages.Messages; … … 52 53 }; 53 54 private JButton importButton = null; 54 JFileChooser ifc = new JFileChooser( Main.pref.get("nceditplugin.encinpfile"));55 JFileChooser ifc = new JFileChooser(Config.getPref().get("nceditplugin.encinpfile")); 55 56 private ActionListener alImport = new ActionListener() { 56 57 @Override … … 59 60 SCeditAction.panelS57.setVisible(true); 60 61 setStatus("Select S-57 ENC file for import", Color.yellow); 61 int returnVal = ifc.showOpenDialog(Main .parent);62 int returnVal = ifc.showOpenDialog(MainApplication.getMainFrame()); 62 63 if (returnVal == JFileChooser.APPROVE_OPTION) { 63 64 try { 64 Main.pref.put("smed2plugin.encinpfile", ifc.getSelectedFile().getPath());65 Config.getPref().put("smed2plugin.encinpfile", ifc.getSelectedFile().getPath()); 65 66 SCeditAction.panelS57.startImport(ifc.getSelectedFile()); 66 67 } catch (IOException e1) { … … 84 85 SCeditAction.panelS57.setVisible(true); 85 86 setStatus("Select S-57 ENC file for export", Color.yellow); 86 int returnVal = efc.showOpenDialog(Main .parent);87 int returnVal = efc.showOpenDialog(MainApplication.getMainFrame()); 87 88 if (returnVal == JFileChooser.APPROVE_OPTION) { 88 89 try { -
applications/editors/josm/plugins/seachartedit/src/panels/PanelS57.java
r34098 r34555 23 23 import javax.swing.JPanel; 24 24 25 import org.openstreetmap.josm.Main;26 25 import org.openstreetmap.josm.data.Bounds; 27 26 import org.openstreetmap.josm.data.coor.LatLon; 28 27 import org.openstreetmap.josm.data.osm.DataSet; 29 import org.openstreetmap.josm.data.osm.UploadPolicy;30 28 import org.openstreetmap.josm.data.osm.Node; 31 29 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 33 31 import org.openstreetmap.josm.data.osm.Relation; 34 32 import org.openstreetmap.josm.data.osm.RelationMember; 33 import org.openstreetmap.josm.data.osm.UploadPolicy; 35 34 import org.openstreetmap.josm.data.osm.Way; 36 35 import org.openstreetmap.josm.gui.MainApplication; 37 36 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 37 import org.openstreetmap.josm.spi.preferences.Config; 38 38 39 39 import s57.S57att; … … 69 69 FileInputStream in = new FileInputStream(inf); 70 70 PanelMain.setStatus("Select OSM types file", Color.yellow); 71 JFileChooser ifc = new JFileChooser( Main.pref.get("smed2plugin.typesfile"));72 ifc.setSelectedFile(new File( Main.pref.get("smed2plugin.typesfile")));73 int returnVal = ifc.showOpenDialog(Main .parent);71 JFileChooser ifc = new JFileChooser(Config.getPref().get("smed2plugin.typesfile")); 72 ifc.setSelectedFile(new File(Config.getPref().get("smed2plugin.typesfile"))); 73 int returnVal = ifc.showOpenDialog(MainApplication.getMainFrame()); 74 74 if (returnVal == JFileChooser.APPROVE_OPTION) { 75 Main.pref.put("smed2plugin.typesfile", ifc.getSelectedFile().getPath());75 Config.getPref().put("smed2plugin.typesfile", ifc.getSelectedFile().getPath()); 76 76 Scanner tin = new Scanner(new FileInputStream(ifc.getSelectedFile()), "UTF-8"); 77 77 while (tin.hasNext()) { -
applications/editors/josm/plugins/seachartedit/src/scedit/SCeditAction.java
r34098 r34555 15 15 import java.awt.Dimension; 16 16 import java.awt.event.ActionEvent; 17 import java.util.Collection;18 17 import java.util.Map.Entry; 18 import java.util.Set; 19 19 20 20 import javax.swing.JFrame; … … 24 24 import org.openstreetmap.josm.actions.JosmAction; 25 25 import org.openstreetmap.josm.data.Bounds; 26 import org.openstreetmap.josm.data.SelectionChangedListener;27 26 import org.openstreetmap.josm.data.coor.LatLon; 27 import org.openstreetmap.josm.data.osm.DataSelectionListener; 28 28 import org.openstreetmap.josm.data.osm.DataSet; 29 29 import org.openstreetmap.josm.data.osm.Node; … … 40 40 import org.openstreetmap.josm.data.osm.event.PrimitivesRemovedEvent; 41 41 import org.openstreetmap.josm.data.osm.event.RelationMembersChangedEvent; 42 import org.openstreetmap.josm.data.osm.event.SelectionEventManager; 42 43 import org.openstreetmap.josm.data.osm.event.TagsChangedEvent; 43 44 import org.openstreetmap.josm.data.osm.event.WayNodesChangedEvent; … … 52 53 import s57.S57map.Feature; 53 54 54 public class SCeditAction extends JosmAction implements ActiveLayerChangeListener, Selection ChangedListener {55 public class SCeditAction extends JosmAction implements ActiveLayerChangeListener, DataSelectionListener { 55 56 private static String title = tr("SeaChart Editor"); 56 57 public static JFrame editFrame = null; … … 152 153 153 154 getLayerManager().addAndFireActiveLayerChangeListener(this); 154 DataSet.addSelectionListener(this);155 SelectionEventManager.getInstance().addSelectionListener(this); 155 156 } 156 157 … … 183 184 184 185 @Override 185 public void selectionChanged( Collection<? extends OsmPrimitive> selection) {186 public void selectionChanged(SelectionChangeEvent event) { 186 187 OsmPrimitive nextFeature = null; 187 188 OsmPrimitive feature = null; … … 190 191 panelMain.clearMark(); 191 192 if (map != null) { 193 Set<OsmPrimitive> selection = event.getSelection(); 192 194 for (OsmPrimitive osm : selection) { 193 195 nextFeature = osm;
Note:
See TracChangeset
for help on using the changeset viewer.