Class AddTagsDialog
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- java.awt.Window
-
- java.awt.Dialog
-
- javax.swing.JDialog
-
- org.openstreetmap.josm.gui.ExtendedDialog
-
- org.openstreetmap.josm.io.remotecontrol.AddTagsDialog
-
- All Implemented Interfaces:
ImageObserver
,MenuContainer
,Serializable
,Accessible
,RootPaneContainer
,WindowConstants
,IExtendedDialog
public class AddTagsDialog extends ExtendedDialog
Dialog to add tags as part of the remotecontrol. Existing Keys get grey color and unchecked selectboxes so they will not overwrite the old Key-Value-Pairs by default. You can choose the tags you want to add by selectboxes. You can edit the tags before you apply them.- Since:
- 3850
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
AddTagsDialog.DeleteTagMarker
Class for displaying "delete from ...(package private) static class
AddTagsDialog.ExistingValues
Class for displaying list of existing tag values in the table(package private) static class
AddTagsDialog.PropertyTableModel
-
Nested classes/interfaces inherited from class javax.swing.JDialog
JDialog.AccessibleJDialog
-
Nested classes/interfaces inherited from class java.awt.Dialog
Dialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityType
-
Nested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow, Window.Type
-
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
-
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
-
Field Summary
Fields Modifier and Type Field Description private int[]
count
private JTable
propertyTable
private Collection<? extends OsmPrimitive>
sel
private String
sender
private static Set<String>
trustedSenders
-
Fields inherited from class org.openstreetmap.josm.gui.ExtendedDialog
buttons, contentInsets, defaultButton, DialogClosedOtherwise
-
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
-
Fields inherited from class java.awt.Dialog
DEFAULT_MODALITY_TYPE
-
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
-
-
Constructor Summary
Constructors Constructor Description AddTagsDialog(String[][] tags, String senderName, Collection<? extends OsmPrimitive> primitives)
Constructs a newAddTagsDialog
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
addTags(String[][] keyValue, String sender, Collection<? extends OsmPrimitive> primitives)
Ask user and add the tags he confirm.static void
addTags(Map<String,String> args, String sender, Collection<? extends OsmPrimitive> primitives)
parse addtags parameters Example URL (part): addtags=wikipedia:de%3DResidenzschloss Dresden|name:en%3DDresden Castleprotected void
buttonAction(int buttonIndex, ActionEvent evt)
If you click the "Add tags" button build a ChangePropertyCommand for every key that has a checked checkbox to apply the key value pair to all selected osm objects.static Map<String,String>
parseUrlTagsToKeyValues(String urlSection)
Convert a argument from a url to a series of tags-
Methods inherited from class org.openstreetmap.josm.gui.ExtendedDialog
configureContextsensitiveHelp, createButtonAction, findMaxDialogSize, getValue, initWindowGeometry, rememberWindowGeometry, setButtonIcons, setButtonIcons, setCancelButton, setContent, setContent, setContent, setDefaultButton, setFocusOnDefaultButton, setIcon, setIcon, setRememberWindowGeometry, setToolTipTexts, setupDialog, setVisible, showDialog, toggleCheckState, toggleEnable, toggleSaveState
-
Methods 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, update
-
Methods inherited from class java.awt.Dialog
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, show, toBack
-
Methods 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, toFront
-
Methods 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, validateTree
-
Methods 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 Detail
-
propertyTable
private final JTable propertyTable
-
sel
private final transient Collection<? extends OsmPrimitive> sel
-
count
private final int[] count
-
trustedSenders
private static final Set<String> trustedSenders
-
-
Constructor Detail
-
AddTagsDialog
public AddTagsDialog(String[][] tags, String senderName, Collection<? extends OsmPrimitive> primitives)
Constructs a newAddTagsDialog
.- Parameters:
tags
- tags to addsenderName
- String for skipping confirmations. Use empty string for always confirmed adding.primitives
- OSM objects that will be modified
-
-
Method Detail
-
buttonAction
protected void buttonAction(int buttonIndex, ActionEvent evt)
If you click the "Add tags" button build a ChangePropertyCommand for every key that has a checked checkbox to apply the key value pair to all selected osm objects. You get a entry for every key in the command queue.- Overrides:
buttonAction
in classExtendedDialog
- Parameters:
buttonIndex
- the button index (first index is 0)evt
- the button event
-
addTags
public static void addTags(Map<String,String> args, String sender, Collection<? extends OsmPrimitive> primitives)
parse addtags parameters Example URL (part): addtags=wikipedia:de%3DResidenzschloss Dresden|name:en%3DDresden Castle- Parameters:
args
- request arguments (URL encoding already removed)sender
- is a string for skipping confirmations. Use empty string for always confirmed adding.primitives
- OSM objects that will be modified
-
parseUrlTagsToKeyValues
public static Map<String,String> parseUrlTagsToKeyValues(String urlSection)
Convert a argument from a url to a series of tags- Parameters:
urlSection
- A url section that looks liketag1=value1|tag2=value2
- Returns:
- An 2d array in the format of
[key][value]
- Since:
- 15316
-
addTags
public static void addTags(String[][] keyValue, String sender, Collection<? extends OsmPrimitive> primitives)
Ask user and add the tags he confirm.- Parameters:
keyValue
- is a table or {{tag1,val1},{tag2,val2},...}sender
- is a string for skipping confirmations. Use empty string for always confirmed adding.primitives
- OSM objects that will be modified- Since:
- 7521
-
-