Changeset 33806 in osm for applications/editors/josm
- Timestamp:
- 2017-11-13T00:34:15+01:00 (7 years ago)
- Location:
- applications/editors/josm/plugins/tageditor
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/tageditor/build.xml
r33579 r33806 2 2 <project name="tageditor" default="dist" basedir="."> 3 3 <property name="commit.message" value="Tageditor: help shortcut parser, rebuild"/> 4 <property name="plugin.main.version" value="12 678"/>4 <property name="plugin.main.version" value="12859"/> 5 5 6 6 <property name="plugin.author" value="Karl Guggisberg"/> -
applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/TagEditorDialog.java
r33579 r33806 28 28 29 29 import org.openstreetmap.josm.Main; 30 import org.openstreetmap.josm.data.osm.DataSet;31 30 import org.openstreetmap.josm.data.osm.OsmPrimitive; 32 31 import org.openstreetmap.josm.data.osm.Tag; … … 283 282 tagEditor.getModel().clearAppliedPresets(); 284 283 tagEditor.getModel().initFromJOSMSelection(); 285 autocomplete = MainApplication.getLayerManager().getEditLayer().data.getAutoCompletionManager();284 autocomplete = AutoCompletionManager.of(MainApplication.getLayerManager().getEditLayer().data); 286 285 tagEditor.setAutoCompletionManager(autocomplete); 287 286 getModel().ensureOneTag(); … … 320 319 setVisible(false); 321 320 tagEditor.getModel().updateJOSMSelection(); 322 DataSet ds = MainApplication.getLayerManager().getEditDataSet();323 ds.fireSelectionChanged();324 321 Main.parent.repaint(); // repaint all - drawing could have been changed 325 322 } -
applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/ac/AutoCompletionListRenderer.java
r32959 r33806 15 15 import javax.swing.table.TableCellRenderer; 16 16 17 import org.openstreetmap.josm. gui.tagging.ac.AutoCompletionItemPriority;18 import org.openstreetmap.josm. gui.tagging.ac.AutoCompletionListItem;17 import org.openstreetmap.josm.data.tagging.ac.AutoCompletionItem; 18 import org.openstreetmap.josm.data.tagging.ac.AutoCompletionPriority; 19 19 20 20 /** … … 28 28 29 29 /** the icon used to decorate items of priority 30 * {@link AutoCompletion ItemPriority#IS_IN_STANDARD}30 * {@link AutoCompletionPriority#IS_IN_STANDARD} 31 31 */ 32 32 private Icon iconStandard; 33 33 34 34 /** the icon used to decorate items of priority 35 * {@link AutoCompletion ItemPriority#IS_IN_SELECTION}35 * {@link AutoCompletionPriority#IS_IN_SELECTION} 36 36 */ 37 37 private Icon iconSelection; … … 71 71 * @param item the item to be rendered 72 72 */ 73 protected void prepareRendererIcon(AutoCompletion ListItem item) {74 if (item.getPriority().equals(AutoCompletion ItemPriority.IS_IN_STANDARD)) {73 protected void prepareRendererIcon(AutoCompletionItem item) { 74 if (item.getPriority().equals(AutoCompletionPriority.IS_IN_STANDARD)) { 75 75 if (iconStandard != null) { 76 76 setIcon(iconStandard); 77 77 } 78 } else if (item.getPriority().equals(AutoCompletion ItemPriority.IS_IN_SELECTION)) {78 } else if (item.getPriority().equals(AutoCompletionPriority.IS_IN_SELECTION)) { 79 79 if (iconSelection != null) { 80 80 setIcon(iconSelection); … … 110 110 // set icon and text 111 111 // 112 if (value instanceof AutoCompletion ListItem) {113 AutoCompletion ListItem item = (AutoCompletionListItem) value;112 if (value instanceof AutoCompletionItem) { 113 AutoCompletionItem item = (AutoCompletionItem) value; 114 114 prepareRendererIcon(item); 115 115 setText(item.getValue()); -
applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/ac/AutoCompletionListViewer.java
r33020 r33806 77 77 if (e.getClickCount() == 2) { 78 78 int row = table.getSelectedRow(); 79 String item = autoCompletionList.getFilteredItem (row).getValue();79 String item = autoCompletionList.getFilteredItemAt(row).getValue(); 80 80 fireAutoCompletionListItemSelected(item); 81 81 } -
applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/TagSpecificationAwareTagCellEditor.java
r32959 r33806 4 4 import java.util.logging.Logger; 5 5 6 import org.openstreetmap.josm.data.tagging.ac.AutoCompletionItem; 7 import org.openstreetmap.josm.data.tagging.ac.AutoCompletionPriority; 6 8 import org.openstreetmap.josm.gui.tagging.TagCellEditor; 7 9 import org.openstreetmap.josm.gui.tagging.TagModel; 8 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionItemPriority;9 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionListItem;10 10 import org.openstreetmap.josm.plugins.tageditor.ac.AutoCompletionContext; 11 11 import org.openstreetmap.josm.plugins.tageditor.tagspec.TagSpecifications; … … 100 100 //logger.info("adding ac item " + value + " with priority IN_SELECTION");; 101 101 autoCompletionList.add( 102 new AutoCompletion ListItem(value, AutoCompletionItemPriority.IS_IN_SELECTION)102 new AutoCompletionItem(value, AutoCompletionPriority.IS_IN_SELECTION) 103 103 ); 104 104 } -
applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/TagSpecifications.java
r33021 r33806 14 14 15 15 import org.openstreetmap.josm.data.osm.Tag; 16 import org.openstreetmap.josm. gui.tagging.ac.AutoCompletionItemPriority;17 import org.openstreetmap.josm. gui.tagging.ac.AutoCompletionListItem;16 import org.openstreetmap.josm.data.tagging.ac.AutoCompletionItem; 17 import org.openstreetmap.josm.data.tagging.ac.AutoCompletionPriority; 18 18 import org.openstreetmap.josm.plugins.tageditor.ac.AutoCompletionContext; 19 19 import org.xml.sax.Attributes; … … 126 126 } 127 127 128 public List<AutoCompletion ListItem> getKeysForAutoCompletion(AutoCompletionContext context) {129 ArrayList<AutoCompletion ListItem> keys = new ArrayList<>();128 public List<AutoCompletionItem> getKeysForAutoCompletion(AutoCompletionContext context) { 129 ArrayList<AutoCompletionItem> keys = new ArrayList<>(); 130 130 for (TagSpecification spec : tagSpecifications) { 131 131 if (!spec.isApplicable(context)) { 132 132 continue; 133 133 } 134 AutoCompletionListItem item = new AutoCompletionListItem(); 135 item.setValue(spec.getKey()); 136 item.setPriority(AutoCompletionItemPriority.IS_IN_STANDARD); 137 keys.add(item); 134 keys.add(new AutoCompletionItem(spec.getKey(), AutoCompletionPriority.IS_IN_STANDARD)); 138 135 } 139 136 return keys; 140 137 } 141 138 142 public List<AutoCompletion ListItem> getLabelsForAutoCompletion(String forKey, AutoCompletionContext context) {143 ArrayList<AutoCompletion ListItem> items = new ArrayList<>();139 public List<AutoCompletionItem> getLabelsForAutoCompletion(String forKey, AutoCompletionContext context) { 140 ArrayList<AutoCompletionItem> items = new ArrayList<>(); 144 141 for (TagSpecification spec : tagSpecifications) { 145 142 if (spec.getKey().equals(forKey)) { … … 149 146 continue; 150 147 } 151 AutoCompletionListItem item = new AutoCompletionListItem(); 152 item.setValue(l.getValue()); 153 item.setPriority(AutoCompletionItemPriority.IS_IN_STANDARD); 154 items.add(item); 148 items.add(new AutoCompletionItem(l.getValue(), AutoCompletionPriority.IS_IN_STANDARD)); 155 149 } 156 150 }
Note:
See TracChangeset
for help on using the changeset viewer.