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

Last change on this file since 16553 was 16553, checked in by Don-vip, 4 years ago

see #19334 - javadoc fixes + protected constructors for abstract classes

File size: 1.9 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 /**
21 * Returns the checkbox to be added to the UI.
22 * @return The checkbox to be added to the UI
23 */
24 default JCheckBox getCheckBox() {
25 return getCheckBox(null);
26 }
27
28 /**
29 * Returns the checkbox to be added to the UI.
30 * @param checkboxChangeListener The listener for checkboxes (may be {@code null})
31 * @return The checkbox to be added to the UI
32 */
33 JCheckBox getCheckBox(ChangeListener checkboxChangeListener);
34
35 /**
36 * Returns the download task class which will be getting the data.
37 * @return The {@link DownloadTask} class which will be getting the data
38 */
39 Class<? extends AbstractDownloadTask<?>> getDownloadClass();
40
41 /**
42 * Determines the last state of the download type.
43 * @return The boolean indicating the last state of the download type
44 */
45 default boolean isEnabled() {
46 return getBooleanProperty().get();
47 }
48
49 /**
50 * Returns the boolean property for this particular download type.
51 * @return The boolean property for this particular download type
52 */
53 BooleanProperty getBooleanProperty();
54
55 /**
56 * Check if the area is too large for the current IDownloadSourceType
57 *
58 * @param bound The bound that will be downloaded
59 * @return {@code true} if we definitely cannot download the area;
60 */
61 boolean isDownloadAreaTooLarge(Bounds bound);
62}
Note: See TracBrowser for help on using the repository browser.