Changeset 33394 in osm for applications/editors/josm/plugins/globalsat
- Timestamp:
- 2017-06-13T22:43:27+02:00 (7 years ago)
- Location:
- applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatConfigDialog.java
r32958 r33394 11 11 import java.awt.Insets; 12 12 import java.awt.event.KeyEvent; 13 import java.util.Objects; 13 14 14 15 import javax.swing.AbstractButton; … … 77 78 78 79 public GlobalsatConfigDialog(Dg100Config config) { 79 conf = config;80 conf = Objects.requireNonNull(config); 80 81 GridBagConstraints c = new GridBagConstraints(); 81 82 -
applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatImportDialog.java
r32649 r33394 20 20 import javax.swing.ListCellRenderer; 21 21 22 import org.kaintoch.gps.globalsat.dg100.Dg100Config; 22 23 import org.openstreetmap.josm.Main; 23 24 … … 98 99 @Override 99 100 public void actionPerformed(java.awt.event.ActionEvent e) { 100 System.out.println("configur eing the device");101 System.out.println("configuring the device"); 101 102 try { 102 103 GlobalsatConfigDialog dialog = new GlobalsatConfigDialog(GlobalsatPlugin.dg100().getConfig()); 104 JOptionPane pane = new JOptionPane(dialog, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION); 105 JDialog dlg = pane.createDialog(Main.parent, tr("Configure Device")); 106 dlg.setVisible(true); 107 if (((Integer) pane.getValue()) == JOptionPane.OK_OPTION) { 108 GlobalsatPlugin.dg100().setConfig(dialog.getConfig()); 103 Dg100Config conf = GlobalsatPlugin.dg100().getConfig(); 104 if (conf != null) { 105 GlobalsatConfigDialog dialog = new GlobalsatConfigDialog(conf); 106 JOptionPane pane = new JOptionPane(dialog, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION); 107 JDialog dlg = pane.createDialog(Main.parent, tr("Configure Device")); 108 dlg.setVisible(true); 109 if (((Integer) pane.getValue()) == JOptionPane.OK_OPTION) { 110 GlobalsatPlugin.dg100().setConfig(dialog.getConfig()); 111 } 112 dlg.dispose(); 113 } else { 114 JOptionPane.showMessageDialog(Main.parent, tr("Connection Error."), tr("Connection Error."), JOptionPane.ERROR); 109 115 } 110 dlg.dispose();111 112 116 } catch (GlobalsatDg100.ConnectionException ex) { 113 117 JOptionPane.showMessageDialog(Main.parent, tr("Connection Error.") + " " + ex.toString()); 114 118 } 115 System.out.println("configur eing the device finised");119 System.out.println("configuring the device finished"); 116 120 } 117 121 });
Note:
See TracChangeset
for help on using the changeset viewer.