Class BasicUploadSettingsPanel

  • All Implemented Interfaces:
    java.awt.event.ActionListener, java.awt.event.FocusListener, java.awt.event.ItemListener, java.awt.event.KeyListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.TableModelListener

    public class BasicUploadSettingsPanel
    extends javax.swing.JPanel
    implements java.awt.event.ActionListener, java.awt.event.FocusListener, java.awt.event.ItemListener, java.awt.event.KeyListener, javax.swing.event.TableModelListener
    BasicUploadSettingsPanel allows to enter the basic parameters required for uploading data.
    Since:
    2599
    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
      • Nested classes/interfaces inherited from class java.awt.Container

        java.awt.Container.AccessibleAWTContainer
      • Nested classes/interfaces inherited from class java.awt.Component

        java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void actionPerformed​(java.awt.event.ActionEvent e)
      Update the model when the selection changes in a combobox.
      protected void build()  
      protected javax.swing.JPanel buildUploadCommentPanel()  
      protected javax.swing.JPanel buildUploadSourcePanel()  
      void focusGained​(java.awt.event.FocusEvent e)  
      void focusLost​(java.awt.event.FocusEvent e)
      Update the model and combobox history when a combobox editor loses focus.
      private java.lang.String get​(java.lang.String key)
      Get a key's value from the model.
      static java.util.List<java.lang.String> getDefaultSources()
      Returns the default list of sources.
      private UploadDialog getDialog()
      Returns the UplodDialog that is our ancestor
      (package private) static long getHistoryLastUsedKey()  
      (package private) static long getHistoryMaxAgeKey()  
      static java.lang.String getLastChangesetTagFromHistory​(java.lang.String historyKey, java.util.List<java.lang.String> def)
      Get the topmost item from the history if not expired.
      (package private) java.lang.String getSourceFromLayer()
      Add the "source" tag
      UploadParameterSummaryPanel getUploadParameterSummaryPanel()
      Returns the panel that displays a summary of data the user is about to upload.
      protected java.util.List<UploadTextComponentValidator> getUploadTextValidators()
      Returns the list of UploadTextComponentValidator defined by this panel.
      void initEditingOfUploadComment()
      Initializes editing of upload comment.
      void initEditingOfUploadSource()
      Initializes editing of upload source.
      void initLifeCycle​(java.util.Map<java.lang.String,​java.lang.String> map)
      Initializes this life cycle of the panel.
      void itemStateChanged​(java.awt.event.ItemEvent e)
      Updates the table editor model upon changes in the "review" checkbox.
      void keyPressed​(java.awt.event.KeyEvent e)  
      void keyReleased​(java.awt.event.KeyEvent e)  
      void keyTyped​(java.awt.event.KeyEvent e)
      Set the focus directly to the upload button if "Enter" key is pressed in any combobox.
      void rememberUserInput()
      Remembers the user input in the preference settings
      void saveEdits()
      Save all outstanding edits to the model.
      private void setFocusToUploadButton()  
      (package private) void setUploadedPrimitives​(java.util.List<OsmPrimitive> primitives)  
      void tableChanged​(javax.swing.event.TableModelEvent e)
      Updates the controls upon changes in the table editor model.
      private void updateHistory​(javax.swing.JTextField text)
      Updates the combobox histories when a combobox editor loses focus.
      private void updateModel​(javax.swing.JTextField text)
      Updates the table editor model with changes in the comboboxes.
      • 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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • build

        protected void build()
      • initLifeCycle

        public void initLifeCycle​(java.util.Map<java.lang.String,​java.lang.String> map)
        Initializes this life cycle of the panel. Adds the comment and source tags from history, and/or obtains the source from the layer if the user said so.
        Parameters:
        map - Map where tags are added to.
        Since:
        18173
      • get

        private java.lang.String get​(java.lang.String key)
        Get a key's value from the model.
        Parameters:
        key - The key
        Returns:
        The value or ""
        Since:
        18173
      • getLastChangesetTagFromHistory

        public static java.lang.String getLastChangesetTagFromHistory​(java.lang.String historyKey,
                                                                      java.util.List<java.lang.String> def)
        Get the topmost item from the history if not expired.
        Parameters:
        historyKey - The preferences key.
        def - A default history.
        Returns:
        The history item (may be null).
        Since:
        18173 (signature)
      • getSourceFromLayer

        java.lang.String getSourceFromLayer()
        Add the "source" tag
        Returns:
        The source from the layer info.
      • getDefaultSources

        public static java.util.List<java.lang.String> getDefaultSources()
        Returns the default list of sources.
        Returns:
        the default list of sources
      • rememberUserInput

        public void rememberUserInput()
        Remembers the user input in the preference settings
      • updateHistory

        private void updateHistory​(javax.swing.JTextField text)
        Updates the combobox histories when a combobox editor loses focus.
        Parameters:
        text - The JTextField of the combobox editor.
      • updateModel

        private void updateModel​(javax.swing.JTextField text)
        Updates the table editor model with changes in the comboboxes. The lock prevents loops in change notifications, eg. the combobox notifies the table model and the table model notifies the combobox, which throws IllegalStateException.
        Parameters:
        text - The JTextField of the combobox editor.
      • getDialog

        private UploadDialog getDialog()
        Returns the UplodDialog that is our ancestor
        Returns:
        the UploadDialog or null
      • actionPerformed

        public void actionPerformed​(java.awt.event.ActionEvent e)
        Update the model when the selection changes in a combobox.
        Specified by:
        actionPerformed in interface java.awt.event.ActionListener
        Parameters:
        e - The action event.
      • focusGained

        public void focusGained​(java.awt.event.FocusEvent e)
        Specified by:
        focusGained in interface java.awt.event.FocusListener
      • focusLost

        public void focusLost​(java.awt.event.FocusEvent e)
        Update the model and combobox history when a combobox editor loses focus.
        Specified by:
        focusLost in interface java.awt.event.FocusListener
      • itemStateChanged

        public void itemStateChanged​(java.awt.event.ItemEvent e)
        Updates the table editor model upon changes in the "review" checkbox.
        Specified by:
        itemStateChanged in interface java.awt.event.ItemListener
      • tableChanged

        public void tableChanged​(javax.swing.event.TableModelEvent e)
        Updates the controls upon changes in the table editor model.
        Specified by:
        tableChanged in interface javax.swing.event.TableModelListener
      • keyTyped

        public void keyTyped​(java.awt.event.KeyEvent e)
        Set the focus directly to the upload button if "Enter" key is pressed in any combobox.
        Specified by:
        keyTyped in interface java.awt.event.KeyListener
      • keyPressed

        public void keyPressed​(java.awt.event.KeyEvent e)
        Specified by:
        keyPressed in interface java.awt.event.KeyListener
      • keyReleased

        public void keyReleased​(java.awt.event.KeyEvent e)
        Specified by:
        keyReleased in interface java.awt.event.KeyListener