Changeset 33806 in osm for applications/editors/josm


Ignore:
Timestamp:
2017-11-13T00:34:15+01:00 (7 years ago)
Author:
donvip
Message:

update to JOSM 12859

Location:
applications/editors/josm/plugins/tageditor
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/tageditor/build.xml

    r33579 r33806  
    22<project name="tageditor" default="dist" basedir=".">
    33    <property name="commit.message" value="Tageditor:  help shortcut parser, rebuild"/>
    4     <property name="plugin.main.version" value="12678"/>
     4    <property name="plugin.main.version" value="12859"/>
    55   
    66        <property name="plugin.author" value="Karl Guggisberg"/>
  • applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/TagEditorDialog.java

    r33579 r33806  
    2828
    2929import org.openstreetmap.josm.Main;
    30 import org.openstreetmap.josm.data.osm.DataSet;
    3130import org.openstreetmap.josm.data.osm.OsmPrimitive;
    3231import org.openstreetmap.josm.data.osm.Tag;
     
    283282        tagEditor.getModel().clearAppliedPresets();
    284283        tagEditor.getModel().initFromJOSMSelection();
    285         autocomplete = MainApplication.getLayerManager().getEditLayer().data.getAutoCompletionManager();
     284        autocomplete = AutoCompletionManager.of(MainApplication.getLayerManager().getEditLayer().data);
    286285        tagEditor.setAutoCompletionManager(autocomplete);
    287286        getModel().ensureOneTag();
     
    320319            setVisible(false);
    321320            tagEditor.getModel().updateJOSMSelection();
    322             DataSet ds = MainApplication.getLayerManager().getEditDataSet();
    323             ds.fireSelectionChanged();
    324321            Main.parent.repaint(); // repaint all - drawing could have been changed
    325322        }
  • applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/ac/AutoCompletionListRenderer.java

    r32959 r33806  
    1515import javax.swing.table.TableCellRenderer;
    1616
    17 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionItemPriority;
    18 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionListItem;
     17import org.openstreetmap.josm.data.tagging.ac.AutoCompletionItem;
     18import org.openstreetmap.josm.data.tagging.ac.AutoCompletionPriority;
    1919
    2020/**
     
    2828
    2929    /** the icon used to decorate items of priority
    30      *  {@link AutoCompletionItemPriority#IS_IN_STANDARD}
     30     *  {@link AutoCompletionPriority#IS_IN_STANDARD}
    3131     */
    3232    private Icon iconStandard;
    3333
    3434    /** the icon used to decorate items of priority
    35      *  {@link AutoCompletionItemPriority#IS_IN_SELECTION}
     35     *  {@link AutoCompletionPriority#IS_IN_SELECTION}
    3636     */
    3737    private Icon iconSelection;
     
    7171     * @param item the item to be rendered
    7272     */
    73     protected void prepareRendererIcon(AutoCompletionListItem item) {
    74         if (item.getPriority().equals(AutoCompletionItemPriority.IS_IN_STANDARD)) {
     73    protected void prepareRendererIcon(AutoCompletionItem item) {
     74        if (item.getPriority().equals(AutoCompletionPriority.IS_IN_STANDARD)) {
    7575            if (iconStandard != null) {
    7676                setIcon(iconStandard);
    7777            }
    78         } else if (item.getPriority().equals(AutoCompletionItemPriority.IS_IN_SELECTION)) {
     78        } else if (item.getPriority().equals(AutoCompletionPriority.IS_IN_SELECTION)) {
    7979            if (iconSelection != null) {
    8080                setIcon(iconSelection);
     
    110110        // set icon and text
    111111        //
    112         if (value instanceof AutoCompletionListItem) {
    113             AutoCompletionListItem item = (AutoCompletionListItem) value;
     112        if (value instanceof AutoCompletionItem) {
     113            AutoCompletionItem item = (AutoCompletionItem) value;
    114114            prepareRendererIcon(item);
    115115            setText(item.getValue());
  • applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/ac/AutoCompletionListViewer.java

    r33020 r33806  
    7777                        if (e.getClickCount() == 2) {
    7878                            int row = table.getSelectedRow();
    79                             String item = autoCompletionList.getFilteredItem(row).getValue();
     79                            String item = autoCompletionList.getFilteredItemAt(row).getValue();
    8080                            fireAutoCompletionListItemSelected(item);
    8181                        }
  • applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/TagSpecificationAwareTagCellEditor.java

    r32959 r33806  
    44import java.util.logging.Logger;
    55
     6import org.openstreetmap.josm.data.tagging.ac.AutoCompletionItem;
     7import org.openstreetmap.josm.data.tagging.ac.AutoCompletionPriority;
    68import org.openstreetmap.josm.gui.tagging.TagCellEditor;
    79import org.openstreetmap.josm.gui.tagging.TagModel;
    8 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionItemPriority;
    9 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionListItem;
    1010import org.openstreetmap.josm.plugins.tageditor.ac.AutoCompletionContext;
    1111import org.openstreetmap.josm.plugins.tageditor.tagspec.TagSpecifications;
     
    100100                //logger.info("adding ac item " + value + " with priority IN_SELECTION");;
    101101                autoCompletionList.add(
    102                         new AutoCompletionListItem(value, AutoCompletionItemPriority.IS_IN_SELECTION)
     102                        new AutoCompletionItem(value, AutoCompletionPriority.IS_IN_SELECTION)
    103103                );
    104104            }
  • applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/TagSpecifications.java

    r33021 r33806  
    1414
    1515import org.openstreetmap.josm.data.osm.Tag;
    16 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionItemPriority;
    17 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionListItem;
     16import org.openstreetmap.josm.data.tagging.ac.AutoCompletionItem;
     17import org.openstreetmap.josm.data.tagging.ac.AutoCompletionPriority;
    1818import org.openstreetmap.josm.plugins.tageditor.ac.AutoCompletionContext;
    1919import org.xml.sax.Attributes;
     
    126126    }
    127127
    128     public List<AutoCompletionListItem> getKeysForAutoCompletion(AutoCompletionContext context) {
    129         ArrayList<AutoCompletionListItem> keys = new ArrayList<>();
     128    public List<AutoCompletionItem> getKeysForAutoCompletion(AutoCompletionContext context) {
     129        ArrayList<AutoCompletionItem> keys = new ArrayList<>();
    130130        for (TagSpecification spec : tagSpecifications) {
    131131            if (!spec.isApplicable(context)) {
    132132                continue;
    133133            }
    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));
    138135        }
    139136        return keys;
    140137    }
    141138
    142     public List<AutoCompletionListItem> getLabelsForAutoCompletion(String forKey, AutoCompletionContext context) {
    143         ArrayList<AutoCompletionListItem> items = new ArrayList<>();
     139    public List<AutoCompletionItem> getLabelsForAutoCompletion(String forKey, AutoCompletionContext context) {
     140        ArrayList<AutoCompletionItem> items = new ArrayList<>();
    144141        for (TagSpecification spec : tagSpecifications) {
    145142            if (spec.getKey().equals(forKey)) {
     
    149146                        continue;
    150147                    }
    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));
    155149                }
    156150            }
Note: See TracChangeset for help on using the changeset viewer.