Changeset 6324 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2013-10-25T18:39:02+02:00 (11 years ago)
Author:
Don-vip
Message:

fix #9172 - rename "Properties / Memberships" as "Tags / Memberships"

Location:
trunk/src/org/openstreetmap/josm
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/command/ChangePropertyCommand.java

    r5143 r6324  
    3636    /**
    3737     * Key and value pairs. If value is <code>null</code>, delete all key references with the given
    38      * key. Otherwise, change the properties of all objects to the given value or create keys of
     38     * key. Otherwise, change the tags of all objects to the given value or create keys of
    3939     * those objects that do not have the key yet.
    4040     */
     
    4242
    4343    /**
    44      * Creates a command to change multiple properties of multiple objects
     44     * Creates a command to change multiple tags of multiple objects
    4545     *
    4646     * @param objects the objects to modify
    47      * @param tags the properties to set
     47     * @param tags the tags to set
    4848     */
    4949    public ChangePropertyCommand(Collection<? extends OsmPrimitive> objects, AbstractMap<String, String> tags) {
     
    5555
    5656    /**
    57      * Creates a command to change one property of multiple objects
     57     * Creates a command to change one tag of multiple objects
    5858     *
    5959     * @param objects the objects to modify
    60      * @param key the key of the property to set
     60     * @param key the key of the tag to set
    6161     * @param value the value of the key to set
    6262     */
     
    6969
    7070    /**
    71      * Creates a command to change on property of one object
     71     * Creates a command to change one tag of one object
    7272     *
    7373     * @param object the object to modify
    74      * @param key the key of the property to set
     74     * @param key the key of the tag to set
    7575     * @param value the value of the key to set
    7676     */
     
    180180
    181181            if (allnull) {
    182                 text = tr("Deleted {0} properties for {1} objects", tags.size(), objects.size());
     182                text = tr("Deleted {0} tags for {1} objects", tags.size(), objects.size());
    183183            } else
    184                 text = tr("Set {0} properties for {1} objects", tags.size(), objects.size());
     184                text = tr("Set {0} tags for {1} objects", tags.size(), objects.size());
    185185        }
    186186        return text;
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesCellRenderer.java

    r6314 r6324  
    1919
    2020/**
    21  * Cell renderer of properties table.
     21 * Cell renderer of tags table.
    2222 * @since 6314
    2323 */
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java

    r6314 r6324  
    9999
    100100/**
    101  * This dialog displays the properties of the current selected primitives.
     101 * This dialog displays the tags of the current selected primitives.
    102102 *
    103103 * If no object is selected, the dialog list is empty.
    104  * If only one is selected, all properties of this object are selected.
    105  * If more than one object are selected, the sum of all properties are displayed. If the
    106  * different objects share the same property, the shared value is displayed. If they have
     104 * If only one is selected, all tags of this object are selected.
     105 * If more than one object are selected, the sum of all tags are displayed. If the
     106 * different objects share the same tag, the shared value is displayed. If they have
    107107 * different values, all of them are put in a combo box and the string "&lt;different&gt;"
    108108 * is displayed in italic.
    109109 *
    110  * Below the list, the user can click on an add, modify and delete property button to
     110 * Below the list, the user can click on an add, modify and delete tag button to
    111111 * edit the table selection value.
    112112 *
     
    123123
    124124    /**
    125      * The property data of selected objects.
    126      */
    127     private final DefaultTableModel propertyData = new ReadOnlyTableModel();
     125     * The tag data of selected objects.
     126     */
     127    private final DefaultTableModel tagData = new ReadOnlyTableModel();
    128128
    129129    /**
     
    133133
    134134    /**
    135      * The properties table.
    136      */
    137     private final JTable propertyTable = new JTable(propertyData);
     135     * The tags table.
     136     */
     137    private final JTable tagTable = new JTable(tagData);
     138   
    138139    /**
    139140     * The membership table.
     
    142143
    143144    // Popup menus
    144     private final JPopupMenu propertyMenu = new JPopupMenu();
     145    private final JPopupMenu tagMenu = new JPopupMenu();
    145146    private final JPopupMenu membershipMenu = new JPopupMenu();
    146147
    147148    // Popup menu handlers
    148     private final PopupMenuHandler propertyMenuHandler = new PopupMenuHandler(propertyMenu);
     149    private final PopupMenuHandler tagMenuHandler = new PopupMenuHandler(tagMenu);
    149150    private final PopupMenuHandler membershipMenuHandler = new PopupMenuHandler(membershipMenu);
    150151
    151152    private final Map<String, Map<String, Integer>> valueCount = new TreeMap<String, Map<String, Integer>>();
    152153    /**
    153      * This sub-object is responsible for all adding and editing of properties
    154      */
    155     private final TagEditHelper editHelper = new TagEditHelper(propertyData, valueCount);
     154     * This sub-object is responsible for all adding and editing of tags
     155     */
     156    private final TagEditHelper editHelper = new TagEditHelper(tagData, valueCount);
    156157
    157158    private final DataSetListenerAdapter dataChangedAdapter = new DataSetListenerAdapter(this);
     
    202203     */
    203204    private final JLabel selectSth = new JLabel("<html><p>"
    204             + tr("Select objects for which to change properties.") + "</p></html>");
     205            + tr("Select objects for which to change tags.") + "</p></html>");
    205206
    206207    private PresetHandler presetHandler = new PresetHandler() {
     
    224225     */
    225226    public PropertiesDialog(MapFrame mapFrame) {
    226         super(tr("Properties/Memberships"), "propertiesdialog", tr("Properties for selected objects."),
    227                 Shortcut.registerShortcut("subwindow:properties", tr("Toggle: {0}", tr("Properties/Memberships")), KeyEvent.VK_P,
     227        super(tr("Tags/Memberships"), "propertiesdialog", tr("Tags for selected objects."),
     228                Shortcut.registerShortcut("subwindow:properties", tr("Toggle: {0}", tr("Tags/Memberships")), KeyEvent.VK_P,
    228229                        Shortcut.ALT_SHIFT), 150, true);
    229230
    230         setupPropertiesMenu();
    231         buildPropertiesTable();
     231        setupTagsMenu();
     232        buildTagsTable();
    232233
    233234        setupMembershipMenu();
     
    244245        }
    245246        bothTables.add(selectSth, GBC.eol().fill().insets(10, 10, 10, 10));
    246         bothTables.add(propertyTable.getTableHeader(), GBC.eol().fill(GBC.HORIZONTAL));
    247         bothTables.add(propertyTable, GBC.eol().fill(GBC.BOTH));
     247        bothTables.add(tagTable.getTableHeader(), GBC.eol().fill(GBC.HORIZONTAL));
     248        bothTables.add(tagTable, GBC.eol().fill(GBC.BOTH));
    248249        bothTables.add(membershipTable.getTableHeader(), GBC.eol().fill(GBC.HORIZONTAL));
    249250        bothTables.add(membershipTable, GBC.eol().fill(GBC.BOTH));
     
    255256
    256257        // Let the action know when selection in the tables change
    257         propertyTable.getSelectionModel().addListSelectionListener(editAction);
     258        tagTable.getSelectionModel().addListSelectionListener(editAction);
    258259        membershipTable.getSelectionModel().addListSelectionListener(editAction);
    259         propertyTable.getSelectionModel().addListSelectionListener(deleteAction);
     260        tagTable.getSelectionModel().addListSelectionListener(deleteAction);
    260261        membershipTable.getSelectionModel().addListSelectionListener(deleteAction);
    261262
     
    266267
    267268        MouseClickWatch mouseClickWatch = new MouseClickWatch();
    268         propertyTable.addMouseListener(mouseClickWatch);
     269        tagTable.addMouseListener(mouseClickWatch);
    269270        membershipTable.addMouseListener(mouseClickWatch);
    270271        scrollPane.addMouseListener(mouseClickWatch);
     
    278279    }
    279280
    280     private void buildPropertiesTable() {
    281         // setting up the properties table
    282 
    283         propertyData.setColumnIdentifiers(new String[]{tr("Key"),tr("Value")});
    284         propertyTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    285         propertyTable.getTableHeader().setReorderingAllowed(false);
     281    private void buildTagsTable() {
     282        // setting up the tags table
     283
     284        tagData.setColumnIdentifiers(new String[]{tr("Key"),tr("Value")});
     285        tagTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
     286        tagTable.getTableHeader().setReorderingAllowed(false);
    286287
    287288        PropertiesCellRenderer cellRenderer = new PropertiesCellRenderer();
    288         propertyTable.getColumnModel().getColumn(0).setCellRenderer(cellRenderer);
    289         propertyTable.getColumnModel().getColumn(1).setCellRenderer(cellRenderer);
     289        tagTable.getColumnModel().getColumn(0).setCellRenderer(cellRenderer);
     290        tagTable.getColumnModel().getColumn(1).setCellRenderer(cellRenderer);
    290291    }
    291292
     
    415416
    416417    /**
    417      * creates the popup menu @field propertyMenu and its launcher on property table
    418      */
    419     private void setupPropertiesMenu() {
    420         propertyMenu.add(pasteValueAction);
    421         propertyMenu.add(copyValueAction);
    422         propertyMenu.add(copyKeyValueAction);
    423         propertyMenu.add(copyAllKeyValueAction);
    424         propertyMenu.addSeparator();
    425         propertyMenu.add(searchActionAny);
    426         propertyMenu.add(searchActionSame);
    427         propertyMenu.addSeparator();
    428         propertyMenu.add(helpAction);
    429         propertyTable.addMouseListener(new PopupMenuLauncher(propertyMenu));
     418     * creates the popup menu @field tagMenu and its launcher on tag table
     419     */
     420    private void setupTagsMenu() {
     421        tagMenu.add(pasteValueAction);
     422        tagMenu.add(copyValueAction);
     423        tagMenu.add(copyKeyValueAction);
     424        tagMenu.add(copyAllKeyValueAction);
     425        tagMenu.addSeparator();
     426        tagMenu.add(searchActionAny);
     427        tagMenu.add(searchActionSame);
     428        tagMenu.addSeparator();
     429        tagMenu.add(helpAction);
     430        tagTable.addMouseListener(new PopupMenuLauncher(tagMenu));
    430431    }
    431432
     
    436437
    437438        // ENTER = editAction, open "edit" dialog
    438         propertyTable.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)
     439        tagTable.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)
    439440                .put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0),"onTableEnter");
    440         propertyTable.getActionMap().put("onTableEnter",editAction);
     441        tagTable.getActionMap().put("onTableEnter",editAction);
    441442        membershipTable.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)
    442443                .put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0),"onTableEnter");
    443444        membershipTable.getActionMap().put("onTableEnter",editAction);
    444445
    445         // INSERT button = addAction, open "add property" dialog
    446         propertyTable.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)
     446        // INSERT button = addAction, open "add tag" dialog
     447        tagTable.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)
    447448                .put(KeyStroke.getKeyStroke(KeyEvent.VK_INSERT, 0),"onTableInsert");
    448         propertyTable.getActionMap().put("onTableInsert",addAction);
     449        tagTable.getActionMap().put("onTableInsert",addAction);
    449450
    450451        // unassign some standard shortcuts for JTable to allow upload / download
    451         InputMapUtils.unassignCtrlShiftUpDown(propertyTable, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
     452        InputMapUtils.unassignCtrlShiftUpDown(tagTable, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
    452453
    453454        // unassign some standard shortcuts for correct copy-pasting, fix #8508
    454         propertyTable.setTransferHandler(null);
    455 
    456         propertyTable.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)
     455        tagTable.setTransferHandler(null);
     456
     457        tagTable.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)
    457458                .put(KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.CTRL_MASK),"onCopy");
    458         propertyTable.getActionMap().put("onCopy",copyKeyValueAction);
     459        tagTable.getActionMap().put("onCopy",copyKeyValueAction);
    459460
    460461        // allow using enter to add tags for all look&feel configurations
     
    557558        if (!isVisible())
    558559            return;
    559         if (propertyTable == null)
     560        if (tagTable == null)
    560561            return; // selection changed may be received in base class constructor before init
    561         if (propertyTable.getCellEditor() != null) {
    562             propertyTable.getCellEditor().cancelCellEditing();
     562        if (tagTable.getCellEditor() != null) {
     563            tagTable.getCellEditor().cancelCellEditing();
    563564        }
    564565
     
    566567        Relation selectedRelation = null;
    567568        selectedTag = editHelper.getChangedKey(); // select last added or last edited key by default
    568         if (selectedTag == null && propertyTable.getSelectedRowCount() == 1) {
    569             selectedTag = (String)propertyData.getValueAt(propertyTable.getSelectedRow(), 0);
     569        if (selectedTag == null && tagTable.getSelectedRowCount() == 1) {
     570            selectedTag = (String)tagData.getValueAt(tagTable.getSelectedRow(), 0);
    570571        }
    571572        if (membershipTable.getSelectedRowCount() == 1) {
     
    573574        }
    574575
    575         // re-load property data
    576         propertyData.setRowCount(0);
     576        // re-load tag data
     577        tagData.setRowCount(0);
    577578
    578579        final boolean displayDiscardableKeys = Main.pref.getBoolean("display.discardable-keys", false);
     
    606607                e.getValue().put("", newSelection.size() - count);
    607608            }
    608             propertyData.addRow(new Object[]{e.getKey(), e.getValue()});
     609            tagData.addRow(new Object[]{e.getKey(), e.getValue()});
    609610            tags.put(e.getKey(), e.getValue().size() == 1
    610611                    ? e.getValue().keySet().iterator().next() : tr("<different>"));
     
    655656
    656657        boolean hasSelection = !newSelection.isEmpty();
    657         boolean hasTags = hasSelection && propertyData.getRowCount() > 0;
     658        boolean hasTags = hasSelection && tagData.getRowCount() > 0;
    658659        boolean hasMemberships = hasSelection && membershipData.getRowCount() > 0;
    659660        btnAdd.setEnabled(hasSelection);
    660661        btnEdit.setEnabled(hasTags || hasMemberships);
    661662        btnDel.setEnabled(hasTags || hasMemberships);
    662         propertyTable.setVisible(hasTags);
    663         propertyTable.getTableHeader().setVisible(hasTags);
     663        tagTable.setVisible(hasTags);
     664        tagTable.getTableHeader().setVisible(hasTags);
    664665        selectSth.setVisible(!hasSelection);
    665666        pluginHook.setVisible(hasSelection);
    666667
    667668        int selectedIndex;
    668         if (selectedTag != null && (selectedIndex = findRow(propertyData, selectedTag)) != -1) {
    669             propertyTable.changeSelection(selectedIndex, 0, false, false);
     669        if (selectedTag != null && (selectedIndex = findRow(tagData, selectedTag)) != -1) {
     670            tagTable.changeSelection(selectedIndex, 0, false, false);
    670671        } else if (selectedRelation != null && (selectedIndex = findRow(membershipData, selectedRelation)) != -1) {
    671672            membershipTable.changeSelection(selectedIndex, 0, false, false);
    672673        } else if(hasTags) {
    673             propertyTable.changeSelection(0, 0, false, false);
     674            tagTable.changeSelection(0, 0, false, false);
    674675        } else if(hasMemberships) {
    675676            membershipTable.changeSelection(0, 0, false, false);
    676677        }
    677678
    678         if(propertyData.getRowCount() != 0 || membershipData.getRowCount() != 0) {
    679             setTitle(tr("Properties: {0} / Memberships: {1}",
    680                     propertyData.getRowCount(), membershipData.getRowCount()));
     679        if(tagData.getRowCount() != 0 || membershipData.getRowCount() != 0) {
     680            setTitle(tr("Tags: {0} / Memberships: {1}",
     681                    tagData.getRowCount(), membershipData.getRowCount()));
    681682        } else {
    682             setTitle(tr("Properties / Memberships"));
     683            setTitle(tr("Tags / Memberships"));
    683684        }
    684685    }
     
    708709
    709710    /**
    710      * Replies the property popup menu handler.
    711      * @return The property popup menu handler
     711     * Replies the tag popup menu handler.
     712     * @return The tag popup menu handler
    712713     */
    713714    public PopupMenuHandler getPropertyPopupMenuHandler() {
    714         return propertyMenuHandler;
     715        return tagMenuHandler;
    715716    }
    716717
    717718    @SuppressWarnings("unchecked")
    718719    public Tag getSelectedProperty() {
    719         int row = propertyTable.getSelectedRow();
     720        int row = tagTable.getSelectedRow();
    720721        if (row == -1) return null;
    721         TreeMap<String, Integer> map = (TreeMap<String, Integer>) propertyData.getValueAt(row, 1);
     722        TreeMap<String, Integer> map = (TreeMap<String, Integer>) tagData.getValueAt(row, 1);
    722723        return new Tag(
    723                 propertyData.getValueAt(row, 0).toString(),
     724                tagData.getValueAt(row, 0).toString(),
    724725                map.size() > 1 ? "" : map.keySet().iterator().next());
    725726    }
     
    749750            {
    750751                // single click, clear selection in other table not clicked in
    751                 if (e.getSource() == propertyTable) {
     752                if (e.getSource() == tagTable) {
    752753                    membershipTable.clearSelection();
    753754                } else if (e.getSource() == membershipTable) {
    754                     propertyTable.clearSelection();
    755                 }
    756             }
    757             // double click, edit or add property
    758             else if (e.getSource() == propertyTable)
     755                    tagTable.clearSelection();
     756                }
     757            }
     758            // double click, edit or add tag
     759            else if (e.getSource() == tagTable)
    759760            {
    760                 int row = propertyTable.rowAtPoint(e.getPoint());
     761                int row = tagTable.rowAtPoint(e.getPoint());
    761762                if (row > -1) {
    762                     boolean focusOnKey = (propertyTable.columnAtPoint(e.getPoint()) == 0);
    763                     editHelper.editProperty(row, focusOnKey);
     763                    boolean focusOnKey = (tagTable.columnAtPoint(e.getPoint()) == 0);
     764                    editHelper.editTag(row, focusOnKey);
    764765                } else {
    765                     editHelper.addProperty();
     766                    editHelper.addTag();
    766767                    btnAdd.requestFocusInWindow();
    767768                }
     
    774775            else
    775776            {
    776                 editHelper.addProperty();
     777                editHelper.addTag();
    777778                btnAdd.requestFocusInWindow();
    778779            }
    779780        }
    780781        @Override public void mousePressed(MouseEvent e) {
    781             if (e.getSource() == propertyTable) {
     782            if (e.getSource() == tagTable) {
    782783                membershipTable.clearSelection();
    783784            } else if (e.getSource() == membershipTable) {
    784                 propertyTable.clearSelection();
     785                tagTable.clearSelection();
    785786            }
    786787        }
     
    845846        public DeleteAction() {
    846847            super(tr("Delete"), "dialogs/delete", tr("Delete the selected key in all objects"),
    847                     Shortcut.registerShortcut("properties:delete", tr("Delete Properties"), KeyEvent.VK_D,
     848                    Shortcut.registerShortcut("properties:delete", tr("Delete Tags"), KeyEvent.VK_D,
    848849                            Shortcut.ALT_CTRL_SHIFT), false);
    849850            updateEnabledState();
    850851        }
    851852
    852         protected void deleteProperties(int[] rows){
     853        protected void deleteTags(int[] rows){
    853854            // convert list of rows to HashMap (and find gap for nextKey)
    854855            HashMap<String, String> tags = new HashMap<String, String>(rows.length);
    855856            int nextKeyIndex = rows[0];
    856857            for (int row : rows) {
    857                 String key = propertyData.getValueAt(row, 0).toString();
     858                String key = tagData.getValueAt(row, 0).toString();
    858859                if (row == nextKeyIndex + 1) {
    859860                    nextKeyIndex = row; // no gap yet
     
    862863            }
    863864
    864             // find key to select after deleting other properties
     865            // find key to select after deleting other tags
    865866            String nextKey = null;
    866             int rowCount = propertyData.getRowCount();
     867            int rowCount = tagData.getRowCount();
    867868            if (rowCount > rows.length) {
    868869                if (nextKeyIndex == rows[rows.length-1]) {
     
    873874                    nextKeyIndex++;
    874875                }
    875                 nextKey = (String)propertyData.getValueAt(nextKeyIndex, 0);
     876                nextKey = (String)tagData.getValueAt(nextKeyIndex, 0);
    876877            }
    877878
     
    881882            membershipTable.clearSelection();
    882883            if (nextKey != null) {
    883                 propertyTable.changeSelection(findRow(propertyData, nextKey), 0, false, false);
     884                tagTable.changeSelection(findRow(tagData, nextKey), 0, false, false);
    884885            }
    885886        }
     
    912913            Main.main.undoRedo.add(new ChangeCommand(cur, rel));
    913914
    914             propertyTable.clearSelection();
     915            tagTable.clearSelection();
    915916            if (nextRelation != null) {
    916917                membershipTable.changeSelection(findRow(membershipData, nextRelation), 0, false, false);
     
    920921        @Override
    921922        public void actionPerformed(ActionEvent e) {
    922             if (propertyTable.getSelectedRowCount() > 0) {
    923                 int[] rows = propertyTable.getSelectedRows();
    924                 deleteProperties(rows);
     923            if (tagTable.getSelectedRowCount() > 0) {
     924                int[] rows = tagTable.getSelectedRows();
     925                deleteTags(rows);
    925926            } else if (membershipTable.getSelectedRowCount() > 0) {
    926927                int[] rows = membershipTable.getSelectedRows();
     
    935936        protected void updateEnabledState() {
    936937            setEnabled(
    937                     (propertyTable != null && propertyTable.getSelectedRowCount() >= 1)
     938                    (tagTable != null && tagTable.getSelectedRowCount() >= 1)
    938939                    || (membershipTable != null && membershipTable.getSelectedRowCount() > 0)
    939940                    );
     
    952953        public AddAction() {
    953954            super(tr("Add"), "dialogs/add", tr("Add a new key/value pair to all objects"),
    954                     Shortcut.registerShortcut("properties:add", tr("Add Property"), KeyEvent.VK_A,
     955                    Shortcut.registerShortcut("properties:add", tr("Add Tag"), KeyEvent.VK_A,
    955956                            Shortcut.ALT), false);
    956957        }
     
    958959        @Override
    959960        public void actionPerformed(ActionEvent e) {
    960             editHelper.addProperty();
     961            editHelper.addTag();
    961962            btnAdd.requestFocusInWindow();
    962963        }
     
    969970        public EditAction() {
    970971            super(tr("Edit"), "dialogs/edit", tr("Edit the value of the selected key for all objects"),
    971                     Shortcut.registerShortcut("properties:edit", tr("Edit Properties"), KeyEvent.VK_S,
     972                    Shortcut.registerShortcut("properties:edit", tr("Edit Tags"), KeyEvent.VK_S,
    972973                            Shortcut.ALT), false);
    973974            updateEnabledState();
     
    978979            if (!isEnabled())
    979980                return;
    980             if (propertyTable.getSelectedRowCount() == 1) {
    981                 int row = propertyTable.getSelectedRow();
    982                 editHelper.editProperty(row, false);
     981            if (tagTable.getSelectedRowCount() == 1) {
     982                int row = tagTable.getSelectedRow();
     983                editHelper.editTag(row, false);
    983984            } else if (membershipTable.getSelectedRowCount() == 1) {
    984985                int row = membershipTable.getSelectedRow();
     
    990991        protected void updateEnabledState() {
    991992            setEnabled(
    992                     (propertyTable != null && propertyTable.getSelectedRowCount() == 1)
     993                    (tagTable != null && tagTable.getSelectedRowCount() == 1)
    993994                    ^ (membershipTable != null && membershipTable.getSelectedRowCount() == 1)
    994995                    );
     
    10151016                final List<URI> uris = new ArrayList<URI>();
    10161017                int row;
    1017                 if (propertyTable.getSelectedRowCount() == 1) {
    1018                     row = propertyTable.getSelectedRow();
    1019                     String key = URLEncoder.encode(propertyData.getValueAt(row, 0).toString(), "UTF-8");
     1018                if (tagTable.getSelectedRowCount() == 1) {
     1019                    row = tagTable.getSelectedRow();
     1020                    String key = URLEncoder.encode(tagData.getValueAt(row, 0).toString(), "UTF-8");
    10201021                    @SuppressWarnings("unchecked")
    1021                     Map<String, Integer> m = (Map<String, Integer>) propertyData.getValueAt(row, 1);
     1022                    Map<String, Integer> m = (Map<String, Integer>) tagData.getValueAt(row, 1);
    10221023                    String val = URLEncoder.encode(m.entrySet().iterator().next().getKey(), "UTF-8");
    10231024
     
    11061107        @Override
    11071108        public void actionPerformed(ActionEvent ae) {
    1108             if (propertyTable.getSelectedRowCount() != 1)
     1109            if (tagTable.getSelectedRowCount() != 1)
    11091110                return;
    1110             String key = propertyData.getValueAt(propertyTable.getSelectedRow(), 0).toString();
     1111            String key = tagData.getValueAt(tagTable.getSelectedRow(), 0).toString();
    11111112            Collection<OsmPrimitive> sel = Main.main.getCurrentDataSet().getSelected();
    11121113            String clipboard = Utils.getClipboardContent();
     
    11231124        @Override
    11241125        public void actionPerformed(ActionEvent ae) {
    1125             int[] rows = propertyTable.getSelectedRows();
     1126            int[] rows = tagTable.getSelectedRows();
    11261127            Set<String> values = new TreeSet<String>();
    11271128            Collection<OsmPrimitive> sel = Main.main.getCurrentDataSet().getSelected();
     
    11291130
    11301131            for (int row: rows) {
    1131                 String key = propertyData.getValueAt(row, 0).toString();
     1132                String key = tagData.getValueAt(row, 0).toString();
    11321133                if (sel.isEmpty())
    11331134                    return;
     
    12061207        @Override
    12071208        public void actionPerformed(ActionEvent e) {
    1208             if (propertyTable.getSelectedRowCount() != 1)
     1209            if (tagTable.getSelectedRowCount() != 1)
    12091210                return;
    1210             String key = propertyData.getValueAt(propertyTable.getSelectedRow(), 0).toString();
     1211            String key = tagData.getValueAt(tagTable.getSelectedRow(), 0).toString();
    12111212            Collection<OsmPrimitive> sel = Main.main.getCurrentDataSet().getSelected();
    12121213            if (sel.isEmpty())
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java

    r6316 r6324  
    8282 */
    8383 class TagEditHelper {
    84     private final DefaultTableModel propertyData;
     84    private final DefaultTableModel tagData;
    8585    private final Map<String, Map<String, Integer>> valueCount;
    8686
     
    113113
    114114    TagEditHelper(DefaultTableModel propertyData, Map<String, Map<String, Integer>> valueCount) {
    115         this.propertyData = propertyData;
     115        this.tagData = propertyData;
    116116        this.valueCount = valueCount;
    117117    }
     
    121121     * to the dataset, of course).
    122122     */
    123     public void addProperty() {
     123    public void addTag() {
    124124        changedKey = null;
    125125        if (Main.map.mapMode instanceof DrawAction) {
     
    144144   
    145145    /**
    146     * Edit the value in the properties table row
     146    * Edit the value in the tags table row
    147147    * @param row The row of the table from which the value is edited.
    148148    * @param focusOnKey Determines if the initial focus should be set on key instead of value
    149149    * @since 5653
    150150    */
    151     public void editProperty(final int row, boolean focusOnKey) {
     151    public void editTag(final int row, boolean focusOnKey) {
    152152        changedKey = null;
    153153        sel = Main.main.getCurrentDataSet().getSelected();
    154154        if (sel.isEmpty()) return;
    155155
    156         String key = propertyData.getValueAt(row, 0).toString();
     156        String key = tagData.getValueAt(row, 0).toString();
    157157        objKey=key;
    158158       
    159159        @SuppressWarnings("unchecked")
    160160        final EditTagDialog editDialog = new EditTagDialog(key, row,
    161                 (Map<String, Integer>) propertyData.getValueAt(row, 1), focusOnKey);
     161                (Map<String, Integer>) tagData.getValueAt(row, 1), focusOnKey);
    162162        editDialog.showDialog();
    163163        if (editDialog.getValue() !=1 ) return;
     
    540540                    itemToSelect = item;
    541541                }
    542                 for (int i = 0; i < propertyData.getRowCount(); ++i) {
    543                     if (item.getValue().equals(propertyData.getValueAt(i, 0))) {
     542                for (int i = 0; i < tagData.getRowCount(); ++i) {
     543                    if (item.getValue().equals(tagData.getValueAt(i, 0))) {
    544544                        if (itemToSelect == item) {
    545545                            itemToSelect = null;
     
    748748            // Disable action if its key is already set on the object (the key being absent from the keys list for this reason
    749749            // performing this action leads to autocomplete to the next key (see #7671 comments)
    750             for (int j = 0; j < propertyData.getRowCount(); ++j) {
    751                 if (t.getKey().equals(propertyData.getValueAt(j, 0))) {
     750            for (int j = 0; j < tagData.getRowCount(); ++j) {
     751                if (t.getKey().equals(tagData.getValueAt(j, 0))) {
    752752                    action.setEnabled(false);
    753753                    break;
Note: See TracChangeset for help on using the changeset viewer.