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:
java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.io.Serializable
,javax.accessibility.Accessible
- Direct Known Subclasses:
OSMDownloadSource.OSMDownloadSourcePanel
,OverpassDownloadSource.OverpassDownloadSourcePanel
public abstract class AbstractDownloadSourcePanel<T> extends javax.swing.JPanel
GUI representation ofDownloadSource
that is shown to the user inDownloadDialog
.- Since:
- 12652
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
-
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
-
-
Field Summary
Fields Modifier and Type Field Description protected DownloadSource<T>
downloadSource
The download source of this panel.static java.lang.String
TAB_SPLIT_NAMESPACE
A prefix to be used for tab height preferences-
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractDownloadSourcePanel(DownloadSource<T> downloadSource)
Called when creating a newAbstractDownloadSourcePanel
for the given download source
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
boundingBoxChanged(Bounds bbox)
Updates GUI components of the panel according to the bbox changes.void
checkCancel()
Performs the logic needed in case if the user triggered the cancel action inDownloadDialog
.abstract boolean
checkDownload(DownloadSettings settings)
Performs the logic needed in case if the user triggered the download action inDownloadDialog
.abstract T
getData()
Gets the data.DownloadSource<T>
getDownloadSource()
Gets the download source of this panel.javax.swing.Icon
getIcon()
Gets the icon of the download source panel.abstract java.lang.String
getSimpleName()
Returns a simple name describing this panel.DownloadSourceSizingPolicy
getSizingPolicy()
Gets the policy that defines how this component should be sizedabstract void
rememberSettings()
Saves the current user preferences devoted to the data source.abstract void
restoreSettings()
Restores the latest user preferences devoted to the data source.void
triggerDownload(DownloadSettings downloadSettings)
Tells theDownloadSource
to start downloading-
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
TAB_SPLIT_NAMESPACE
public static final java.lang.String TAB_SPLIT_NAMESPACE
A prefix to be used for tab height preferences- See Also:
- Constant Field Values
-
downloadSource
protected transient DownloadSource<T> downloadSource
The download source of this panel.
-
-
Constructor Detail
-
AbstractDownloadSourcePanel
protected AbstractDownloadSourcePanel(DownloadSource<T> downloadSource)
Called when creating a newAbstractDownloadSourcePanel
for the given download source- Parameters:
downloadSource
- The download source this panel is for
-
-
Method Detail
-
getDownloadSource
public DownloadSource<T> 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 inDownloadDialog
.- Parameters:
settings
- The settings to check.- Returns:
- Returns
true
if the required procedure of handling the download action succeeded andDownloadDialog
can be closed, e.g. validation, otherwisefalse
.
-
checkCancel
public void checkCancel()
Performs the logic needed in case if the user triggered the cancel action inDownloadDialog
.
-
getIcon
public javax.swing.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 theDownloadSource
to start downloading- Parameters:
downloadSettings
- The download settings
-
getSimpleName
public abstract java.lang.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
public DownloadSourceSizingPolicy getSizingPolicy()
Gets the policy that defines how this component should be sized- Returns:
- The sizing policy. A fixed policy on default.
- Since:
- 12705
-
-