Changeset 10134 in josm


Ignore:
Timestamp:
2016-04-10T16:57:50+02:00 (4 years ago)
Author:
Don-vip
Message:

sonar, javadoc

Location:
trunk
Files:
1 added
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/relation/RecentRelationsAction.java

    r9722 r10134  
    159159        }
    160160
    161         public static void launch(Component parent, KeyStroke keystroke) {
     161        protected static void launch(Component parent, KeyStroke keystroke) {
    162162            Rectangle r = parent.getBounds();
    163163            new RecentRelationsPopupMenu(getRecentRelationsOnActiveLayer(), keystroke).show(parent, r.x, r.y + r.height);
  • trunk/src/org/openstreetmap/josm/actions/upload/UploadNotesTask.java

    r9486 r10134  
    8989                Note newNote;
    9090                switch (comment.getNoteAction()) {
    91                 case opened:
     91                case OPENED:
    9292                    if (Main.isDebugEnabled()) {
    9393                        Main.debug("opening new note");
     
    9595                    newNote = api.createNote(note.getLatLon(), comment.getText(), monitor);
    9696                    break;
    97                 case closed:
     97                case CLOSED:
    9898                    if (Main.isDebugEnabled()) {
    9999                        Main.debug("closing note " + note.getId());
     
    101101                    newNote = api.closeNote(note, comment.getText(), monitor);
    102102                    break;
    103                 case commented:
     103                case COMMENTED:
    104104                    if (Main.isDebugEnabled()) {
    105105                        Main.debug("adding comment to note " + note.getId());
     
    107107                    newNote = api.addCommentToNote(note, comment.getText(), monitor);
    108108                    break;
    109                 case reopened:
     109                case REOPENED:
    110110                    if (Main.isDebugEnabled()) {
    111111                        Main.debug("reopening note " + note.getId());
  • trunk/src/org/openstreetmap/josm/data/cache/ICachedLoaderListener.java

    r8624 r10134  
    22package org.openstreetmap.josm.data.cache;
    33
     4/**
     5 * Cache loader listener.
     6 * @since 8168
     7 */
    48public interface ICachedLoaderListener {
    59
  • trunk/src/org/openstreetmap/josm/data/cache/JCSCachedTileLoaderJob.java

    r9983 r10134  
    142142    }
    143143
     144    @Override
    144145    public V get() {
    145146        ensureCacheElement();
  • trunk/src/org/openstreetmap/josm/data/notes/Note.java

    r10098 r10134  
    1212
    1313/**
    14  * A map note. It always has at least one comment since a comment is required
    15  * to create a note on osm.org
     14 * A map note. It always has at least one comment since a comment is required to create a note on osm.org.
     15 * @since 7451
    1616 */
    1717public class Note {
    1818
    19     public enum State { open, closed }
     19    /** Note state */
     20    public enum State {
     21        /** Note is open */
     22        OPEN,
     23        /** Note is closed */
     24        CLOSED
     25    }
    2026
    2127    private long id;
     
    3945    }
    4046
     47    /**
     48     * Sets note id.
     49     * @param id OSM ID of this note
     50     */
    4151    public void setId(long id) {
    4252        this.id = id;
     
    5363    }
    5464
     65    /**
     66     * Sets date at which this note has been created.
     67     * @param createdAt date at which this note has been created
     68     */
    5569    public void setCreatedAt(Date createdAt) {
    5670        this.createdAt = createdAt;
     
    6276    }
    6377
     78    /**
     79     * Sets date at which this note has been closed.
     80     * @param closedAt date at which this note has been closed
     81     */
    6482    public void setClosedAt(Date closedAt) {
    6583        this.closedAt = closedAt;
     
    7189    }
    7290
     91    /**
     92     * Sets the note state.
     93     * @param state note state (open or closed)
     94     */
    7395    public void setState(State state) {
    7496        this.state = state;
     
    80102    }
    81103
     104    /**
     105     * Adds a comment.
     106     * @param comment note comment
     107     */
    82108    public void addComment(NoteComment comment) {
    83109        comments.add(comment);
     
    112138    @Override
    113139    public boolean equals(Object obj) {
    114         if (this == obj) return true;
    115         if (obj == null || getClass() != obj.getClass()) return false;
     140        if (this == obj)
     141            return true;
     142        if (obj == null || getClass() != obj.getClass())
     143            return false;
    116144        Note note = (Note) obj;
    117145        return id == note.id;
  • trunk/src/org/openstreetmap/josm/data/notes/NoteComment.java

    r10098 r10134  
    99 * Represents a comment made on a note. All notes have at least on comment
    1010 * which is the comment the note was opened with. Comments are immutable.
     11 * @since 7451
    1112 */
    1213public class NoteComment {
     
    2526     */
    2627    public enum Action {
    27         opened,
    28         closed,
    29         reopened,
    30         commented,
    31         hidden
     28        /** note has been opened */
     29        OPENED,
     30        /** note has been closed */
     31        CLOSED,
     32        /** note has been reopened */
     33        REOPENED,
     34        /** note has been commented */
     35        COMMENTED,
     36        /** note has been hidden */
     37        HIDDEN
    3238    }
    3339
  • trunk/src/org/openstreetmap/josm/data/osm/NoteData.java

    r9213 r10134  
    4646                return -1;
    4747            }
    48             if (n1.getState() == State.closed && n2.getState() == State.open) {
     48            if (n1.getState() == State.CLOSED && n2.getState() == State.OPEN) {
    4949                return 1;
    5050            }
    51             if (n1.getState() == State.open && n2.getState() == State.closed) {
     51            if (n1.getState() == State.OPEN && n2.getState() == State.CLOSED) {
    5252                return -1;
    5353            }
     
    200200        Note note = new Note(location);
    201201        note.setCreatedAt(new Date());
    202         note.setState(State.open);
     202        note.setState(State.OPEN);
    203203        note.setId(newNoteId--);
    204         NoteComment comment = new NoteComment(new Date(), getCurrentUser(), text, NoteComment.Action.opened, true);
     204        NoteComment comment = new NoteComment(new Date(), getCurrentUser(), text, NoteComment.Action.OPENED, true);
    205205        note.addComment(comment);
    206206        if (Main.isDebugEnabled()) {
     
    220220            throw new IllegalArgumentException("Note to modify must be in layer");
    221221        }
    222         if (note.getState() == State.closed) {
     222        if (note.getState() == State.CLOSED) {
    223223            throw new IllegalStateException("Cannot add a comment to a closed note");
    224224        }
     
    226226            Main.debug("Adding comment to note {0}: {1}", note.getId(), text);
    227227        }
    228         NoteComment comment = new NoteComment(new Date(), getCurrentUser(), text, NoteComment.Action.commented, true);
     228        NoteComment comment = new NoteComment(new Date(), getCurrentUser(), text, NoteComment.Action.COMMENTED, true);
    229229        note.addComment(comment);
    230230        dataUpdated();
     
    240240            throw new IllegalArgumentException("Note to close must be in layer");
    241241        }
    242         if (note.getState() != State.open) {
     242        if (note.getState() != State.OPEN) {
    243243            throw new IllegalStateException("Cannot close a note that isn't open");
    244244        }
     
    246246            Main.debug("closing note {0} with comment: {1}", note.getId(), text);
    247247        }
    248         NoteComment comment = new NoteComment(new Date(), getCurrentUser(), text, NoteComment.Action.closed, true);
     248        NoteComment comment = new NoteComment(new Date(), getCurrentUser(), text, NoteComment.Action.CLOSED, true);
    249249        note.addComment(comment);
    250         note.setState(State.closed);
     250        note.setState(State.CLOSED);
    251251        note.setClosedAt(new Date());
    252252        dataUpdated();
     
    262262            throw new IllegalArgumentException("Note to reopen must be in layer");
    263263        }
    264         if (note.getState() != State.closed) {
     264        if (note.getState() != State.CLOSED) {
    265265            throw new IllegalStateException("Cannot reopen a note that isn't closed");
    266266        }
     
    268268            Main.debug("reopening note {0} with comment: {1}", note.getId(), text);
    269269        }
    270         NoteComment comment = new NoteComment(new Date(), getCurrentUser(), text, NoteComment.Action.reopened, true);
     270        NoteComment comment = new NoteComment(new Date(), getCurrentUser(), text, NoteComment.Action.REOPENED, true);
    271271        note.addComment(comment);
    272         note.setState(State.open);
     272        note.setState(State.OPEN);
    273273        dataUpdated();
    274274    }
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/MergeSourceBuildingVisitor.java

    r9067 r10134  
    2727 * incomplete {@link OsmPrimitive}s which are referred to by relations in the original collection. And
    2828 * it turns {@link OsmPrimitive} referred to by {@link Relation}s in the original collection into
    29  * incomplete {@link OsmPrimitive}s in the "hull", if they are not themselves present in the
    30  * original collection.
    31  *
     29 * incomplete {@link OsmPrimitive}s in the "hull", if they are not themselves present in the original collection.
     30 * @since 1891
    3231 */
    3332public class MergeSourceBuildingVisitor extends AbstractVisitor {
     
    103102        List<RelationMemberData> newMembers = new ArrayList<>();
    104103        for (RelationMember member: r.getMembers()) {
    105             newMembers.add(
    106                     new RelationMemberData(member.getRole(), mappedPrimitives.get(member.getMember())));
     104            newMembers.add(new RelationMemberData(member.getRole(), mappedPrimitives.get(member.getMember())));
    107105
    108106        }
     
    134132    public void visit(Way w) {
    135133        // remember all nodes this way refers to ...
    136         //
    137134        for (Node n: w.getNodes()) {
    138135            n.accept(this);
     
    144141    @Override
    145142    public void visit(Relation r) {
    146         // first, remember all primitives members refer to (only if necessary, see
    147         // below)
    148         //
     143        // first, remember all primitives members refer to (only if necessary, see below)
    149144        rememberRelationPartial(r);
    150145        for (RelationMember member: r.getMembers()) {
    151146            if (isAlreadyRemembered(member.getMember())) {
    152147                // referred primitive already remembered
    153                 //
    154148                continue;
    155149            }
     
    186180    }
    187181
     182    /**
     183     * Builds and returns the "hull".
     184     * @return the "hull" data set
     185     */
    188186    public DataSet build() {
    189187        for (OsmPrimitive primitive: selectionBase.getAllSelected()) {
  • trunk/src/org/openstreetmap/josm/gui/conflict/ConflictColors.java

    r9212 r10134  
    99import org.openstreetmap.josm.data.Preferences.ColorKey;
    1010
     11/**
     12 * Conflict color constants.
     13 * @since 4162
     14 */
    1115public enum ConflictColors implements ColorKey {
    1216
     17    /** Conflict background: no conflict */
    1318    BGCOLOR_NO_CONFLICT(marktr("Conflict background: no conflict"), new Color(234, 234, 234)),
     19    /** Conflict background: decided */
    1420    BGCOLOR_DECIDED(marktr("Conflict background: decided"), new Color(217, 255, 217)),
     21    /** Conflict background: undecided */
    1522    BGCOLOR_UNDECIDED(marktr("Conflict background: undecided"), new Color(255, 197, 197)),
     23    /** Conflict background: drop */
    1624    BGCOLOR_DROP(marktr("Conflict background: drop"), Color.white),
     25    /** Conflict background: keep */
    1726    BGCOLOR_KEEP(marktr("Conflict background: keep"), new Color(217, 255, 217)),
     27    /** Conflict background: combined */
    1828    BGCOLOR_COMBINED(marktr("Conflict background: combined"), new Color(217, 255, 217)),
     29    /** Conflict background: selected */
    1930    BGCOLOR_SELECTED(marktr("Conflict background: selected"), new Color(143, 170, 255)),
    2031
     32    /** Conflict foreground: undecided */
    2133    FGCOLOR_UNDECIDED(marktr("Conflict foreground: undecided"), Color.black),
     34    /** Conflict foreground: drop */
    2235    FGCOLOR_DROP(marktr("Conflict foreground: drop"), Color.lightGray),
     36    /** Conflict foreground: keep */
    2337    FGCOLOR_KEEP(marktr("Conflict foreground: keep"), Color.black),
    2438
     39    /** Conflict background: empty row */
    2540    BGCOLOR_EMPTY_ROW(marktr("Conflict background: empty row"), new Color(234, 234, 234)),
     41    /** Conflict background: frozen */
    2642    BGCOLOR_FROZEN(marktr("Conflict background: frozen"), new Color(234, 234, 234)),
     43    /** Conflict background: in comparison */
    2744    BGCOLOR_PARTICIPATING_IN_COMPARISON(marktr("Conflict background: in comparison"), Color.black),
     45    /** Conflict foreground: in comparison */
    2846    FGCOLOR_PARTICIPATING_IN_COMPARISON(marktr("Conflict foreground: in comparison"), Color.white),
     47    /** Conflict background */
    2948    BGCOLOR(marktr("Conflict background"), Color.white),
     49    /** Conflict foreground */
    3050    FGCOLOR(marktr("Conflict foreground"), Color.black),
    3151
     52    /** Conflict background: not in opposite */
    3253    BGCOLOR_NOT_IN_OPPOSITE(marktr("Conflict background: not in opposite"), new Color(255, 197, 197)),
     54    /** Conflict background: in opposite */
    3355    BGCOLOR_IN_OPPOSITE(marktr("Conflict background: in opposite"), new Color(255, 234, 213)),
     56    /** Conflict background: same position in opposite */
    3457    BGCOLOR_SAME_POSITION_IN_OPPOSITE(marktr("Conflict background: same position in opposite"), new Color(217, 255, 217)),
    3558
     59    /** Conflict background: keep one tag */
    3660    BGCOLOR_TAG_KEEP_ONE(marktr("Conflict background: keep one tag"), new Color(217, 255, 217)),
     61    /** Conflict foreground: keep one tag */
    3762    FGCOLOR_TAG_KEEP_ONE(marktr("Conflict foreground: keep one tag"), Color.black),
     63    /** Conflict background: drop tag */
    3864    BGCOLOR_TAG_KEEP_NONE(marktr("Conflict background: drop tag"), Color.lightGray),
     65    /** Conflict foreground: drop tag */
    3966    FGCOLOR_TAG_KEEP_NONE(marktr("Conflict foreground: drop tag"), Color.black),
     67    /** Conflict background: keep all tags */
    4068    BGCOLOR_TAG_KEEP_ALL(marktr("Conflict background: keep all tags"), new Color(255, 234, 213)),
     69    /** Conflict foreground: keep all tags */
    4170    FGCOLOR_TAG_KEEP_ALL(marktr("Conflict foreground: keep all tags"), Color.black),
     71    /** Conflict background: sum all numeric tags */
    4272    BGCOLOR_TAG_SUM_ALL_NUM(marktr("Conflict background: sum all numeric tags"), new Color(255, 234, 213)),
     73    /** Conflict foreground: sum all numeric tags */
    4374    FGCOLOR_TAG_SUM_ALL_NUM(marktr("Conflict foreground: sum all numeric tags"), Color.black),
    4475
     76    /** Conflict background: keep member */
    4577    BGCOLOR_MEMBER_KEEP(marktr("Conflict background: keep member"), new Color(217, 255, 217)),
     78    /** Conflict foreground: keep member */
    4679    FGCOLOR_MEMBER_KEEP(marktr("Conflict foreground: keep member"), Color.black),
     80    /** Conflict background: remove member */
    4781    BGCOLOR_MEMBER_REMOVE(marktr("Conflict background: remove member"), Color.lightGray),
     82    /** Conflict foreground: remove member */
    4883    FGCOLOR_MEMBER_REMOVE(marktr("Conflict foreground: remove member"), Color.black);
    4984
  • trunk/src/org/openstreetmap/josm/gui/dialogs/NotesDialog.java

    r9983 r10134  
    146146            addCommentAction.setEnabled(false);
    147147            reopenAction.setEnabled(false);
    148         } else if (noteData.getSelectedNote().getState() == State.open) {
     148        } else if (noteData.getSelectedNote().getState() == State.OPEN) {
    149149            closeAction.setEnabled(true);
    150150            addCommentAction.setEnabled(true);
     
    249249                if (note.getId() < 0) {
    250250                    icon = ICON_NEW_SMALL;
    251                 } else if (note.getState() == State.closed) {
     251                } else if (note.getState() == State.CLOSED) {
    252252                    icon = ICON_CLOSED_SMALL;
    253253                } else {
  • trunk/src/org/openstreetmap/josm/gui/layer/NoteLayer.java

    r9751 r10134  
    113113            if (note.getId() < 0) {
    114114                icon = NotesDialog.ICON_NEW_SMALL;
    115             } else if (note.getState() == State.closed) {
     115            } else if (note.getState() == State.CLOSED) {
    116116                icon = NotesDialog.ICON_CLOSED_SMALL;
    117117            } else {
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/LanguagePreference.java

    r8836 r10134  
    3131/**
    3232 * Language preferences.
     33 * @since 1065
    3334 */
    3435public class LanguagePreference implements SubPreferenceSetting {
     36
     37    private static final String LANGUAGE = "language";
    3538
    3639    /**
     
    5255        // Selecting the language BEFORE the JComboBox listens to model changes speed up initialization by ~35ms (see #7386)
    5356        // See https://stackoverflow.com/questions/3194958/fast-replacement-for-jcombobox-basiccomboboxui
    54         model.selectLanguage(Main.pref.get("language"));
     57        model.selectLanguage(Main.pref.get(LANGUAGE));
    5558        langCombo = new JosmComboBox<>(model);
    5659        langCombo.setRenderer(new LanguageCellRenderer());
     
    7073    public boolean ok() {
    7174        if (langCombo.getSelectedItem() == null)
    72             return Main.pref.put("language", null);
     75            return Main.pref.put(LANGUAGE, null);
    7376        else
    74             return Main.pref.put("language",
     77            return Main.pref.put(LANGUAGE,
    7578                    LanguageInfo.getJOSMLocaleCode((Locale) langCombo.getSelectedItem()));
    7679    }
     
    8487        }
    8588
    86         public void selectLanguage(String language) {
     89        private void selectLanguage(String language) {
    8790            setSelectedItem(null);
    8891            if (language != null) {
    89                 language = LanguageInfo.getJavaLocaleCode(language);
     92                String lang = LanguageInfo.getJavaLocaleCode(language);
    9093                for (Locale locale: data) {
    9194                    if (locale == null) {
    9295                        continue;
    9396                    }
    94                     if (locale.toString().equals(language)) {
     97                    if (locale.toString().equals(lang)) {
    9598                        setSelectedItem(locale);
    9699                        return;
  • trunk/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreference.java

    r10099 r10134  
    878878            }
    879879
    880             public OffsetBookmark getRow(int row) {
     880            private OffsetBookmark getRow(int row) {
    881881                return bookmarks.get(row);
    882882            }
    883883
    884             public void addRow(OffsetBookmark i) {
     884            private void addRow(OffsetBookmark i) {
    885885                bookmarks.add(i);
    886886                int p = getRowCount() - 1;
  • trunk/src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java

    r9543 r10134  
    7777    private static Map<Integer, String> keyList = setKeyList();
    7878
     79    private final JCheckBox cbAlt = new JCheckBox();
     80    private final JCheckBox cbCtrl = new JCheckBox();
     81    private final JCheckBox cbMeta = new JCheckBox();
     82    private final JCheckBox cbShift = new JCheckBox();
     83    private final JCheckBox cbDefault = new JCheckBox();
     84    private final JCheckBox cbDisable = new JCheckBox();
     85    private final JosmComboBox<String> tfKey = new JosmComboBox<>();
     86
     87    private final JTable shortcutTable = new JTable();
     88
     89    private final JosmTextField filterField = new JosmTextField();
     90
     91    /** Creates new form prefJPanel */
     92    public PrefJPanel() {
     93        this.model = new ScListModel();
     94        initComponents();
     95    }
     96
    7997    private static Map<Integer, String> setKeyList() {
    8098        Map<Integer, String> list = new LinkedHashMap<>();
     
    89107                        list.put(Integer.valueOf(i), s);
    90108                    }
    91                 } catch (Exception e) {
     109                } catch (IllegalArgumentException | IllegalAccessException e) {
    92110                    Main.error(e);
    93111                }
     
    96114        list.put(Integer.valueOf(-1), "");
    97115        return list;
    98     }
    99 
    100     private final JCheckBox cbAlt = new JCheckBox();
    101     private final JCheckBox cbCtrl = new JCheckBox();
    102     private final JCheckBox cbMeta = new JCheckBox();
    103     private final JCheckBox cbShift = new JCheckBox();
    104     private final JCheckBox cbDefault = new JCheckBox();
    105     private final JCheckBox cbDisable = new JCheckBox();
    106     private final JosmComboBox<String> tfKey = new JosmComboBox<>();
    107 
    108     private final JTable shortcutTable = new JTable();
    109 
    110     private final JosmTextField filterField = new JosmTextField();
    111 
    112     /** Creates new form prefJPanel */
    113     public PrefJPanel() {
    114         this.model = new ScListModel();
    115         initComponents();
    116116    }
    117117
     
    169169            int row1 = shortcutTable.convertRowIndexToModel(row);
    170170            Shortcut sc = (Shortcut) model.getValueAt(row1, -1);
    171             if (sc == null) return null;
     171            if (sc == null)
     172                return null;
    172173            JLabel label = (JLabel) super.getTableCellRendererComponent(
    173174                table, name ? sc.getLongText() : sc.getKeyText(), isSelected, hasFocus, row, column);
     
    187188
    188189    private void initComponents() {
    189         JPanel listPane = new JPanel(new GridLayout());
    190         JScrollPane listScrollPane = new JScrollPane();
    191         JPanel shortcutEditPane = new JPanel(new GridLayout(5, 2));
    192 
    193190        CbAction action = new CbAction(this);
    194191        setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
     
    197194        // This is the list of shortcuts:
    198195        shortcutTable.setModel(model);
    199         shortcutTable.getSelectionModel().addListSelectionListener(new CbAction(this));
     196        shortcutTable.getSelectionModel().addListSelectionListener(action);
    200197        shortcutTable.setFillsViewportHeight(true);
    201198        shortcutTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
     
    204201        mod.getColumn(0).setCellRenderer(new ShortcutTableCellRenderer(true));
    205202        mod.getColumn(1).setCellRenderer(new ShortcutTableCellRenderer(false));
     203        JScrollPane listScrollPane = new JScrollPane();
    206204        listScrollPane.setViewportView(shortcutTable);
    207205
     206        JPanel listPane = new JPanel(new GridLayout());
    208207        listPane.add(listScrollPane);
    209 
    210208        add(listPane);
    211209
     
    227225        cbMeta.setText(META); // see above for why no tr()
    228226
     227        JPanel shortcutEditPane = new JPanel(new GridLayout(5, 2));
     228
    229229        shortcutEditPane.add(cbDefault);
    230230        shortcutEditPane.add(new JLabel());
     
    266266    }
    267267
    268     private void disableAllModifierCheckboxes() {
    269         cbDefault.setEnabled(false);
    270         cbDisable.setEnabled(false);
    271         cbShift.setEnabled(false);
    272         cbCtrl.setEnabled(false);
    273         cbAlt.setEnabled(false);
    274         cbMeta.setEnabled(false);
    275     }
    276 
    277268    // this allows to edit shortcuts. it:
    278269    //  * sets the edit controls to the selected shortcut
     
    282273    // are playing ping-pong (politically correct: table tennis, I know) and
    283274    // even have some duplicated code. Feel free to refactor, If you have
    284     // more expirience with GUI coding than I have.
    285     private class CbAction extends AbstractAction implements ListSelectionListener {
     275    // more experience with GUI coding than I have.
     276    private static class CbAction extends AbstractAction implements ListSelectionListener {
    286277        private final PrefJPanel panel;
    287278
    288279        CbAction(PrefJPanel panel) {
    289280            this.panel = panel;
     281        }
     282
     283        private void disableAllModifierCheckboxes() {
     284            panel.cbDefault.setEnabled(false);
     285            panel.cbDisable.setEnabled(false);
     286            panel.cbShift.setEnabled(false);
     287            panel.cbCtrl.setEnabled(false);
     288            panel.cbAlt.setEnabled(false);
     289            panel.cbMeta.setEnabled(false);
    290290        }
    291291
     
    303303                panel.cbMeta.setSelected(sc.getAssignedModifier() != -1 && (sc.getAssignedModifier() & KeyEvent.META_DOWN_MASK) != 0);
    304304                if (sc.getKeyStroke() != null) {
    305                     tfKey.setSelectedItem(keyList.get(sc.getKeyStroke().getKeyCode()));
     305                    panel.tfKey.setSelectedItem(keyList.get(sc.getKeyStroke().getKeyCode()));
    306306                } else {
    307                     tfKey.setSelectedItem(keyList.get(-1));
     307                    panel.tfKey.setSelectedItem(keyList.get(-1));
    308308                }
    309309                if (!sc.isChangeable()) {
     
    314314                    actionPerformed(null);
    315315                }
    316                 model.fireTableRowsUpdated(row, row);
     316                panel.model.fireTableRowsUpdated(row, row);
    317317            } else {
    318                 panel.disableAllModifierCheckboxes();
     318                disableAllModifierCheckboxes();
    319319                panel.tfKey.setEnabled(false);
    320320            }
     
    357357                panel.tfKey.setEnabled(state);
    358358            } else {
    359                 panel.disableAllModifierCheckboxes();
     359                disableAllModifierCheckboxes();
    360360                panel.tfKey.setEnabled(false);
    361361            }
     
    364364
    365365    class FilterFieldAdapter implements DocumentListener {
    366         public void filter() {
     366        private void filter() {
    367367            String expr = filterField.getText().trim();
    368368            if (expr.isEmpty()) {
  • trunk/src/org/openstreetmap/josm/io/NoteReader.java

    r9569 r10134  
    101101                String closedTimeStr = attrs.getValue("closed_at");
    102102                if (closedTimeStr == null) { //no closed_at means the note is still open
    103                     thisNote.setState(Note.State.open);
     103                    thisNote.setState(Note.State.OPEN);
    104104                } else {
    105                     thisNote.setState(Note.State.closed);
     105                    thisNote.setState(Note.State.CLOSED);
    106106                    thisNote.setClosedAt(DateUtils.fromString(closedTimeStr));
    107107                }
  • trunk/test/unit/org/openstreetmap/josm/io/NoteReaderTest.java

    r9958 r10134  
    6868        assertEquals(4, n.getId());
    6969        assertEquals(new LatLon(36.7232991, 68.86415), n.getLatLon());
    70         assertEquals(State.closed, n.getState());
     70        assertEquals(State.CLOSED, n.getState());
    7171        List<NoteComment> comments = n.getComments();
    7272        assertEquals(2, comments.size());
     
    7575        assertEquals(c1, n.getFirstComment());
    7676        assertEquals(DateUtils.fromString("2013-04-24 08:07:02 UTC"), c1.getCommentTimestamp());
    77         assertEquals(Action.opened, c1.getNoteAction());
     77        assertEquals(Action.OPENED, c1.getNoteAction());
    7878        assertEquals("test", c1.getText());
    7979        assertEquals(User.createOsmUser(1626, "FredB"), c1.getUser());
    8080
    8181        NoteComment c2 = comments.get(1);
    82         assertEquals(Action.closed, c2.getNoteAction());
     82        assertEquals(Action.CLOSED, c2.getNoteAction());
    8383        assertEquals("", c2.getText());
    8484    }
Note: See TracChangeset for help on using the changeset viewer.