Ignore:
Timestamp:
2009-08-02T19:13:42+02:00 (15 years ago)
Author:
jttt
Message:

Fix ArrayIndexOutOfBoundsException 0:-2 in relation editor when Shift-Tab is pressed in table without selected cell

Location:
trunk/src/org/openstreetmap/josm/gui/dialogs/relation
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTable.java

    r1868 r1884  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.gui.dialogs.relation;
     3
     4import static org.openstreetmap.josm.tools.I18n.tr;
    35
    46import java.awt.event.ActionEvent;
     
    2527import org.openstreetmap.josm.gui.layer.Layer.LayerChangeListener;
    2628
    27 import static org.openstreetmap.josm.tools.I18n.tr;
    28 
    2929public class MemberTable extends JTable implements IMemberModelListener {
    3030
     
    3939    /**
    4040     * constructor
    41      * 
     41     *
    4242     * @param model
    4343     * @param columnModel
     
    7575     * adjusts the width of the columns for the tag name and the tag value to the width of the
    7676     * scroll panes viewport.
    77      * 
     77     *
    7878     * Note: {@see #getPreferredScrollableViewportSize()} did not work as expected
    79      * 
     79     *
    8080     * @param scrollPaneWidth the width of the scroll panes viewport
    8181     */
     
    104104     * <li>it jumps over cells in the first column</li> <li>it automatically add a new empty row
    105105     * when the user leaves the last cell in the table</li> <ul>
    106      * 
    107      * 
     106     *
     107     *
    108108     */
    109109    class SelectNextColumnCellAction extends AbstractAction {
     
    132132     * Action to be run when the user navigates to the previous cell in the table, for instance by
    133133     * pressing Shift-TAB
    134      * 
     134     *
    135135     */
    136136    class SelectPreviousColumnCellAction extends AbstractAction {
     
    143143            }
    144144
    145             if (col == 0 && row == 0) {
     145            if (col <= 0 && row <= 0) {
    146146                // change nothing
    147147            } else if (row > 0) {
     
    166166    /**
    167167     * Replies the popup menu for this table
    168      * 
     168     *
    169169     * @return the popup menu
    170170     */
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/TagTable.java

    r1781 r1884  
    3535/**
    3636 * This is the tabular editor component for OSM tags.
    37  * 
     37 *
    3838 */
    3939@SuppressWarnings("serial")
     
    4848     * The table has two columns. The first column is used for editing rendering and
    4949     * editing tag keys, the second for rendering and editing tag values.
    50      * 
     50     *
    5151     */
    5252    static class TagTableColumnModel extends DefaultTableColumnModel {
     
    8383     *   last cell in the table</li>
    8484     * <ul>
    85      * 
     85     *
    8686     * @author gubaer
    8787     *
     
    132132
    133133
    134             if (col == 0 && row == 0) {
     134            if (col <= 0 && row <= 0) {
    135135                // change nothing
    136136            } else if (col == 1) {
     
    147147     * Action to be run when the user invokes a delete action on the table, for
    148148     * instance by pressing DEL.
    149      * 
     149     *
    150150     * Depending on the shape on the current selection the action deletes individual
    151151     * values or entire tags from the model.
    152      * 
     152     *
    153153     * If the current selection consists of cells in the second column only, the keys of
    154154     * the selected tags are set to the empty string.
    155      * 
     155     *
    156156     * If the current selection consists of cell in the third column only, the values of the
    157157     * selected tags are set to the empty string.
    158      * 
     158     *
    159159     *  If the current selection consists of cells in the second and the third column,
    160160     *  the selected tags are removed from the model.
    161      * 
     161     *
    162162     *  This action listens to the table selection. It becomes enabled when the selection
    163163     *  is non-empty, otherwise it is disabled.
    164      * 
     164     *
    165165     *
    166166     */
     
    248248    /**
    249249     * Action to be run when the user adds a new tag.
    250      * 
     250     *
    251251     *
    252252     */
     
    274274
    275275    /**
    276      * 
     276     *
    277277     * @return the delete action used by this table
    278278     */
     
    326326    /**
    327327     * constructor
    328      * 
     328     *
    329329     * @param model
    330330     * @param columnModel
     
    340340     * adjusts the width of the columns for the tag name and the tag value
    341341     * to the width of the scroll panes viewport.
    342      * 
     342     *
    343343     * Note: {@see #getPreferredScrollableViewportSize()} did not work as expected
    344      * 
     344     *
    345345     * @param scrollPaneWidth the width of the scroll panes viewport
    346346     */
Note: See TracChangeset for help on using the changeset viewer.