Class RelationListDialog
- 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.RelationListDialog
-
- All Implemented Interfaces:
java.awt.event.AWTEventListener
,java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.io.Serializable
,java.util.EventListener
,javax.accessibility.Accessible
,DataSetListener
,Helpful
,NavigatableComponent.ZoomChangeListener
,ShowHideButtonListener
,PreferenceChangedListener
,Destroyable
public class RelationListDialog extends ToggleDialog implements DataSetListener, NavigatableComponent.ZoomChangeListener
A dialog showing all known relations, with buttons to add, edit, and delete them. We don't have such dialogs for nodes, segments, and ways, because those objects are visible on the map and can be selected there. Relations are not.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
RelationListDialog.MouseEventHandler
(package private) static class
RelationListDialog.NewAction
The action for creating a new relation.(package private) static class
RelationListDialog.NoTooltipOsmRenderer
private class
RelationListDialog.RelationListModel
The list model for the list of relations displayed in the relation list dialog.-
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
javax.swing.JPanel.AccessibleJPanel
-
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
-
-
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
-
-
Constructor Summary
Constructors Constructor Description RelationListDialog()
ConstructsRelationListDialog
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dataChanged(DataChangedEvent event)
Called after big changes in dataset.void
destroy()
Called when the object has been destroyed.void
enableRecentRelations()
Enable the "recent relations" dropdown menu next to edit button.PopupMenuHandler
getPopupMenuHandler()
Replies the popup menu handler.private IRelation<?>
getSelected()
java.util.Collection<IRelation<?>>
getSelectedRelations()
Replies the list of selected relations.void
hideNotify()
Called when toggle dialog is hidden (collapsed, removed, MapFrame is removed, ...).protected void
initFromData(OsmData<?,?,?,?> data)
Initializes the relation list dialog from a dataset.void
nodeMoved(NodeMovedEvent event)
A node's coordinates were modified.void
otherDatasetChange(AbstractDatasetChangedEvent event)
Minor dataset change, currently only changeset id changed is supported, but can be extended in future.void
primitivesAdded(PrimitivesAddedEvent event)
A bunch of primitives were added into the DataSet, or existing deleted/invisible primitives were resurrected.void
primitivesRemoved(PrimitivesRemovedEvent event)
A bunch of primitives were removed from the DataSet, or preexisting primitives were marked as deleted.void
relationMembersChanged(RelationMembersChangedEvent event)
A relation's members have changed.private void
resetFilter()
void
selectRelation(Relation relation)
Selects the relationrelation
in the list of relations.void
selectRelations(java.util.Collection<? extends IRelation<?>> relations)
Selects the relations in the list of relations.private JosmTextField
setupFilter()
private void
setupPopupMenuHandler()
void
showNotify()
Called when toggle dialog is shown (after it was created or expanded).void
tagsChanged(TagsChangedEvent event)
There was some change in the tag set of a primitive.private void
updateActionsRelationLists()
void
wayNodesChanged(WayNodesChangedEvent event)
A way's node list was changed.void
zoomChanged()
Method called when the zoom area has changed.-
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, helpTopic, hideDialog, isDialogInCollapsedView, isDialogInDefaultView, isDialogShowing, preferenceChanged, 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, 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, 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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.openstreetmap.josm.data.osm.event.DataSetListener
dataChangedIndividualEvents
-
-
-
-
Field Detail
-
displaylist
private final javax.swing.JList<IRelation<?>> displaylist
The display list.
-
model
private final RelationListDialog.RelationListModel model
the list model used
-
newAction
private final RelationListDialog.NewAction newAction
-
popupMenu
private final javax.swing.JPopupMenu popupMenu
the popup menu and its handler
-
popupMenuHandler
private final transient PopupMenuHandler popupMenuHandler
-
filter
private final JosmTextField filter
-
editAction
private final EditRelationAction editAction
the edit action
-
deleteRelationsAction
private final DeleteRelationsAction deleteRelationsAction
the delete action
-
duplicateAction
private final DuplicateRelationAction duplicateAction
the duplicate action
-
selectRelationAction
private final SelectRelationAction selectRelationAction
the select relation action
-
addSelectionToRelations
private final AddSelectionToRelations addSelectionToRelations
add all selected primitives to the given relations
-
exportRelationFromFirstAction
private final ExportRelationToGpxAction exportRelationFromFirstAction
export relation to GPX track action
-
exportRelationFromLastAction
private final ExportRelationToGpxAction exportRelationFromLastAction
-
exportRelationFromFirstToLayerAction
private final ExportRelationToGpxAction exportRelationFromFirstToLayerAction
-
exportRelationFromLastToLayerAction
private final ExportRelationToGpxAction exportRelationFromLastToLayerAction
-
highlightHelper
private final transient HighlightHelper highlightHelper
-
highlightEnabled
private final boolean highlightEnabled
-
recentRelationsAction
private final transient RecentRelationsAction recentRelationsAction
-
-
Constructor Detail
-
RelationListDialog
public RelationListDialog()
ConstructsRelationListDialog
-
-
Method Detail
-
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
-
enableRecentRelations
public void enableRecentRelations()
Enable the "recent relations" dropdown menu next to edit button.
-
updateActionsRelationLists
private void updateActionsRelationLists()
-
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
-
resetFilter
private void resetFilter()
-
initFromData
protected void initFromData(OsmData<?,?,?,?> data)
Initializes the relation list dialog from a dataset. Ifdata
is null the dialog is reset to an empty dialog. Otherwise it is initialized with the list of non-deleted and visible relations in the dataset.- Parameters:
data
- the dataset. May be null.- Since:
- 13957
-
getSelected
private IRelation<?> getSelected()
- Returns:
- The selected relation in the list
-
selectRelation
public void selectRelation(Relation relation)
Selects the relationrelation
in the list of relations.- Parameters:
relation
- the relation
-
selectRelations
public void selectRelations(java.util.Collection<? extends IRelation<?>> relations)
Selects the relations in the list of relations.- Parameters:
relations
- the relations to be selected- Since:
- 13957 (signature)
-
setupFilter
private JosmTextField setupFilter()
-
setupPopupMenuHandler
private void setupPopupMenuHandler()
-
getPopupMenuHandler
public PopupMenuHandler getPopupMenuHandler()
Replies the popup menu handler.- Returns:
- The popup menu handler
-
getSelectedRelations
public java.util.Collection<IRelation<?>> getSelectedRelations()
Replies the list of selected relations. Empty list, if there are no selected relations.- Returns:
- the list of selected, non-new relations.
- Since:
- 13957 (signature)
-
nodeMoved
public void nodeMoved(NodeMovedEvent event)
Description copied from interface:DataSetListener
A node's coordinates were modified.- Specified by:
nodeMoved
in interfaceDataSetListener
- Parameters:
event
- The event for the node that was moved.
-
wayNodesChanged
public void wayNodesChanged(WayNodesChangedEvent event)
Description copied from interface:DataSetListener
A way's node list was changed.- Specified by:
wayNodesChanged
in interfaceDataSetListener
- Parameters:
event
- The event for the way that was modified.
-
primitivesAdded
public void primitivesAdded(PrimitivesAddedEvent event)
Description copied from interface:DataSetListener
A bunch of primitives were added into the DataSet, or existing deleted/invisible primitives were resurrected.- Specified by:
primitivesAdded
in interfaceDataSetListener
- Parameters:
event
- An event for an collection of newly-visible primitives
-
primitivesRemoved
public void primitivesRemoved(PrimitivesRemovedEvent event)
Description copied from interface:DataSetListener
A bunch of primitives were removed from the DataSet, or preexisting primitives were marked as deleted.- Specified by:
primitivesRemoved
in interfaceDataSetListener
- Parameters:
event
- An event for an collection of newly-invisible primitives
-
relationMembersChanged
public void relationMembersChanged(RelationMembersChangedEvent event)
Description copied from interface:DataSetListener
A relation's members have changed.- Specified by:
relationMembersChanged
in interfaceDataSetListener
- Parameters:
event
- The event for the relation that was modified.
-
tagsChanged
public void tagsChanged(TagsChangedEvent event)
Description copied from interface:DataSetListener
There was some change in the tag set of a primitive. It can have been a tag addition, tag removal or change in tag value.- Specified by:
tagsChanged
in interfaceDataSetListener
- Parameters:
event
- the event for the primitive, whose tags were affected.
-
dataChanged
public void dataChanged(DataChangedEvent event)
Description copied from interface:DataSetListener
Called after big changes in dataset. Usually other events are stopped using Dataset.beginUpdate() and after operation is completed (Dataset.endUpdate()),DataSetListener.dataChanged(DataChangedEvent event)
is called.- Specified by:
dataChanged
in interfaceDataSetListener
- Parameters:
event
- data change event
-
otherDatasetChange
public void otherDatasetChange(AbstractDatasetChangedEvent event)
Description copied from interface:DataSetListener
Minor dataset change, currently only changeset id changed is supported, but can be extended in future.- Specified by:
otherDatasetChange
in interfaceDataSetListener
- Parameters:
event
- the event for data modification
-
zoomChanged
public void zoomChanged()
Description copied from interface:NavigatableComponent.ZoomChangeListener
Method called when the zoom area has changed.- Specified by:
zoomChanged
in interfaceNavigatableComponent.ZoomChangeListener
-
-