Class AbstractDownloadSourcePanel<T>

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.openstreetmap.josm.gui.download.AbstractDownloadSourcePanel<T>
Type Parameters:
T - The type of the data that a download source uses.
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible
Direct Known Subclasses:
OSMDownloadSource.OSMDownloadSourcePanel, OverpassDownloadSource.OverpassDownloadSourcePanel

public abstract class AbstractDownloadSourcePanel<T> extends JPanel
GUI representation of DownloadSource that is shown to the user in DownloadDialog.
Since:
12652
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • getData

      public abstract T getData()
      Gets the data.
      Returns:
      Returns the data.
    • getDownloadSource

      Gets the download source of this panel.
      Returns:
      Returns the download source of this panel.
    • rememberSettings

      public abstract void rememberSettings()
      Saves the current user preferences devoted to the data source.
    • restoreSettings

      public abstract void restoreSettings()
      Restores the latest user preferences devoted to the data source.
    • checkDownload

      public abstract boolean checkDownload(DownloadSettings settings)
      Performs the logic needed in case if the user triggered the download action in DownloadDialog.
      Parameters:
      settings - The settings to check.
      Returns:
      Returns true if the required procedure of handling the download action succeeded and DownloadDialog can be closed, e.g. validation, otherwise false.
    • checkCancel

      public void checkCancel()
      Performs the logic needed in case if the user triggered the cancel action in DownloadDialog.
    • getIcon

      public Icon getIcon()
      Gets the icon of the download source panel.
      Returns:
      The icon. Can be null if there is no icon associated with this download source.
    • boundingBoxChanged

      public void boundingBoxChanged(Bounds bbox)
      Updates GUI components of the panel according to the bbox changes.
      Parameters:
      bbox - The new value for the bounding box.
      Since:
      13498
    • triggerDownload

      public void triggerDownload(DownloadSettings downloadSettings)
      Tells the DownloadSource to start downloading
      Parameters:
      downloadSettings - The download settings
    • getSimpleName

      public abstract String getSimpleName()
      Returns a simple name describing this panel. This string can be used from other GUI parts of JOSM to save the user preferences related to the GUI settings. For example, the panel for downloading the OSM data can be named 'downloadosmpanel'. Note, choose the name such that it is unique to avoid collisions with other names.
      Returns:
      A simple name describing this panel.
    • getSizingPolicy

      Gets the policy that defines how this component should be sized
      Returns:
      The sizing policy. A fixed policy on default.
      Since:
      12705