Changeset 33016 in osm
- Timestamp:
- 2016-09-28T02:01:20+02:00 (8 years ago)
- Location:
- applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor
- Files:
-
- 1 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/TagEditorDialog.java
r32959 r33016 30 30 import org.openstreetmap.josm.data.osm.DataSet; 31 31 import org.openstreetmap.josm.data.osm.OsmPrimitive; 32 import org.openstreetmap.josm.data.osm.Tag; 32 33 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionList; 33 34 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionManager; … … 38 39 import org.openstreetmap.josm.plugins.tageditor.preset.ui.IPresetSelectorListener; 39 40 import org.openstreetmap.josm.plugins.tageditor.preset.ui.TabularPresetSelector; 40 import org.openstreetmap.josm.plugins.tageditor.tagspec.KeyValuePair;41 41 import org.openstreetmap.josm.plugins.tageditor.tagspec.ui.ITagSelectorListener; 42 42 import org.openstreetmap.josm.plugins.tageditor.tagspec.ui.TabularTagSelector; … … 176 176 new ITagSelectorListener() { 177 177 @Override 178 public void itemSelected( KeyValuePairpair) {178 public void itemSelected(Tag pair) { 179 179 tagEditor.stopEditing(); 180 180 tagEditor.getModel().applyKeyValuePair(pair); -
applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/TagEditorModel.java
r32959 r33016 14 14 import org.openstreetmap.josm.command.SequenceCommand; 15 15 import org.openstreetmap.josm.data.osm.OsmPrimitive; 16 import org.openstreetmap.josm.data.osm.Tag; 16 17 import org.openstreetmap.josm.gui.tagging.TagModel; 17 18 import org.openstreetmap.josm.gui.tagging.presets.TaggingPreset; 18 19 import org.openstreetmap.josm.plugins.tageditor.preset.AdvancedTag; 19 import org.openstreetmap.josm.plugins.tageditor.tagspec.KeyValuePair;20 20 21 21 @SuppressWarnings("serial") … … 84 84 85 85 /** 86 * applies a tag given by a {@see KeyValuePair} to the model86 * applies a tag given by a {@see Tag} to the model 87 87 * 88 88 * @param pair the key value pair 89 89 */ 90 public void applyKeyValuePair( KeyValuePairpair) {90 public void applyKeyValuePair(Tag pair) { 91 91 TagModel tagModel = get(pair.getKey()); 92 92 if (tagModel == null) { -
applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/TagSpecifications.java
r32959 r33016 12 12 import java.util.logging.Logger; 13 13 14 import org.openstreetmap.josm.data.osm.Tag; 14 15 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionItemPriority; 15 16 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionListItem; … … 163 164 * @return the list 164 165 */ 165 public ArrayList< KeyValuePair> asList() {166 ArrayList< KeyValuePair> entries = new ArrayList<>();166 public ArrayList<Tag> asList() { 167 ArrayList<Tag> entries = new ArrayList<>(); 167 168 168 169 for (TagSpecification s : tagSpecifications) { 169 170 for (LabelSpecification l : s.getLables()) { 170 entries.add(new KeyValuePair(s.getKey(), l.getValue()));171 entries.add(new Tag(s.getKey(), l.getValue())); 171 172 } 172 173 } -
applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/ui/ITagSelectorListener.java
r32959 r33016 2 2 package org.openstreetmap.josm.plugins.tageditor.tagspec.ui; 3 3 4 import org.openstreetmap.josm. plugins.tageditor.tagspec.KeyValuePair;4 import org.openstreetmap.josm.data.osm.Tag; 5 5 6 6 public interface ITagSelectorListener { 7 void itemSelected( KeyValuePairpair);7 void itemSelected(Tag pair); 8 8 } -
applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/ui/TabularTagSelector.java
r32959 r33016 30 30 import javax.swing.event.ListSelectionListener; 31 31 32 import org.openstreetmap.josm. plugins.tageditor.tagspec.KeyValuePair;32 import org.openstreetmap.josm.data.osm.Tag; 33 33 34 34 public class TabularTagSelector extends JPanel { … … 97 97 int rowNum = tagsTable.getSelectedRow(); 98 98 if (rowNum >= 0) { 99 KeyValuePairitem = getModel().getVisibleItem(rowNum);99 Tag item = getModel().getVisibleItem(rowNum); 100 100 fireItemSelected(item); 101 101 } … … 124 124 int row = tagsTable.getSelectedRow(); 125 125 if (row >= 0) { 126 KeyValuePairitem = getModel().getVisibleItem(row);126 Tag item = getModel().getVisibleItem(row); 127 127 fireItemSelected(item); 128 128 } … … 236 236 } 237 237 238 protected void fireItemSelected( KeyValuePairpair) {238 protected void fireItemSelected(Tag pair) { 239 239 synchronized (this.listeners) { 240 240 for (ITagSelectorListener listener: listeners) { … … 249 249 if (e.getClickCount() == 2) { 250 250 int rowNum = tagsTable.rowAtPoint(e.getPoint()); 251 KeyValuePairpair = getModel().getVisibleItem(rowNum);251 Tag pair = getModel().getVisibleItem(rowNum); 252 252 fireItemSelected(pair); 253 253 } -
applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/ui/TagsTableModel.java
r32959 r33016 12 12 import javax.swing.table.AbstractTableModel; 13 13 14 import org.openstreetmap.josm. plugins.tageditor.tagspec.KeyValuePair;14 import org.openstreetmap.josm.data.osm.Tag; 15 15 import org.openstreetmap.josm.plugins.tageditor.tagspec.TagSpecifications; 16 16 … … 19 19 private static Logger logger = Logger.getLogger(TagsTableModel.class.getName()); 20 20 21 private ArrayList< KeyValuePair> items = null;22 private ArrayList< KeyValuePair> visibleItems = null;21 private ArrayList<Tag> items = null; 22 private ArrayList<Tag> visibleItems = null; 23 23 24 24 public TagsTableModel() { … … 30 30 Collections.sort( 31 31 items, 32 new Comparator< KeyValuePair>() {32 new Comparator<Tag>() { 33 33 @Override 34 public int compare(KeyValuePair self, 35 KeyValuePair other) { 34 public int compare(Tag self, Tag other) { 36 35 int ret = self.getKey().compareToIgnoreCase(other.getKey()); 37 36 … … 63 62 items = spec.asList(); 64 63 sort(); 65 for ( KeyValuePairitem : items) {64 for (Tag item : items) { 66 65 visibleItems.add(item); 67 66 } … … 80 79 @Override 81 80 public Object getValueAt(int row, int col) { 82 KeyValuePairpair = visibleItems.get(row);81 Tag pair = visibleItems.get(row); 83 82 switch(col) { 84 83 case 0: return pair.getKey(); … … 94 93 if (filter == null || filter.trim().equals("")) { 95 94 visibleItems.clear(); 96 for ( KeyValuePairpair: items) {95 for (Tag pair: items) { 97 96 visibleItems.add(pair); 98 97 } … … 100 99 visibleItems.clear(); 101 100 filter = filter.toLowerCase(); 102 for ( KeyValuePairpair: items) {101 for (Tag pair: items) { 103 102 if (pair.getKey().toLowerCase().trim().startsWith(filter) 104 103 || pair.getValue().toLowerCase().trim().startsWith(filter)) { … … 117 116 } 118 117 119 public KeyValuePairgetVisibleItem(int row) {118 public Tag getVisibleItem(int row) { 120 119 if (row < 0 || row >= visibleItems.size()) 121 120 throw new IndexOutOfBoundsException("row is out of bound: row=" + row);
Note:
See TracChangeset
for help on using the changeset viewer.