public class UploadDialog extends AbstractUploadDialog implements java.beans.PropertyChangeListener, PreferenceChangedListener
Modifier and Type | Class and Description |
---|---|
(package private) static class |
UploadDialog.CancelAction
Action for canceling the dialog.
|
(package private) static class |
UploadDialog.CompactTabbedPane |
(package private) static class |
UploadDialog.UploadAction
Handles an upload.
|
(package private) class |
UploadDialog.WindowEventHandler
Listens to window closing events and processes them as cancel events.
|
javax.swing.JDialog.AccessibleJDialog
java.awt.Dialog.AccessibleAWTDialog, java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityType
java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
Modifier and Type | Field and Description |
---|---|
private javax.swing.JButton |
btnUpload
the upload button
|
private ChangesetCommentModel |
changesetCommentModel
the changeset comment model keeping the state of the changeset comment
|
private ChangesetReviewModel |
changesetReviewModel |
private ChangesetCommentModel |
changesetSourceModel |
private static java.lang.String |
CREATED_BY
the "created_by" changeset OSM key
|
private static java.util.Collection<java.awt.Component> |
customComponents
list of custom components that can be added by plugins at JOSM startup
|
private DataSet |
dataSet |
private BasicUploadSettingsPanel |
pnlBasicUploadSettings |
private ChangesetManagementPanel |
pnlChangesetManagement
the panel to select the changeset used
|
private TagSettingsPanel |
pnlTagSettings
checkbox for selecting whether an atomic upload is to be used
|
private UploadedObjectsSummaryPanel |
pnlUploadedObjects
the panel with the objects to upload
|
private UploadStrategySelectionPanel |
pnlUploadStrategySelectionPanel |
private javax.swing.JTabbedPane |
tpConfigPanels
the tabbed pane used below of the list of primitives
|
private static UploadDialog |
uploadDialog
the unique instance of the upload dialog
|
accessibleContext, rootPane, rootPaneCheckingEnabled
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Constructor and Description |
---|
UploadDialog()
Constructs a new
UploadDialog . |
Modifier and Type | Method and Description |
---|---|
static boolean |
addCustomComponent(java.awt.Component c)
Adds a custom component to this dialog.
|
protected void |
build()
builds the gui
|
protected javax.swing.JPanel |
buildActionPanel()
builds the panel with the OK and CANCEL buttons
|
protected javax.swing.JPanel |
buildContentPanel()
builds the content panel for the upload dialog
|
void |
clean()
Clean dialog state and release resources.
|
void |
forceUpdateActiveField()
Forces update of comment/source model if matching text field is active.
|
Changeset |
getChangeset()
Replies the current changeset
|
static java.lang.String |
getLastChangesetCommentFromHistory()
Returns the last changeset comment from history.
|
static java.lang.String |
getLastChangesetSourceFromHistory()
Returns the last changeset source from history.
|
private static java.lang.String |
getLastChangesetTagFromHistory(java.lang.String historyKey,
java.util.List<java.lang.String> def) |
java.util.Map<java.lang.String,java.lang.String> |
getTags(boolean keepEmpty)
Replies the map with the current tags in the tag editor model.
|
java.lang.String |
getUploadComment()
Returns the current value for the upload comment
|
static UploadDialog |
getUploadDialog()
Replies the unique instance of the upload dialog
|
java.lang.String |
getUploadSource()
Returns the current value for the changeset source
|
UploadStrategySpecification |
getUploadStrategySpecification()
Replies the
UploadStrategySpecification the user entered in the dialog. |
void |
handleIllegalChunkSize()
Handles illegal chunk size.
|
void |
handleMissingComment()
Handles missing comment.
|
void |
handleMissingSource()
Handles missing source.
|
private void |
osmServerUrlChanged(Setting<?> newValue) |
void |
preferenceChanged(PreferenceChangeEvent e)
Triggered when a preference entry value changes.
|
void |
propertyChange(java.beans.PropertyChangeEvent evt) |
void |
rememberUserInput()
Remembers the user input in the preference settings
|
void |
setChangesetTags(DataSet dataSet)
Sets the tags for this upload based on (later items overwrite earlier ones):
previous "source" and "comment" input
the tags set in the dataset (see
DataSet.getChangeSetTags() )
the tags from the selected open changeset
the JOSM user agent (see Version.getAgentString(boolean) )
|
private void |
setChangesetTags(DataSet dataSet,
boolean keepSourceComment)
Sets the tags for this upload based on (later items overwrite earlier ones):
previous "source" and "comment" input
the tags set in the dataset (see
DataSet.getChangeSetTags() )
the tags from the selected open changeset
the JOSM user agent (see Version.getAgentString(boolean) )
|
void |
setSelectedChangesetForNextUpload(Changeset cs)
Sets the changeset to be used in the next upload
|
void |
setUploadedPrimitives(APIDataSet toUpload)
Sets the collection of primitives to upload
|
void |
setVisible(boolean visible) |
void |
startUserInput()
Initializes the panel for user input
|
isCanceled, setCanceled
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, update
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, show, toBack
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, toFront
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, validateTree
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, getPeer, 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, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
private static UploadDialog uploadDialog
private static final java.util.Collection<java.awt.Component> customComponents
private static final java.lang.String CREATED_BY
private UploadedObjectsSummaryPanel pnlUploadedObjects
private ChangesetManagementPanel pnlChangesetManagement
private BasicUploadSettingsPanel pnlBasicUploadSettings
private UploadStrategySelectionPanel pnlUploadStrategySelectionPanel
private TagSettingsPanel pnlTagSettings
private javax.swing.JTabbedPane tpConfigPanels
private javax.swing.JButton btnUpload
private final transient ChangesetCommentModel changesetCommentModel
private final transient ChangesetCommentModel changesetSourceModel
private final transient ChangesetReviewModel changesetReviewModel
public UploadDialog()
UploadDialog
.public static UploadDialog getUploadDialog()
protected javax.swing.JPanel buildContentPanel()
protected javax.swing.JPanel buildActionPanel()
protected void build()
public void setUploadedPrimitives(APIDataSet toUpload)
toUpload
- the dataset with the objects to upload. If null, assumes the empty
set of objects to uploadpublic void setChangesetTags(DataSet dataSet)
DataSet.getChangeSetTags()
)Version.getAgentString(boolean)
)dataSet
- to obtain the tags set in the datasetprivate void setChangesetTags(DataSet dataSet, boolean keepSourceComment)
DataSet.getChangeSetTags()
)Version.getAgentString(boolean)
)dataSet
- to obtain the tags set in the datasetkeepSourceComment
- if true
, keep upload source
and comment
current values from modelspublic void rememberUserInput()
IUploadDialog
rememberUserInput
in interface IUploadDialog
rememberUserInput
in class AbstractUploadDialog
public void startUserInput()
public Changeset getChangeset()
public void setSelectedChangesetForNextUpload(Changeset cs)
cs
- the changesetpublic UploadStrategySpecification getUploadStrategySpecification()
IUploadDialog
UploadStrategySpecification
the user entered in the dialog.getUploadStrategySpecification
in interface IUploadDialog
UploadStrategySpecification
the user entered in the dialog.public java.lang.String getUploadComment()
IUploadDialog
getUploadComment
in interface IUploadDialog
public java.lang.String getUploadSource()
IUploadDialog
getUploadSource
in interface IUploadDialog
public void setVisible(boolean visible)
setVisible
in class java.awt.Dialog
public static boolean addCustomComponent(java.awt.Component c)
c
- The custom component to add. If null
, this method does nothing.true
if the collection of custom components changed as a result of the callpublic void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange
in interface java.beans.PropertyChangeListener
public void preferenceChanged(PreferenceChangeEvent e)
PreferenceChangedListener
preferenceChanged
in interface PreferenceChangedListener
e
- the preference change eventprivate void osmServerUrlChanged(Setting<?> newValue)
private static java.lang.String getLastChangesetTagFromHistory(java.lang.String historyKey, java.util.List<java.lang.String> def)
public static java.lang.String getLastChangesetCommentFromHistory()
public static java.lang.String getLastChangesetSourceFromHistory()
public java.util.Map<java.lang.String,java.lang.String> getTags(boolean keepEmpty)
IUploadDialog
getTags
in interface IUploadDialog
keepEmpty
- true
to keep empty tagspublic void handleMissingComment()
IUploadDialog
handleMissingComment
in interface IUploadDialog
public void handleMissingSource()
IUploadDialog
handleMissingSource
in interface IUploadDialog
public void handleIllegalChunkSize()
IUploadDialog
handleIllegalChunkSize
in interface IUploadDialog
public void forceUpdateActiveField()
IUploadDialog
forceUpdateActiveField
in interface IUploadDialog
public void clean()