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,PropertyChangeListener,Serializable,EventListener,Accessible,DataSelectionListener,DataSetListenerAdapter.Listener,Helpful,MainLayerManager.ActiveLayerChangeListener,PrimitiveHoverListener,ShowHideButtonListener,TaggingPresetListener,PreferenceChangedListener,Destroyable
public class PropertiesDialog
extends ToggleDialog
implements DataSelectionListener, MainLayerManager.ActiveLayerChangeListener, PropertyChangeListener, DataSetListenerAdapter.Listener, TaggingPresetListener, PrimitiveHoverListener
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 is selected, the sum of all tags is 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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) classAction handling add button press in properties dialog.(package private) static final class(package private) classAction handling delete button press in properties dialog.(package private) classAction handling edit button press in properties dialog.private final classprivate final class(package private) static class(package private) static final classclassClass that watches for mouse clicks(package private) class(package private) static final classstatic classClass that allows fast creation of read-only table model with String columnsprivate final classClears the row selection when it is filtered away by the row sorter.(package private) static final class(package private) class(package private) static final classNested classes/interfaces inherited from class org.openstreetmap.josm.gui.dialogs.ToggleDialog
ToggleDialog.ButtonHidingType, ToggleDialog.TitleBar, ToggleDialog.ToggleDialogActionNested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested 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.FlipBufferStrategyNested classes/interfaces inherited from interface org.openstreetmap.josm.data.osm.DataSelectionListener
DataSelectionListener.AbstractSelectionEvent, DataSelectionListener.SelectionAddEvent, DataSelectionListener.SelectionChangeEvent, DataSelectionListener.SelectionRemoveEvent, DataSelectionListener.SelectionReplaceEvent, DataSelectionListener.SelectionToggleEventNested classes/interfaces inherited from interface org.openstreetmap.josm.gui.PrimitiveHoverListener
PrimitiveHoverListener.PrimitiveHoverEvent -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final PropertiesDialog.AddActionprivate final JPopupMenuprivate final PopupMenuHandlerprivate final JPanelJPanel containing both previous tablesprivate final SideButtonThe Add button (needed to be able to disable it)private final SideButtonThe Delete button (needed to be able to disable it)private final SideButtonThe Edit button (needed to be able to disable it)private final PropertiesCellRendererprivate final CopyAllKeyValueActionprivate final CopyKeyValueActionprivate final CopyValueActionprivate final DataSetListenerAdapterprivate final PropertiesDialog.DeleteActionprivate final PropertiesDialog.EditActionprivate final TagEditHelperThis sub-object is responsible for all adding and editing of tagsprivate final HelpActionprivate final HelpActionprivate final HighlightHelperprivate final PropertiesDialog.HoverPreviewPreferSelectionPropListenerprivate final PropertiesDialog.HoverPreviewPropListenerprivate final JosmAction[]private final DefaultTableModelThe membership data of selected objects.private final JPopupMenuprivate final PopupMenuHandlerprivate final JTableThe membership table.private final PropertiesDialog.PasteValueActionstatic final JPanelhook for roadsigns plugin to display a small button in the upper right corner of this dialogprivate PopupMenuLauncherprivate final TaggingPresetHandlerprivate final PresetListPanelMatching preset display classprivate static final BooleanPropertyprivate static final BooleanPropertystatic final BooleanPropertyShow tags and relation memberships of objects in the properties dialog when hovering over them with the mouse pointerstatic final CachingProperty<Boolean>Always show information for selected objects when something is selected instead of the hovered objectprivate final PropertiesDialog.SearchActionprivate final PropertiesDialog.SearchActionprivate final JLabelText to display when nothing selected.private final PropertiesDialog.ReadOnlyTableModelThe tag data of selected objects.private final TaginfoActionprivate final TaginfoActionprivate final Collection<TaginfoAction>private intprivate final JPopupMenuprivate final PopupMenuHandlerprivate final TableRowSorter<PropertiesDialog.ReadOnlyTableModel>private final JTableThe tags table.private final JosmTextFieldFields inherited from class org.openstreetmap.josm.gui.dialogs.ToggleDialog
button, buttonHiding, detachedDialog, dialogsPanel, isCollapsed, isDocked, isShowing, name, preferenceClass, preferencePrefix, PROP_DYNAMIC_BUTTONS, titleBar, toggleAction, windowMenuItemFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled whenever the active or edit layer changed.voidAdds a custom table cell renderer to render cells of the tags table.private voidprivate voidprivate void(package private) static SearchSettingcreateSearchSetting(String key, Collection<? extends IPrimitive> sel, boolean sameType) voiddestroy()Called when the object has been destroyed.private voidprivate voideditMembership(int row) This simply fires up anRelationEditorfor the relation shown; everything else is the editor's business.private static intfindViewRow(JTable table, TableModel model, Object value) Replies the membership popup menu handler.Replies the tag popup menu handler.IRelation<?>Returns the selected relation membership.Collection<IRelation<?>>Returns all selected relation memberships.Returns the selected tags.Returns the selected tag.Returns the help topic on JOSM wiki for this feature.voidCalled when toggle dialog is hidden (collapsed, removed, MapFrame is removed, ...).voidReloads data when thedisplay.discardable-keyspreference changesvoidMethod called when the primitive under the mouse pointer changes.voidCalled when notified about any type of dataset change event.voidvoidRemoves a custom table cell renderer.voidCalled whenever the selection is changed.voidsetFilter(SearchCompiler.Match filter) Sets a filter to restrict the displayed properties.private voidCreates the popup menu @field blankSpaceMenu and its launcher on main panel.private JosmTextFieldprivate voidAssigns all needed keys like Enter and Spacebar to most important actions.private voidCreates the popup menu @field membershipMenu and its launcher on membership table.private voidsetupTaginfoNationalActions(Collection<? extends IPrimitive> newSel) private voidCreates the popup menu @field tagMenu and its launcher on tag table.voidsetVisible(boolean b) voidCalled when toggle dialog is shown (after it was created or expanded).voidUpdates the preset list when Presets preference changes.private voidprivate voidupdateMembershipTableData(Collection<? extends IPrimitive> primitives) private voidprivate voidUpdate selection status, callselectionChanged(org.openstreetmap.josm.data.osm.DataSelectionListener.SelectionChangeEvent)function.private voidupdateTagTableData(Collection<? extends IPrimitive> primitives) private voidupdateTagTableVisibility(Collection<? extends IPrimitive> primitives) private voidupdateTitle(Collection<? extends IPrimitive> primitives) private voidupdateUi(Collection<? extends IPrimitive> primitives) private voidupdateUi(IPrimitive primitive) voidvisitSelectedProperties(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, unfurlDialogMethods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods 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, updateMethods 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, validateTreeMethods 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 Details
-
PROP_DISPLAY_DISCARDABLE_KEYS
-
pluginHook
hook for roadsigns plugin to display a small button in the upper right corner of this dialog -
tagData
The tag data of selected objects. -
cellRenderer
-
tagRowSorter
-
tagTableFilter
-
membershipData
The membership data of selected objects. -
tagTable
The tags table. -
membershipTable
The membership table. -
bothTables
JPanel containing both previous tables -
tagMenu
-
membershipMenu
-
blankSpaceMenu
-
tagMenuHandler
-
membershipMenuHandler
-
blankSpaceMenuHandler
-
tagMenuTagInfoNatItems
-
membershipMenuTagInfoNatItems
-
valueCount
-
editHelper
This sub-object is responsible for all adding and editing of tags -
dataChangedAdapter
-
helpTagAction
-
helpRelAction
-
taginfoAction
-
tagHistoryAction
-
taginfoNationalActions
-
taginfoNationalHash
-
pasteValueAction
-
copyValueAction
-
copyKeyValueAction
-
copyAllKeyValueAction
-
searchActionSame
-
searchActionAny
-
addAction
-
editAction
-
deleteAction
-
josmActions
-
highlightHelper
-
btnAdd
The Add button (needed to be able to disable it) -
btnEdit
The Edit button (needed to be able to disable it) -
btnDel
The Delete button (needed to be able to disable it) -
presets
Matching preset display class -
selectSth
Text to display when nothing selected. -
presetHandler
-
popupMenuLauncher
-
PROP_AUTORESIZE_TAGS_TABLE
-
PROP_PREVIEW_ON_HOVER
Show tags and relation memberships of objects in the properties dialog when hovering over them with the mouse pointer- Since:
- 18574
-
hoverPreviewPropListener
-
PROP_PREVIEW_ON_HOVER_PRIORITIZE_SELECTION
Always show information for selected objects when something is selected instead of the hovered object- Since:
- 18574
-
hoverPreviewPrioritizeSelectionPropListener
-
-
Constructor Details
-
PropertiesDialog
public PropertiesDialog()Create a new PropertiesDialog
-
-
Method Details
-
helpTopic
Description copied from interface:HelpfulReturns the help topic on JOSM wiki for this feature.- Specified by:
helpTopicin interfaceHelpful- Overrides:
helpTopicin classToggleDialog- Returns:
- the help topic on JOSM wiki for this feature
-
buildTagsTable
-
buildMembershipTable
-
setupBlankSpaceMenu
Creates the popup menu @field blankSpaceMenu and its launcher on main panel. -
destroyTaginfoNationalActions
-
setupTaginfoNationalActions
-
setupMembershipMenu
Creates the popup menu @field membershipMenu and its launcher on membership table. -
setupTagsMenu
Creates the popup menu @field tagMenu and its launcher on tag table. -
setFilter
Sets a filter to restrict the displayed properties.- Parameters:
filter- the filter- Since:
- 8980
-
setupKeyboardShortcuts
Assigns all needed keys like Enter and Spacebar to most important actions. -
setupFilter
-
editMembership
This simply fires up anRelationEditorfor the relation shown; everything else is the editor's business.- Parameters:
row- position
-
findViewRow
-
updateSelection
Update selection status, callselectionChanged(org.openstreetmap.josm.data.osm.DataSelectionListener.SelectionChangeEvent)function. -
showNotify
Description copied from class:ToggleDialogCalled 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:
showNotifyin classToggleDialog
-
hideNotify
Description copied from class:ToggleDialogCalled when toggle dialog is hidden (collapsed, removed, MapFrame is removed, ...). Good place to unregister listeners- Overrides:
hideNotifyin classToggleDialog
-
setVisible
- Overrides:
setVisiblein classJComponent
-
destroy
Description copied from interface:DestroyableCalled when the object has been destroyed.- Specified by:
destroyin interfaceDestroyable- Overrides:
destroyin classToggleDialog
-
selectionChanged
Description copied from interface:DataSelectionListenerCalled 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:
selectionChangedin interfaceDataSelectionListener- Parameters:
event- The selection change event.- See Also:
-
primitiveHovered
Description copied from interface:PrimitiveHoverListenerMethod called when the primitive under the mouse pointer changes.- Specified by:
primitiveHoveredin interfacePrimitiveHoverListener- Parameters:
e- Event object describing the hovered primitive and related information
-
autoresizeTagTable
-
updateUi
-
updateUi
-
updateTagTableData
-
updateMembershipTableData
-
updateMembershipTableVisibility
-
updateTagTableVisibility
-
updateActionsEnabledState
-
updateTitle
-
preferenceChanged
Reloads data when thedisplay.discardable-keyspreference changes- Specified by:
preferenceChangedin interfacePreferenceChangedListener- Overrides:
preferenceChangedin classToggleDialog- Parameters:
e- the preference change event
-
taggingPresetsModified
Updates the preset list when Presets preference changes.- Specified by:
taggingPresetsModifiedin interfaceTaggingPresetListener
-
activeOrEditLayerChanged
Description copied from interface:MainLayerManager.ActiveLayerChangeListenerCalled 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:
activeOrEditLayerChangedin interfaceMainLayerManager.ActiveLayerChangeListener- Parameters:
e- The change event.
-
propertyChange
- Specified by:
propertyChangein interfacePropertyChangeListener
-
processDatasetEvent
Description copied from interface:DataSetListenerAdapter.ListenerCalled when notified about any type of dataset change event.- Specified by:
processDatasetEventin interfaceDataSetListenerAdapter.Listener- Parameters:
event- dataset change event
-
getPropertyPopupMenuHandler
Replies the tag popup menu handler.- Returns:
- The tag popup menu handler
-
getSelectedProperty
Returns the selected tag. Value is empty if several tags are selected for a given key.- Returns:
- The current selected tag
-
getSelectedProperties
Returns the selected tags. Contains all values if several are selected for a given key.- Returns:
- The current selected tags
- Since:
- 15376
-
visitSelectedProperties
Visits all combinations of the selected keys/values.- Parameters:
visitor- the visitor- Since:
- 15707
-
getMembershipPopupMenuHandler
Replies the membership popup menu handler.- Returns:
- The membership popup menu handler
-
getSelectedMembershipRelation
Returns the selected relation membership.- Returns:
- The current selected relation membership
-
getSelectedMembershipRelations
Returns all selected relation memberships.- Returns:
- The selected relation memberships
- Since:
- 15707
-
addCustomPropertiesCellRenderer
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 returnnullto fall back to thedefault implementation.- Parameters:
renderer- the renderer to add- Since:
- 9149
-
removeCustomPropertiesCellRenderer
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)
-