Class PropertiesDialog
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- org.openstreetmap.josm.gui.dialogs.ToggleDialog
-
- org.openstreetmap.josm.gui.dialogs.properties.PropertiesDialog
-
- All Implemented Interfaces:
AWTEventListener
,ImageObserver
,MenuContainer
,Serializable
,EventListener
,Accessible
,DataSelectionListener
,DataSetListenerAdapter.Listener
,Helpful
,MainLayerManager.ActiveLayerChangeListener
,ShowHideButtonListener
,TaggingPresetListener
,PreferenceChangedListener
,Destroyable
public class PropertiesDialog extends ToggleDialog implements DataSelectionListener, MainLayerManager.ActiveLayerChangeListener, DataSetListenerAdapter.Listener, TaggingPresetListener
This dialog displays the tags of the current selected primitives. If no object is selected, the dialog list is empty. If only one is selected, all tags of this object are selected. If more than one object are selected, the sum of all tags are displayed. If the different objects share the same tag, the shared value is displayed. If they have different values, all of them are put in a combo box and the string "<different>" is displayed in italic. Below the list, the user can click on an add, modify and delete tag button to edit the table selection value. The command is applied to all selected entries.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
PropertiesDialog.AddAction
Action handling add button press in properties dialog.(package private) static class
PropertiesDialog.BlankSpaceMenuLauncher
(package private) class
PropertiesDialog.DeleteAction
Action handling delete button press in properties dialog.(package private) class
PropertiesDialog.EditAction
Action handling edit button press in properties dialog.(package private) static class
PropertiesDialog.MemberInfo
(package private) static class
PropertiesDialog.MemberOfCellRenderer
class
PropertiesDialog.MouseClickWatch
Class that watches for mouse clicks(package private) class
PropertiesDialog.PasteValueAction
(package private) static class
PropertiesDialog.PositionCellRenderer
static class
PropertiesDialog.ReadOnlyTableModel
Class that allows fast creation of read-only table model with String columnsprivate class
PropertiesDialog.RemoveHiddenSelection
Clears the row selection when it is filtered away by the row sorter.(package private) static class
PropertiesDialog.RoleCellRenderer
(package private) class
PropertiesDialog.SearchAction
(package private) static class
PropertiesDialog.TaggingPresetCommandHandler
-
Nested classes/interfaces inherited from class org.openstreetmap.josm.gui.dialogs.ToggleDialog
ToggleDialog.ButtonHidingType, ToggleDialog.TitleBar, ToggleDialog.ToggleDialogAction
-
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
-
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
-
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
-
Nested classes/interfaces inherited from interface org.openstreetmap.josm.data.osm.DataSelectionListener
DataSelectionListener.AbstractSelectionEvent, DataSelectionListener.SelectionAddEvent, DataSelectionListener.SelectionChangeEvent, DataSelectionListener.SelectionRemoveEvent, DataSelectionListener.SelectionReplaceEvent, DataSelectionListener.SelectionToggleEvent
-
-
Field Summary
-
Fields inherited from class org.openstreetmap.josm.gui.dialogs.ToggleDialog
button, buttonHiding, detachedDialog, dialogsPanel, isCollapsed, isDocked, isShowing, name, preferenceClass, preferencePrefix, PROP_DYNAMIC_BUTTONS, titleBar, toggleAction, windowMenuItem
-
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
-
Fields inherited from class java.awt.Component
accessibleContext, 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
-
-
Constructor Summary
Constructors Constructor Description PropertiesDialog()
Create a new PropertiesDialog
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
activeOrEditLayerChanged(MainLayerManager.ActiveLayerChangeEvent e)
Called whenever the active or edit layer changed.void
addCustomPropertiesCellRenderer(TableCellRenderer renderer)
Adds a custom table cell renderer to render cells of the tags table.private void
autoresizeTagTable()
private void
buildMembershipTable()
private void
buildTagsTable()
(package private) static SearchSetting
createSearchSetting(String key, Collection<? extends IPrimitive> sel, boolean sameType)
void
destroy()
Called when the object has been destroyed.private void
destroyTaginfoNationalActions()
private void
editMembership(int row)
This simply fires up anRelationEditor
for the relation shown; everything else is the editor's business.private static int
findViewRow(JTable table, TableModel model, Object value)
PopupMenuHandler
getMembershipPopupMenuHandler()
Replies the membership popup menu handler.PopupMenuHandler
getPropertyPopupMenuHandler()
Replies the tag popup menu handler.IRelation<?>
getSelectedMembershipRelation()
Returns the selected relation membership.Collection<IRelation<?>>
getSelectedMembershipRelations()
Returns all selected relation memberships.Tags
getSelectedProperties()
Returns the selected tags.Tag
getSelectedProperty()
Returns the selected tag.String
helpTopic()
Returns the help topic on JOSM wiki for this feature.void
hideNotify()
Called when toggle dialog is hidden (collapsed, removed, MapFrame is removed, ...).void
preferenceChanged(PreferenceChangeEvent e)
Reloads data when thedisplay.discardable-keys
preference changesvoid
processDatasetEvent(AbstractDatasetChangedEvent event)
Called when notified about any type of dataset change event.void
removeCustomPropertiesCellRenderer(TableCellRenderer renderer)
Removes a custom table cell renderer.void
selectionChanged(DataSelectionListener.SelectionChangeEvent event)
Called whenever the selection is changed.void
setFilter(SearchCompiler.Match filter)
Sets a filter to restrict the displayed properties.private void
setupBlankSpaceMenu()
Creates the popup menu @field blankSpaceMenu and its launcher on main panel.private JosmTextField
setupFilter()
private void
setupKeyboardShortcuts()
Assigns all needed keys like Enter and Spacebar to most important actions.private void
setupMembershipMenu()
Creates the popup menu @field membershipMenu and its launcher on membership table.private void
setupTaginfoNationalActions(Collection<? extends IPrimitive> newSel)
private void
setupTagsMenu()
Creates the popup menu @field tagMenu and its launcher on tag table.void
setVisible(boolean b)
void
showNotify()
Called when toggle dialog is shown (after it was created or expanded).void
taggingPresetsModified()
Updates the preset list when Presets preference changes.private void
updateSelection()
Update selection status, call @{link #selectionChanged} function.void
visitSelectedProperties(KeyValueVisitor visitor)
Visits all combinations of the selected keys/values.-
Methods inherited from class org.openstreetmap.josm.gui.dialogs.ToggleDialog
buttonHidden, buttonShown, clearButtonActions, closeDetachedDialog, collapse, createLayout, createLayout, detach, dock, dockWhenClosingDetachedDlg, eventDispatched, expand, getButton, getDefaultDetachedSize, getLastHeight, getName, getPreferencePrefix, getPreferredHeight, getToggleAction, hideDialog, isDialogInCollapsedView, isDialogInDefaultView, isDialogShowing, registerInWindowMenu, rememberHeight, setButton, setContentVisible, setDialogsPanel, setIsButtonHiding, setIsCollapsed, setIsDocked, setIsShowing, setTitle, showDialog, stateChanged, toggleButtonHook, toString, unfurlDialog
-
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, 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, 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, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
PROP_DISPLAY_DISCARDABLE_KEYS
private final BooleanProperty PROP_DISPLAY_DISCARDABLE_KEYS
-
pluginHook
public static final JPanel pluginHook
hook for roadsigns plugin to display a small button in the upper right corner of this dialog
-
tagData
private final PropertiesDialog.ReadOnlyTableModel tagData
The tag data of selected objects.
-
cellRenderer
private final PropertiesCellRenderer cellRenderer
-
tagRowSorter
private final transient TableRowSorter<PropertiesDialog.ReadOnlyTableModel> tagRowSorter
-
tagTableFilter
private final JosmTextField tagTableFilter
-
membershipData
private final DefaultTableModel membershipData
The membership data of selected objects.
-
membershipTable
private final JTable membershipTable
The membership table.
-
bothTables
private final JPanel bothTables
JPanel containing both previous tables
-
tagMenu
private final JPopupMenu tagMenu
-
membershipMenu
private final JPopupMenu membershipMenu
-
blankSpaceMenu
private final JPopupMenu blankSpaceMenu
-
tagMenuHandler
private final transient PopupMenuHandler tagMenuHandler
-
membershipMenuHandler
private final transient PopupMenuHandler membershipMenuHandler
-
blankSpaceMenuHandler
private final transient PopupMenuHandler blankSpaceMenuHandler
-
tagMenuTagInfoNatItems
private final List<JMenuItem> tagMenuTagInfoNatItems
-
membershipMenuTagInfoNatItems
private final List<JMenuItem> membershipMenuTagInfoNatItems
-
editHelper
private final transient TagEditHelper editHelper
This sub-object is responsible for all adding and editing of tags
-
dataChangedAdapter
private final transient DataSetListenerAdapter dataChangedAdapter
-
helpTagAction
private final HelpAction helpTagAction
-
helpRelAction
private final HelpAction helpRelAction
-
taginfoAction
private final TaginfoAction taginfoAction
-
tagHistoryAction
private final TaginfoAction tagHistoryAction
-
taginfoNationalActions
private final Collection<TaginfoAction> taginfoNationalActions
-
taginfoNationalHash
private transient int taginfoNationalHash
-
pasteValueAction
private final PropertiesDialog.PasteValueAction pasteValueAction
-
copyValueAction
private final CopyValueAction copyValueAction
-
copyKeyValueAction
private final CopyKeyValueAction copyKeyValueAction
-
copyAllKeyValueAction
private final CopyAllKeyValueAction copyAllKeyValueAction
-
searchActionSame
private final PropertiesDialog.SearchAction searchActionSame
-
searchActionAny
private final PropertiesDialog.SearchAction searchActionAny
-
addAction
private final PropertiesDialog.AddAction addAction
-
editAction
private final PropertiesDialog.EditAction editAction
-
deleteAction
private final PropertiesDialog.DeleteAction deleteAction
-
josmActions
private final JosmAction[] josmActions
-
highlightHelper
private final transient HighlightHelper highlightHelper
-
btnAdd
private final SideButton btnAdd
The Add button (needed to be able to disable it)
-
btnEdit
private final SideButton btnEdit
The Edit button (needed to be able to disable it)
-
btnDel
private final SideButton btnDel
The Delete button (needed to be able to disable it)
-
presets
private final PresetListPanel presets
Matching preset display class
-
presetHandler
private final transient TaggingPresetHandler presetHandler
-
popupMenuLauncher
private PopupMenuLauncher popupMenuLauncher
-
PROP_AUTORESIZE_TAGS_TABLE
private static final BooleanProperty PROP_AUTORESIZE_TAGS_TABLE
-
-
Constructor Detail
-
PropertiesDialog
public PropertiesDialog()
Create a new PropertiesDialog
-
-
Method Detail
-
helpTopic
public String helpTopic()
Description copied from interface:Helpful
Returns the help topic on JOSM wiki for this feature.- Specified by:
helpTopic
in interfaceHelpful
- Overrides:
helpTopic
in classToggleDialog
- Returns:
- the help topic on JOSM wiki for this feature
-
buildTagsTable
private void buildTagsTable()
-
buildMembershipTable
private void buildMembershipTable()
-
setupBlankSpaceMenu
private void setupBlankSpaceMenu()
Creates the popup menu @field blankSpaceMenu and its launcher on main panel.
-
destroyTaginfoNationalActions
private void destroyTaginfoNationalActions()
-
setupTaginfoNationalActions
private void setupTaginfoNationalActions(Collection<? extends IPrimitive> newSel)
-
setupMembershipMenu
private void setupMembershipMenu()
Creates the popup menu @field membershipMenu and its launcher on membership table.
-
setupTagsMenu
private void setupTagsMenu()
Creates the popup menu @field tagMenu and its launcher on tag table.
-
setFilter
public void setFilter(SearchCompiler.Match filter)
Sets a filter to restrict the displayed properties.- Parameters:
filter
- the filter- Since:
- 8980
-
setupKeyboardShortcuts
private void setupKeyboardShortcuts()
Assigns all needed keys like Enter and Spacebar to most important actions.
-
setupFilter
private JosmTextField setupFilter()
-
editMembership
private void editMembership(int row)
This simply fires up anRelationEditor
for the relation shown; everything else is the editor's business.- Parameters:
row
- position
-
findViewRow
private static int findViewRow(JTable table, TableModel model, Object value)
-
updateSelection
private void updateSelection()
Update selection status, call @{link #selectionChanged} function.
-
showNotify
public void showNotify()
Description copied from class:ToggleDialog
Called when toggle dialog is shown (after it was created or expanded). Descendants may overwrite this method, it's a good place to register listeners needed to keep dialog updated- Overrides:
showNotify
in classToggleDialog
-
hideNotify
public void hideNotify()
Description copied from class:ToggleDialog
Called when toggle dialog is hidden (collapsed, removed, MapFrame is removed, ...). Good place to unregister listeners- Overrides:
hideNotify
in classToggleDialog
-
setVisible
public void setVisible(boolean b)
- Overrides:
setVisible
in classJComponent
-
destroy
public void destroy()
Description copied from interface:Destroyable
Called when the object has been destroyed.- Specified by:
destroy
in interfaceDestroyable
- Overrides:
destroy
in classToggleDialog
-
selectionChanged
public void selectionChanged(DataSelectionListener.SelectionChangeEvent event)
Description copied from interface:DataSelectionListener
Called whenever the selection is changed. You get notified about the new selection, the elements that were added and removed and the layer that triggered the event.- Specified by:
selectionChanged
in interfaceDataSelectionListener
- Parameters:
event
- The selection change event.- See Also:
DataSelectionListener.SelectionChangeEvent
-
autoresizeTagTable
private void autoresizeTagTable()
-
preferenceChanged
public void preferenceChanged(PreferenceChangeEvent e)
Reloads data when thedisplay.discardable-keys
preference changes- Specified by:
preferenceChanged
in interfacePreferenceChangedListener
- Overrides:
preferenceChanged
in classToggleDialog
- Parameters:
e
- the preference change event
-
taggingPresetsModified
public void taggingPresetsModified()
Updates the preset list when Presets preference changes.- Specified by:
taggingPresetsModified
in interfaceTaggingPresetListener
-
activeOrEditLayerChanged
public void activeOrEditLayerChanged(MainLayerManager.ActiveLayerChangeEvent e)
Description copied from interface:MainLayerManager.ActiveLayerChangeListener
Called whenever the active or edit layer changed.You can be sure that this layer is still contained in this set.
Listeners are called in the EDT thread and you can manipulate the layer manager in the current thread.
- Specified by:
activeOrEditLayerChanged
in interfaceMainLayerManager.ActiveLayerChangeListener
- Parameters:
e
- The change event.
-
processDatasetEvent
public void processDatasetEvent(AbstractDatasetChangedEvent event)
Description copied from interface:DataSetListenerAdapter.Listener
Called when notified about any type of dataset change event.- Specified by:
processDatasetEvent
in interfaceDataSetListenerAdapter.Listener
- Parameters:
event
- dataset change event
-
getPropertyPopupMenuHandler
public PopupMenuHandler getPropertyPopupMenuHandler()
Replies the tag popup menu handler.- Returns:
- The tag popup menu handler
-
getSelectedProperty
public Tag getSelectedProperty()
Returns the selected tag. Value is empty if several tags are selected for a given key.- Returns:
- The current selected tag
-
getSelectedProperties
public Tags getSelectedProperties()
Returns the selected tags. Contains all values if several are selected for a given key.- Returns:
- The current selected tags
- Since:
- 15376
-
visitSelectedProperties
public void visitSelectedProperties(KeyValueVisitor visitor)
Visits all combinations of the selected keys/values.- Parameters:
visitor
- the visitor- Since:
- 15707
-
getMembershipPopupMenuHandler
public PopupMenuHandler getMembershipPopupMenuHandler()
Replies the membership popup menu handler.- Returns:
- The membership popup menu handler
-
getSelectedMembershipRelation
public IRelation<?> getSelectedMembershipRelation()
Returns the selected relation membership.- Returns:
- The current selected relation membership
-
getSelectedMembershipRelations
public Collection<IRelation<?>> getSelectedMembershipRelations()
Returns all selected relation memberships.- Returns:
- The selected relation memberships
- Since:
- 15707
-
addCustomPropertiesCellRenderer
public void addCustomPropertiesCellRenderer(TableCellRenderer renderer)
Adds a custom table cell renderer to render cells of the tags table. If the renderer is not capable performing aTableCellRenderer.getTableCellRendererComponent(javax.swing.JTable, java.lang.Object, boolean, boolean, int, int)
, it should returnnull
to fall back to thedefault implementation
.- Parameters:
renderer
- the renderer to add- Since:
- 9149
-
removeCustomPropertiesCellRenderer
public void removeCustomPropertiesCellRenderer(TableCellRenderer renderer)
Removes a custom table cell renderer.- Parameters:
renderer
- the renderer to remove- Since:
- 9149
-
createSearchSetting
static SearchSetting createSearchSetting(String key, Collection<? extends IPrimitive> sel, boolean sameType)
-
-