Changeset 9606 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2016-01-24T03:50:35+01:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/download
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/download/BookmarkSelection.java
r9543 r9606 105 105 public void addGui(final DownloadDialog gui) { 106 106 JPanel dlg = new JPanel(new GridBagLayout()); 107 gui.addDownloadAreaSelector(dlg, tr("Bookmarks")); 107 if (gui != null) 108 gui.addDownloadAreaSelector(dlg, tr("Bookmarks")); 108 109 GridBagConstraints gc = new GridBagConstraints(); 109 110 … … 113 114 public void valueChanged(ListSelectionEvent e) { 114 115 Bookmark b = bookmarks.getSelectedValue(); 115 if (b != null ) {116 if (b != null && gui != null) { 116 117 gui.boundingBoxChanged(b.getArea(), BookmarkSelection.this); 117 118 } -
trunk/src/org/openstreetmap/josm/gui/download/BoundingBoxSelection.java
r9078 r9606 121 121 showUrl.addFocusListener(new SelectAllOnFocusHandler(showUrl)); 122 122 123 gui.addDownloadAreaSelector(dlg, tr("Bounding Box")); 123 if (gui != null) 124 gui.addDownloadAreaSelector(dlg, tr("Bounding Box")); 124 125 this.parent = gui; 125 126 } -
trunk/src/org/openstreetmap/josm/gui/download/PlaceSelection.java
r9543 r9606 62 62 import org.xml.sax.helpers.DefaultHandler; 63 63 64 /** 65 * Place selector. 66 * @since 1329 67 */ 64 68 public class PlaceSelection implements DownloadSelection { 65 69 private static final String HISTORY_KEY = "download.places.history"; … … 145 149 panel.add(scrollPane, BorderLayout.CENTER); 146 150 147 gui.addDownloadAreaSelector(panel, tr("Areas around places")); 151 if (gui != null) 152 gui.addDownloadAreaSelector(panel, tr("Areas around places")); 148 153 149 154 scrollPane.setPreferredSize(scrollPane.getPreferredSize()); … … 151 156 tblSearchResults.getSelectionModel().addListSelectionListener(new ListSelectionHandler()); 152 157 tblSearchResults.addMouseListener(new MouseAdapter() { 153 @Override public void mouseClicked(MouseEvent e) { 158 @Override 159 public void mouseClicked(MouseEvent e) { 154 160 if (e.getClickCount() > 1) { 155 161 SearchResult sr = model.getSelectedSearchResult(); 156 if (sr == null) return; 157 parent.startDownload(sr.getDownloadArea()); 162 if (sr != null) { 163 parent.startDownload(sr.getDownloadArea()); 164 } 158 165 } 159 166 } … … 410 417 @Override 411 418 public int getRowCount() { 412 if (data == null) return 0; 413 return data.size(); 419 return data != null ? data.size() : 0; 414 420 } 415 421 416 422 @Override 417 423 public Object getValueAt(int row, int column) { 418 if (data == null) return null; 419 return data.get(row); 424 return data != null ? data.get(row) : null; 420 425 } 421 426 … … 444 449 private TableColumn col3; 445 450 private TableColumn col4; 451 452 NamedResultTableColumnModel() { 453 createColumns(); 454 } 455 446 456 protected final void createColumns() { 447 TableColumn col = null;457 TableColumn col; 448 458 NamedResultCellRenderer renderer = new NamedResultCellRenderer(); 449 459 … … 485 495 col4.setHeaderValue(fourth); 486 496 fireColumnMarginChanged(); 487 }488 489 NamedResultTableColumnModel() {490 createColumns();491 497 } 492 498 } … … 555 561 renderColor(isSelected); 556 562 557 if (value == null) return this; 563 if (value == null) 564 return this; 558 565 SearchResult sr = (SearchResult) value; 559 566 switch(column) { -
trunk/src/org/openstreetmap/josm/gui/download/TileSelection.java
r8510 r9606 37 37 @Override 38 38 public void addGui(final DownloadDialog gui) { 39 gui.addDownloadAreaSelector(chooser, tr("Tile Numbers")); 39 if (gui != null) 40 gui.addDownloadAreaSelector(chooser, tr("Tile Numbers")); 40 41 parent = gui; 41 42 }
Note:
See TracChangeset
for help on using the changeset viewer.