Changeset 20044 in osm for applications
- Timestamp:
- 2010-02-17T17:01:54+01:00 (15 years ago)
- Location:
- applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/TagEditorDialog.java
r18385 r20044 32 32 import org.openstreetmap.josm.data.osm.DataSet; 33 33 import org.openstreetmap.josm.data.osm.OsmPrimitive; 34 import org.openstreetmap.josm. plugins.tageditor.ac.AutoCompletionCache;35 import org.openstreetmap.josm. plugins.tageditor.ac.AutoCompletionList;34 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionCache; 35 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionList; 36 36 import org.openstreetmap.josm.plugins.tageditor.ac.AutoCompletionListViewer; 37 37 import org.openstreetmap.josm.plugins.tageditor.editor.TagEditor; … … 306 306 model.clearAppliedPresets(); 307 307 model.initFromJOSMSelection(); 308 acCache.initFromJOSMDataset(); 308 //acCache.initFromJOSMDataset(); 309 309 getModel().ensureOneTag(); 310 310 } -
applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/ac/AutoCompletionListViewer.java
r17638 r20044 19 19 import javax.swing.ListSelectionModel; 20 20 import javax.swing.table.DefaultTableModel; 21 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionList; 21 22 22 /**23 *24 *25 *26 */27 @SuppressWarnings("serial")28 23 public class AutoCompletionListViewer extends JPanel { 29 24 -
applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/TableCellEditor.java
r15319 r20044 40 40 private AutoCompletionList autoCompletionList = null; 41 41 42 43 42 /** 44 43 * constructor … … 77 76 logger.log(Level.WARNING, "failed to initialize auto completion list with standard keys.", e); 78 77 } 79 80 81 78 82 79 // add the list of keys in the current data set … … 246 243 this.tagEditorModel = tagEditorModel; 247 244 } 248 249 245 } -
applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/TagEditor.java
r15319 r20044 2 2 3 3 import java.awt.BorderLayout; 4 import java.awt.Dimension;5 import java.awt.event.ComponentAdapter;6 import java.awt.event.ComponentEvent;7 4 import java.util.logging.Logger; 8 5 … … 11 8 import javax.swing.ScrollPaneConstants; 12 9 13 import org.openstreetmap.josm.plugins.tageditor.ac.AutoCompletionCache; 14 import org.openstreetmap.josm.plugins.tageditor.ac.AutoCompletionList; 10 import org.openstreetmap.josm.gui.dialogs.relation.RunnableAction; 11 import org.openstreetmap.josm.gui.tagging.TagTable; 12 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionCache; 13 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionList; 15 14 import org.openstreetmap.josm.plugins.tageditor.ac.IAutoCompletionListListener; 16 15 … … 78 77 // getPreferredViewportSize() in JTable, but did not work. 79 78 // 80 scrollPane.addComponentListener( 81 new ComponentAdapter() { 82 @Override public void componentResized(ComponentEvent e) { 83 super.componentResized(e); 84 Dimension d = scrollPane.getViewport().getExtentSize(); 85 tblTagEditor.adjustColumnWidth(d.width); 86 } 87 } 88 ); 79 // scrollPane.addComponentListener( 80 // new ComponentAdapter() { 81 // @Override public void componentResized(ComponentEvent e) { 82 // super.componentResized(e); 83 // Dimension d = scrollPane.getViewport().getExtentSize(); 84 // tblTagEditor.adjustColumnWidth(d.width); 85 // } 86 // } 87 // ); 89 88 90 89 // build the preset manager which shows a list of applied presets … … 140 139 } 141 140 142 143 144 141 public void clearSelection() { 145 142 tblTagEditor.getSelectionModel().clearSelection(); 146 143 } 147 148 149 144 150 145 public void stopEditing() { … … 155 150 } 156 151 157 158 152 public AutoCompletionList getAutoCompletionList() { 159 return ((org.openstreetmap.josm.plugins.tageditor.editor.TableCellEditor)tblTagEditor.getCellEditor()).getAutoCompletionList(); 153 return null; 154 //return ((org.openstreetmap.josm.gui.tagging.TagCellEditor)tblTagEditor.getCellEditor()).getAutoCompletionList(); 160 155 } 161 156 … … 167 162 tblTagEditor.setAutoCompletionCache(acCache); 168 163 } 169 170 164 171 165 public void autoCompletionItemSelected(String item) { … … 179 173 tblTagEditor.requestFocusInCell(0,0); 180 174 } 181 182 183 184 185 186 187 175 } -
applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/TagTable.java
r15319 r20044 32 32 import org.openstreetmap.josm.plugins.tageditor.ac.AutoCompletionList; 33 33 34 35 34 /** 36 35 * This is the tabular editor component for OSM tags. 37 36 * 38 *39 * @author Gubaer40 *41 37 */ 42 38 @SuppressWarnings("serial") 43 39 public class TagTable extends JTable { 44 45 40 private static Logger logger = Logger.getLogger(TagTable.class.getName()); 46 47 48 41 49 42 /** the table cell editor used by this table */ 50 43 private TableCellEditor editor = null; 51 52 53 44 54 45 /** … … 65 56 TableColumn col = null; 66 57 TableCellRenderer renderer = new TableCellRenderer(); 67 68 58 69 59 // column 0 - tag key … … 83 73 } 84 74 } 85 86 75 87 76 /** … … 217 206 getColumnModel().getSelectionModel().addListSelectionListener(this); 218 207 } 219 220 221 208 222 209 @Override … … 233 220 // should not happen 234 221 // 235 throw new IllegalStateException("unexpected selected c lolumn: getSelectedColumn() is " + getSelectedColumn());222 throw new IllegalStateException("unexpected selected column: getSelectedColumn() is " + getSelectedColumn()); 236 223 } else if (getSelectedColumnCount() == 2) { 237 224 deleteTags(); … … 257 244 setEnabled(false); 258 245 } 259 260 246 } 261 247 } … … 300 286 } 301 287 302 303 288 /** 304 289 * initialize the table 305 290 */ 306 291 protected void init() { 307 308 309 292 setAutoResizeMode(JTable.AUTO_RESIZE_OFF); 310 293 setCellSelectionEnabled(true); 311 294 setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION); 312 313 314 295 315 296 // make ENTER behave like TAB … … 335 316 getActionMap().put("addTag", addAction); 336 317 337 338 318 // create the table cell editor and set it to key and value columns 339 319 // … … 342 322 getColumnModel().getColumn(0).setCellEditor(editor); 343 323 getColumnModel().getColumn(1).setCellEditor(editor); 344 324 325 345 326 } 346 327 … … 355 336 init(); 356 337 } 357 358 359 338 360 339 /** … … 378 357 } 379 358 380 381 359 @Override protected boolean processKeyBinding(KeyStroke ks, KeyEvent e, 382 360 int condition, boolean pressed) { … … 389 367 return super.processKeyBinding(ks, e, condition, pressed); 390 368 } 391 392 369 393 370 /** … … 464 441 return; 465 442 } 466 467 } 468 469 443 } 470 444 }
Note:
See TracChangeset
for help on using the changeset viewer.