Package org.openstreetmap.josm.gui.io
Class UploadDialog
java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
javax.swing.JDialog
org.openstreetmap.josm.gui.io.AbstractUploadDialog
org.openstreetmap.josm.gui.io.UploadDialog
- All Implemented Interfaces:
ImageObserver,MenuContainer,PropertyChangeListener,Serializable,EventListener,Accessible,RootPaneContainer,WindowConstants,IUploadDialog,PreferenceChangedListener
public class UploadDialog
extends AbstractUploadDialog
implements PreferenceChangedListener, PropertyChangeListener
This is a dialog for entering upload options like the parameters for
the upload changeset and the strategy for opening/closing a changeset.
- Since:
- 2025
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static classAction for canceling the dialog.(package private) static final class(package private) static classHandles an upload.(package private) classListens to window closing events and processes them as cancel events.Nested classes/interfaces inherited from class javax.swing.JDialog
JDialog.AccessibleJDialogNested classes/interfaces inherited from class java.awt.Dialog
Dialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityTypeNested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow, Window.TypeNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate JButtonthe upload buttonprivate ChangeListenerprivate DataSetprivate final UploadDialogModelthe model keeping the state of the changeset tagsprivate BasicUploadSettingsPanelthe "description" tabprivate ChangesetManagementPanelthe panel to select the changeset usedprivate TagEditorPanelthe tag editor panelprivate UploadedObjectsSummaryPanelthe panel with the objects to uploadprivate UploadStrategySelectionPanelthe panel to select the upload strategyprivate JTabbedPanethe tabbed pane used below of the list of primitivesprivate static UploadDialogthe unique instance of the upload dialogprivate static final ColorA warning color to indicate something is non-default in the changeset tagsFields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabledFields inherited from class java.awt.Dialog
DEFAULT_MODALITY_TYPEFields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbuild()builds the guiprotected JPanelbuilds the panel with the OK and CANCEL buttonsprotected JPanelbuilds the content panel for the upload dialogvoidclean()Clean dialog state and release resources.Returns the changeset to use complete with tagsgetModel()Get the upload dialog model.getTags(boolean keepEmpty) Replies the map with the current tags in the tag editor model.Returns the current value for the upload commentstatic UploadDialogReplies the unique instance of the upload dialogReturns the current value for the changeset sourceReplies theUploadStrategySpecificationthe user entered in the dialog.voidHandles illegal chunk size.voidHandles missing comment.voidHandles missing source.voidinitLifeCycle(DataSet dataSet) Initializes this life cycle of the dialog.private voidosmServerUrlChanged(Setting<?> newValue) voidTriggered when a preference entry value changes.voidvoidRemembers the user input in the preference settingsvoidSave all outstanding edits to the model.voidThis is called byUploadDialog.UploadActionifUploadHooks change the changeset tags.voidSets the input focus to upload button.voidSets the changeset to be used in the next uploadvoidsetUploadedPrimitives(APIDataSet toUpload) Sets the collection of primitives to uploadvoidsetVisible(boolean visible) Methods inherited from class org.openstreetmap.josm.gui.io.AbstractUploadDialog
isCanceled, setCanceledMethods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, updateMethods inherited from class java.awt.Dialog
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, show, toBackMethods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFrontMethods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTreeMethods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
WARNING_BACKGROUND
A warning color to indicate something is non-default in the changeset tags -
uploadDialog
the unique instance of the upload dialog -
pnlUploadedObjects
the panel with the objects to upload -
pnlBasicUploadSettings
the "description" tab -
pnlChangesetManagement
the panel to select the changeset used -
pnlUploadStrategySelectionPanel
the panel to select the upload strategy -
pnlTagEditor
the tag editor panel -
tpConfigPanels
the tabbed pane used below of the list of primitives -
btnUpload
the upload button -
model
the model keeping the state of the changeset tags -
dataSet
-
changesetTagListener
-
-
Constructor Details
-
UploadDialog
protected UploadDialog()Constructs a newUploadDialog.
-
-
Method Details
-
getUploadDialog
Replies the unique instance of the upload dialog- Returns:
- the unique instance of the upload dialog
-
buildContentPanel
builds the content panel for the upload dialog- Returns:
- the content panel
-
buildActionPanel
builds the panel with the OK and CANCEL buttons- Returns:
- The panel with the OK and CANCEL buttons
-
build
builds the gui -
initLifeCycle
Initializes this life cycle of the dialog. Initializes the dialog each time before it is made visible. We cannot do this in the constructor because the dialog is a singleton.- Parameters:
dataSet- The Dataset we want to upload- Since:
- 18173
-
setUploadedPrimitives
Sets the collection of primitives to upload- Parameters:
toUpload- the dataset with the objects to upload. If null, assumes the empty set of objects to upload
-
setFocusToUploadButton
Sets the input focus to upload button.- Since:
- 18173
-
rememberUserInput
Description copied from interface:IUploadDialogRemembers the user input in the preference settings- Specified by:
rememberUserInputin interfaceIUploadDialog- Overrides:
rememberUserInputin classAbstractUploadDialog
-
getChangeset
Returns the changeset to use complete with tags- Returns:
- the changeset to use
-
setSelectedChangesetForNextUpload
Sets the changeset to be used in the next upload- Parameters:
cs- the changeset
-
getUploadStrategySpecification
Description copied from interface:IUploadDialogReplies theUploadStrategySpecificationthe user entered in the dialog.- Specified by:
getUploadStrategySpecificationin interfaceIUploadDialog- Returns:
- the
UploadStrategySpecificationthe user entered in the dialog.
-
getModel
Get the upload dialog model.- Returns:
- The model.
- Since:
- 18173
-
getUploadComment
Description copied from interface:IUploadDialogReturns the current value for the upload comment- Specified by:
getUploadCommentin interfaceIUploadDialog- Returns:
- the current value for the upload comment
-
getUploadSource
Description copied from interface:IUploadDialogReturns the current value for the changeset source- Specified by:
getUploadSourcein interfaceIUploadDialog- Returns:
- the current value for the changeset source
-
setVisible
- Overrides:
setVisiblein classDialog
-
setChangesetTagsModifiedProgramatically
This is called byUploadDialog.UploadActionifUploadHooks change the changeset tags. -
propertyChange
- Specified by:
propertyChangein interfacePropertyChangeListener
-
preferenceChanged
Description copied from interface:PreferenceChangedListenerTriggered when a preference entry value changes.- Specified by:
preferenceChangedin interfacePreferenceChangedListener- Parameters:
e- the preference change event
-
osmServerUrlChanged
-
getTags
Description copied from interface:IUploadDialogReplies the map with the current tags in the tag editor model.- Specified by:
getTagsin interfaceIUploadDialog- Parameters:
keepEmpty-trueto keep empty tags- Returns:
- the map with the current tags in the tag editor model.
-
handleMissingComment
Description copied from interface:IUploadDialogHandles missing comment.- Specified by:
handleMissingCommentin interfaceIUploadDialog
-
handleMissingSource
Description copied from interface:IUploadDialogHandles missing source.- Specified by:
handleMissingSourcein interfaceIUploadDialog
-
handleIllegalChunkSize
Description copied from interface:IUploadDialogHandles illegal chunk size.- Specified by:
handleIllegalChunkSizein interfaceIUploadDialog
-
saveEdits
Save all outstanding edits to the model.The combobox editors and the tag cell editor need to be manually saved because they normally save on focus loss, eg. when the "Upload" button is pressed, but there's no focus change when Ctrl+Enter is pressed.
- Since:
- 18173
-
clean
Clean dialog state and release resources.- Since:
- 14251
-