Package org.openstreetmap.josm.actions
Class JoinNodeWayAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- org.openstreetmap.josm.actions.JosmAction
-
- org.openstreetmap.josm.actions.JoinNodeWayAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.io.Serializable
,java.lang.Cloneable
,java.util.EventListener
,javax.swing.Action
,Destroyable
public class JoinNodeWayAction extends JosmAction
Action allowing to join a node to a nearby way, operating on two modes:- Join Node to Way: Include a node into the nearest way segments. The node does not move
- Move Node onto Way: Move the node onto the nearest way segments and include it
- Since:
- 466
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
JoinNodeWayAction.NodeDistanceToRefNodeComparator
Sorts collinear nodes by their distance to a common reference node.-
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 protected boolean
joinWayToNode
-
Fields inherited from class org.openstreetmap.josm.actions.JosmAction
sc
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
JoinNodeWayAction(boolean joinWayToNode, java.lang.String name, java.lang.String iconName, java.lang.String tooltip, Shortcut shortcut, boolean registerInToolbar)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(java.awt.event.ActionEvent e)
static JoinNodeWayAction
createJoinNodeToWayAction()
Constructs a Join Node to Way action.static JoinNodeWayAction
createMoveNodeOntoWayAction()
Constructs a Move Node onto Way action.protected void
updateEnabledState()
Override in subclasses to update the enabled state of the action when something in the JOSM state changes, i.e.protected void
updateEnabledState(java.util.Collection<? extends OsmPrimitive> selection)
Override in subclasses to update the enabled state of the action if the collection of selected primitives changes.-
Methods inherited from class org.openstreetmap.josm.actions.JosmAction
buildActiveLayerChangeAdapter, buildLayerChangeAdapter, checkAndConfirmOutlyingOperation, destroy, getLayerManager, getShortcut, initEnabledState, installAdapters, listenToLayerChange, listenToSelectionChange, setHelpId, setToolbarId, setTooltip, updateEnabledStateOnCurrentSelection, updateEnabledStateOnCurrentSelection, updateEnabledStateOnModifiableSelection, waitFuture
-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Field Detail
-
joinWayToNode
protected final boolean joinWayToNode
-
-
Constructor Detail
-
JoinNodeWayAction
protected JoinNodeWayAction(boolean joinWayToNode, java.lang.String name, java.lang.String iconName, java.lang.String tooltip, Shortcut shortcut, boolean registerInToolbar)
-
-
Method Detail
-
createJoinNodeToWayAction
public static JoinNodeWayAction createJoinNodeToWayAction()
Constructs a Join Node to Way action.- Returns:
- the Join Node to Way action
-
createMoveNodeOntoWayAction
public static JoinNodeWayAction createMoveNodeOntoWayAction()
Constructs a Move Node onto Way action.- Returns:
- the Move Node onto Way action
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
-
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()
-
updateEnabledState
protected void updateEnabledState(java.util.Collection<? extends OsmPrimitive> selection)
Description copied from class:JosmAction
Override in subclasses to update the enabled state of the action if the collection of selected primitives changes. This method is called with the new selection.- Overrides:
updateEnabledState
in classJosmAction
- Parameters:
selection
- the collection of selected primitives; may be empty, but not null- See Also:
JosmAction.updateEnabledState()
,JosmAction.initEnabledState()
,JosmAction.listenToSelectionChange()
-
-