Class RecentRelationsAction
java.lang.Object
javax.swing.AbstractAction
org.openstreetmap.josm.actions.JosmAction
org.openstreetmap.josm.actions.relation.RecentRelationsAction
- All Implemented Interfaces:
ActionListener,Serializable,Cloneable,EventListener,Action,UndoRedoHandler.CommandQueueListener,Destroyable
public class RecentRelationsAction
extends JosmAction
implements UndoRedoHandler.CommandQueueListener
Action for accessing recent relations.
- Since:
- 9668
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class(package private) static classA specializedJMenuItemfor presenting one entry of the relation history(package private) static classNested classes/interfaces inherited from class org.openstreetmap.josm.actions.JosmAction
JosmAction.ActiveLayerChangeAdapter, JosmAction.LayerChangeAdapter, JosmAction.SelectionChangeAdapter -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BasicArrowButtonprivate final SideButtonprivate final RecentRelationsAction.LaunchEditorActionprivate final ShortcutFields inherited from class org.openstreetmap.josm.actions.JosmAction
scFields inherited from class javax.swing.AbstractAction
changeSupport, enabledFields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON -
Constructor Summary
ConstructorsConstructorDescriptionRecentRelationsAction(SideButton editButton) Constructs a newRecentRelationsAction. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidcommandChanged(int queueSize, int redoSize) Notifies the listener about the new queue sizevoiddestroy()Called when the object has been destroyed.voidEnables arrow button.static RelationReturns the last relation.Returns the list of recent relations on active layer.static booleanisRelationListable(Relation relation) Determines if the given relation is listable in last relations.protected voidOverride in subclasses to update the enabled state of the action when something in the JOSM state changes, i.e.Methods inherited from class org.openstreetmap.josm.actions.JosmAction
buildActiveLayerChangeAdapter, buildLayerChangeAdapter, checkAndConfirmOutlyingOperation, getLayerManager, getShortcut, initEnabledState, installAdapters, listenToLayerChange, listenToSelectionChange, setHelpId, setToolbarId, setTooltip, updateEnabledState, updateEnabledStateOnCurrentSelection, updateEnabledStateOnCurrentSelection, updateEnabledStateOnModifiableSelection, waitFutureMethods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
Field Details
-
editButton
-
arrow
-
shortcut
-
launchAction
-
-
Constructor Details
-
RecentRelationsAction
Constructs a newRecentRelationsAction.- Parameters:
editButton- edit button
-
-
Method Details
-
enableArrow
Enables arrow button. -
getLastRelation
Returns the last relation.- Returns:
- the last relation
-
isRelationListable
Determines if the given relation is listable in last relations.- Parameters:
relation- relation- Returns:
trueif relation is non null, not deleted, and in current dataset
-
actionPerformed
- Specified by:
actionPerformedin interfaceActionListener
-
commandChanged
Description copied from interface:UndoRedoHandler.CommandQueueListenerNotifies the listener about the new queue size- Specified by:
commandChangedin interfaceUndoRedoHandler.CommandQueueListener- Parameters:
queueSize- Undo stack sizeredoSize- Redo stack size
-
updateEnabledState
Description copied from class:JosmActionOverride in subclasses to update the enabled state of the action when something in the JOSM state changes, i.e. when a layer is removed or added. SeeJosmAction.updateEnabledState(Collection)to respond to changes in the collection of selected primitives. Default behavior is empty.- Overrides:
updateEnabledStatein classJosmAction- See Also:
-
destroy
Description copied from interface:DestroyableCalled when the object has been destroyed.- Specified by:
destroyin interfaceDestroyable- Overrides:
destroyin classJosmAction
-
getRecentRelationsOnActiveLayer
Returns the list of recent relations on active layer.- Returns:
- the list of recent relations on active layer
-