source: josm/trunk/src/org/openstreetmap/josm/gui/download/IDownloadSourceType.java@ 16503

Last change on this file since 16503 was 16503, checked in by simon04, 4 years ago

fix #18340 - Allow additional sources of data to be downloaded at the same time as OpenStreetMap data sources (patch by taylor.smock)

File size: 1.6 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.download;
3
4import javax.swing.JCheckBox;
5import javax.swing.event.ChangeListener;
6
7import org.openstreetmap.josm.actions.downloadtasks.AbstractDownloadTask;
8import org.openstreetmap.josm.actions.downloadtasks.DownloadTask;
9import org.openstreetmap.josm.data.Bounds;
10import org.openstreetmap.josm.data.preferences.BooleanProperty;
11
12/**
13 * An interface to allow arbitrary download sources and types in the primary
14 * download window of JOSM
15 *
16 * @since 16503
17 */
18public interface IDownloadSourceType {
19 /**
20 * @return The checkbox to be added to the UI
21 */
22 default JCheckBox getCheckBox() {
23 return getCheckBox(null);
24 }
25
26 /**
27 * @param checkboxChangeListener The listener for checkboxes (may be {@code null})
28 * @return The checkbox to be added to the UI
29 */
30 JCheckBox getCheckBox(ChangeListener checkboxChangeListener);
31
32 /**
33 * @return The {@link DownloadTask} class which will be getting the data
34 */
35 Class<? extends AbstractDownloadTask<?>> getDownloadClass();
36
37 /**
38 * @return The boolean indicating the last state of the download type
39 */
40 default boolean isEnabled() {
41 return getBooleanProperty().get();
42 }
43
44 /**
45 * @return The boolean property for this particular download type
46 */
47 BooleanProperty getBooleanProperty();
48
49 /**
50 * Check if the area is too large for the current IDownloadSourceType
51 *
52 * @param bound The bound that will be downloaded
53 * @return {@code true} if we definitely cannot download the area;
54 */
55 boolean isDownloadAreaTooLarge(Bounds bound);
56}
Note: See TracBrowser for help on using the repository browser.