Changeset 98 in josm for src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java
- Timestamp:
- 2006-04-25T00:11:38+02:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java
r94 r98 40 40 import org.openstreetmap.josm.data.osm.OsmPrimitive; 41 41 import org.openstreetmap.josm.gui.MapFrame; 42 import org.openstreetmap.josm.gui.MapView;43 42 import org.openstreetmap.josm.tools.ImageProvider; 44 43 … … 95 94 96 95 final JOptionPane optionPane = new JOptionPane(p, JOptionPane.QUESTION_MESSAGE, JOptionPane.OK_CANCEL_OPTION); 97 final JDialog dlg = optionPane.createDialog(Main. main, "Change values?");96 final JDialog dlg = optionPane.createDialog(Main.parent, "Change values?"); 98 97 dlg.addWindowFocusListener(new WindowFocusListener(){ 99 98 public void windowGainedFocus(WindowEvent e) { … … 124 123 if (value.equals("")) 125 124 value = null; // delete the key 126 mv.editLayer().add(new ChangePropertyCommand(sel, key, value));125 Main.main.editLayer().add(new ChangePropertyCommand(sel, key, value)); 127 126 128 127 if (value == null) … … 163 162 JTextField values = new JTextField(); 164 163 p2.add(values, BorderLayout.CENTER); 165 int answer = JOptionPane.showConfirmDialog(Main. main, p,164 int answer = JOptionPane.showConfirmDialog(Main.parent, p, 166 165 "Change values?", JOptionPane.OK_CANCEL_OPTION); 167 166 if (answer != JOptionPane.OK_OPTION) … … 171 170 if (value.equals("")) 172 171 return; 173 mv.editLayer().add(new ChangePropertyCommand(sel, key, value));172 Main.main.editLayer().add(new ChangePropertyCommand(sel, key, value)); 174 173 selectionChanged(sel); // update table 175 174 } … … 182 181 String key = data.getValueAt(row, 0).toString(); 183 182 Collection<OsmPrimitive> sel = Main.ds.getSelected(); 184 mv.editLayer().add(new ChangePropertyCommand(sel, key, null));183 Main.main.editLayer().add(new ChangePropertyCommand(sel, key, null)); 185 184 selectionChanged(sel); // update table 186 185 } … … 201 200 */ 202 201 private final JTable propertyTable = new JTable(data); 203 /**204 * The map view this dialog operates on.205 */206 private final MapView mv;207 202 208 203 /** … … 211 206 public PropertiesDialog(MapFrame mapFrame) { 212 207 super("Properties", "propertiesdialog", "Property for selected objects.", KeyEvent.VK_P); 213 mv = mapFrame.mapView;214 208 215 209 setPreferredSize(new Dimension(320,150)); … … 248 242 else if (e.getActionCommand().equals("Edit")) { 249 243 if (sel == -1) 250 JOptionPane.showMessageDialog(Main. main, "Please select the row to edit.");244 JOptionPane.showMessageDialog(Main.parent, "Please select the row to edit."); 251 245 else 252 246 edit(sel); 253 247 } else if (e.getActionCommand().equals("Delete")) { 254 248 if (sel == -1) 255 JOptionPane.showMessageDialog(Main. main, "Please select the row to delete.");249 JOptionPane.showMessageDialog(Main.parent, "Please select the row to delete."); 256 250 else 257 251 delete(sel);
Note:
See TracChangeset
for help on using the changeset viewer.
