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 class
RecentRelationsAction.LaunchEditorAction
(package private) static class
RecentRelationsAction.RecentRelationsMenuItem
A specializedJMenuItem
for presenting one entry of the relation history(package private) static class
RecentRelationsAction.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.BasicArrowButton
arrow
private SideButton
editButton
private RecentRelationsAction.LaunchEditorAction
launchAction
private Shortcut
shortcut
-
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 void
actionPerformed(java.awt.event.ActionEvent e)
void
commandChanged(int queueSize, int redoSize)
Notifies the listener about the new queue sizevoid
destroy()
Called when the object has been destroyed.void
enableArrow()
Enables arrow button.static Relation
getLastRelation()
Returns the last relation.static java.util.List<Relation>
getRecentRelationsOnActiveLayer()
Returns the list of recent relations on active layer.static boolean
isRelationListable(Relation relation)
Determines if the given relation is listable in last relations.protected void
updateEnabledState()
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:
true
if relation is non null, not deleted, and in current dataset
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
- Specified by:
actionPerformed
in interfacejava.awt.event.ActionListener
-
commandChanged
public void commandChanged(int queueSize, int redoSize)
Description copied from interface:UndoRedoHandler.CommandQueueListener
Notifies the listener about the new queue size- Specified by:
commandChanged
in interfaceUndoRedoHandler.CommandQueueListener
- Parameters:
queueSize
- Undo stack sizeredoSize
- Redo stack size
-
updateEnabledState
protected void updateEnabledState()
Description copied from class:JosmAction
Override 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:
updateEnabledState
in classJosmAction
- See Also:
JosmAction.updateEnabledState(Collection)
,JosmAction.initEnabledState()
,JosmAction.listenToLayerChange()
-
destroy
public void destroy()
Description copied from interface:Destroyable
Called when the object has been destroyed.- Specified by:
destroy
in interfaceDestroyable
- Overrides:
destroy
in 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
-
-