Changeset 16915 in josm
- Timestamp:
- 2020-08-23T17:23:28+02:00 (4 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/download
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/download/IDownloadSourceType.java
r16553 r16915 2 2 package org.openstreetmap.josm.gui.download; 3 3 4 import javax.swing.Icon; 4 5 import javax.swing.JCheckBox; 5 6 import javax.swing.event.ChangeListener; … … 34 35 35 36 /** 37 * Returns the icon to be added to the UI. 38 * @return The icon to be added to the UI 39 */ 40 default Icon getIcon() { 41 return null; 42 } 43 44 /** 36 45 * Returns the download task class which will be getting the data. 37 46 * @return The {@link DownloadTask} class which will be getting the data -
trunk/src/org/openstreetmap/josm/gui/download/OSMDownloadSource.java
r16914 r16915 18 18 import java.util.concurrent.Future; 19 19 20 import javax.swing.Box; 20 21 import javax.swing.Icon; 21 22 import javax.swing.JCheckBox; … … 232 233 downloadSourcesPanel.removeAll(); 233 234 downloadSourcesPanel.add(new JLabel(tr(DATA_SOURCES_AND_TYPES))); 234 DOWNLOAD_SOURCES 235 .forEach(obj -> downloadSourcesPanel.add(obj.getCheckBox(checkboxChangeListener))); 235 DOWNLOAD_SOURCES.forEach(obj -> { 236 final Icon icon = obj.getIcon(); 237 if (icon != null) { 238 downloadSourcesPanel.add(Box.createHorizontalStrut(6)); 239 downloadSourcesPanel.add(new JLabel(icon)); 240 } 241 downloadSourcesPanel.add(obj.getCheckBox(checkboxChangeListener)); 242 }); 236 243 } 237 244 … … 424 431 425 432 @Override 433 public Icon getIcon() { 434 return ImageProvider.get("layer/osmdata_small", ImageProvider.ImageSizes.SMALLICON); 435 } 436 437 @Override 426 438 public Class<? extends AbstractDownloadTask<DataSet>> getDownloadClass() { 427 439 return DownloadOsmTask.class; … … 459 471 460 472 @Override 473 public Icon getIcon() { 474 return ImageProvider.get("layer/gpx_small", ImageProvider.ImageSizes.SMALLICON); 475 } 476 477 @Override 461 478 public Class<? extends AbstractDownloadTask<GpxData>> getDownloadClass() { 462 479 return DownloadGpsTask.class; … … 492 509 493 510 @Override 511 public Icon getIcon() { 512 return ImageProvider.get("layer/marker_small", ImageProvider.ImageSizes.SMALLICON); 513 } 514 515 @Override 494 516 public Class<? extends AbstractDownloadTask<NoteData>> getDownloadClass() { 495 517 return DownloadNotesTask.class;
Note:
See TracChangeset
for help on using the changeset viewer.