Class RelationListDialog.NewAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- org.openstreetmap.josm.actions.JosmAction
-
- org.openstreetmap.josm.gui.dialogs.RelationListDialog.NewAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.io.Serializable
,java.lang.Cloneable
,java.util.EventListener
,javax.swing.Action
,LayerManager.LayerChangeListener
,MainLayerManager.ActiveLayerChangeListener
,Destroyable
- Enclosing class:
- RelationListDialog
static class RelationListDialog.NewAction extends JosmAction implements LayerManager.LayerChangeListener, MainLayerManager.ActiveLayerChangeListener
The action for creating a new relation.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openstreetmap.josm.actions.JosmAction
JosmAction.ActiveLayerChangeAdapter, JosmAction.LayerChangeAdapter, JosmAction.SelectionChangeAdapter
-
-
Field Summary
-
Fields inherited from class org.openstreetmap.josm.actions.JosmAction
sc
-
-
Constructor Summary
Constructors Constructor Description NewAction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(java.awt.event.ActionEvent e)
void
activeOrEditLayerChanged(MainLayerManager.ActiveLayerChangeEvent e)
Called whenever the active or edit layer changed.void
layerAdded(LayerManager.LayerAddEvent e)
Notifies this listener that a layer has been added.void
layerOrderChanged(LayerManager.LayerOrderChangeEvent e)
Notifies this listener that the order of layers was changed.void
layerRemoving(LayerManager.LayerRemoveEvent e)
Notifies this listener that a layer was just removed.void
run()
Make a new relationprotected 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, destroy, 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
-
-
-
-
Constructor Detail
-
NewAction
NewAction()
-
-
Method Detail
-
run
public void run()
Make a new relation
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
- Specified by:
actionPerformed
in interfacejava.awt.event.ActionListener
-
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()
-
activeOrEditLayerChanged
public void activeOrEditLayerChanged(MainLayerManager.ActiveLayerChangeEvent e)
Description copied from interface:MainLayerManager.ActiveLayerChangeListener
Called 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:
activeOrEditLayerChanged
in interfaceMainLayerManager.ActiveLayerChangeListener
- Parameters:
e
- The change event.
-
layerAdded
public void layerAdded(LayerManager.LayerAddEvent e)
Description copied from interface:LayerManager.LayerChangeListener
Notifies this listener that a layer has been added.Listeners are called in the EDT thread. You should not do blocking or long-running tasks in this method.
- Specified by:
layerAdded
in interfaceLayerManager.LayerChangeListener
- Parameters:
e
- The new added layer event
-
layerRemoving
public void layerRemoving(LayerManager.LayerRemoveEvent e)
Description copied from interface:LayerManager.LayerChangeListener
Notifies this listener that a layer was just removed.Listeners are called in the EDT thread after the layer was removed. Use
LayerManager.LayerRemoveEvent.scheduleRemoval(Collection)
to remove more layers. You should not do blocking or long-running tasks in this method.- Specified by:
layerRemoving
in interfaceLayerManager.LayerChangeListener
- Parameters:
e
- The layer to be removed (as event)
-
layerOrderChanged
public void layerOrderChanged(LayerManager.LayerOrderChangeEvent e)
Description copied from interface:LayerManager.LayerChangeListener
Notifies this listener that the order of layers was changed.Listeners are called in the EDT thread. You should not do blocking or long-running tasks in this method.
- Specified by:
layerOrderChanged
in interfaceLayerManager.LayerChangeListener
- Parameters:
e
- The order change event.
-
-