Changeset 10179 in josm for trunk/src/org/openstreetmap/josm/gui/preferences/projection/CodeProjectionChoice.java
- Timestamp:
- 2016-05-11T02:44:10+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/projection/CodeProjectionChoice.java
r9609 r10179 47 47 private static class CodeSelectionPanel extends JPanel implements ListSelectionListener, DocumentListener { 48 48 49 public JosmTextField filter;50 private ProjectionCodeListModel model;49 public final JosmTextField filter = new JosmTextField(30); 50 private final ProjectionCodeListModel model = new ProjectionCodeListModel(); 51 51 public JList<String> selectionList; 52 52 private final List<String> data; … … 89 89 90 90 private void build() { 91 filter = new JosmTextField(30);92 91 filter.setColumns(10); 93 92 filter.getDocument().addDocumentListener(this); 94 93 95 94 selectionList = new JList<>(data.toArray(new String[0])); 96 selectionList.setModel(model = new ProjectionCodeListModel());95 selectionList.setModel(model); 97 96 JScrollPane scroll = new JScrollPane(selectionList); 98 97 scroll.setPreferredSize(new Dimension(200, 214)); … … 105 104 public String getCode() { 106 105 int idx = selectionList.getSelectedIndex(); 107 if (idx == -1) return lastCode; 106 if (idx == -1) 107 return lastCode; 108 108 return filteredData.get(selectionList.getSelectedIndex()); 109 109 } … … 174 174 if (matcher2.matches()) { 175 175 int cmp1 = matcher1.group(1).compareTo(matcher2.group(1)); 176 if (cmp1 != 0) return cmp1; 176 if (cmp1 != 0) 177 return cmp1; 177 178 int num1 = Integer.parseInt(matcher1.group(2)); 178 179 int num2 = Integer.parseInt(matcher2.group(2));
Note:
See TracChangeset
for help on using the changeset viewer.