Class RecentRelationsAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- org.openstreetmap.josm.actions.JosmAction
-
- org.openstreetmap.josm.actions.relation.RecentRelationsAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener,java.io.Serializable,java.lang.Cloneable,java.util.EventListener,javax.swing.Action,UndoRedoHandler.CommandQueueListener,Destroyable
public class RecentRelationsAction extends JosmAction implements UndoRedoHandler.CommandQueueListener
Action for accessing recent relations.- Since:
- 9668
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classRecentRelationsAction.LaunchEditorAction(package private) static classRecentRelationsAction.RecentRelationsMenuItemA specializedJMenuItemfor presenting one entry of the relation history(package private) static classRecentRelationsAction.RecentRelationsPopupMenu-
Nested classes/interfaces inherited from class org.openstreetmap.josm.actions.JosmAction
JosmAction.ActiveLayerChangeAdapter, JosmAction.LayerChangeAdapter, JosmAction.SelectionChangeAdapter
-
-
Field Summary
Fields Modifier and Type Field Description private javax.swing.plaf.basic.BasicArrowButtonarrowprivate SideButtoneditButtonprivate RecentRelationsAction.LaunchEditorActionlaunchActionprivate Shortcutshortcut-
Fields inherited from class org.openstreetmap.josm.actions.JosmAction
sc
-
-
Constructor Summary
Constructors Constructor Description RecentRelationsAction(SideButton editButton)Constructs a newRecentRelationsAction.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactionPerformed(java.awt.event.ActionEvent e)voidcommandChanged(int queueSize, int redoSize)Notifies the listener about the new queue sizevoiddestroy()Called when the object has been destroyed.voidenableArrow()Enables arrow button.static RelationgetLastRelation()Returns the last relation.static java.util.List<Relation>getRecentRelationsOnActiveLayer()Returns the list of recent relations on active layer.static booleanisRelationListable(Relation relation)Determines if the given relation is listable in last relations.protected voidupdateEnabledState()Override 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, waitFuture
-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Field Detail
-
editButton
private final SideButton editButton
-
arrow
private final javax.swing.plaf.basic.BasicArrowButton arrow
-
launchAction
private final RecentRelationsAction.LaunchEditorAction launchAction
-
-
Constructor Detail
-
RecentRelationsAction
public RecentRelationsAction(SideButton editButton)
Constructs a newRecentRelationsAction.- Parameters:
editButton- edit button
-
-
Method Detail
-
enableArrow
public void enableArrow()
Enables arrow button.
-
getLastRelation
public static Relation getLastRelation()
Returns the last relation.- Returns:
- the last relation
-
isRelationListable
public static boolean isRelationListable(Relation relation)
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
public void actionPerformed(java.awt.event.ActionEvent e)
- Specified by:
actionPerformedin interfacejava.awt.event.ActionListener
-
commandChanged
public void commandChanged(int queueSize, int redoSize)
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
protected void 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:
JosmAction.updateEnabledState(Collection),JosmAction.initEnabledState(),JosmAction.listenToLayerChange()
-
destroy
public void destroy()
Description copied from interface:DestroyableCalled when the object has been destroyed.- Specified by:
destroyin interfaceDestroyable- Overrides:
destroyin classJosmAction
-
getRecentRelationsOnActiveLayer
public static java.util.List<Relation> getRecentRelationsOnActiveLayer()
Returns the list of recent relations on active layer.- Returns:
- the list of recent relations on active layer
-
-