public final class AlignInCircleAction extends JosmAction
JosmAction.ActiveLayerChangeAdapter, JosmAction.LayerChangeAdapter, JosmAction.SelectionChangeAdapter
sc
Constructor and Description |
---|
AlignInCircleAction()
Constructs a new
AlignInCircleAction . |
Modifier and Type | Method and Description |
---|---|
private static boolean |
actionAllowed(java.util.Collection<Node> nodes)
Check if one or more nodes are outside of download area
|
void |
actionPerformed(java.awt.event.ActionEvent e)
Perform AlignInCircle action.
|
private static boolean |
checkWaysArePolygon(java.util.Collection<Way> ways)
Determines if ways can be joined into a polygon.
|
private static java.util.List<Node> |
collectNodesAnticlockwise(java.util.List<Way> ways)
Assuming all ways can be joined into polygon, create an ordered list of node.
|
private static java.util.List<Node> |
collectNodesWithExternReferers(java.util.List<Way> ways)
Collect all nodes with more than one referrer.
|
static MoveCommand |
createMoveCommand(Node n,
PolarCoor coor)
Create a
MoveCommand to move a node to a PolarCoor. |
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.
|
buildActiveLayerChangeAdapter, buildLayerChangeAdapter, checkAndConfirmOutlyingOperation, destroy, getLayerManager, getShortcut, initEnabledState, installAdapters, listenToLayerChange, listenToSelectionChange, setHelpId, setTooltip, updateEnabledStateOnCurrentSelection, updateEnabledStateOnCurrentSelection, updateEnabledStateOnModifiableSelection, waitFuture
public AlignInCircleAction()
AlignInCircleAction
.public static MoveCommand createMoveCommand(Node n, PolarCoor coor)
MoveCommand
to move a node to a PolarCoor.n
- Node to movecoor
- polar coordinate where to move the nodepublic void actionPerformed(java.awt.event.ActionEvent e)
private static java.util.List<Node> collectNodesWithExternReferers(java.util.List<Way> ways)
ways
- Ways from witch nodes are selectedprivate static java.util.List<Node> collectNodesAnticlockwise(java.util.List<Way> ways)
ways
- List of ways to be joinedprivate static boolean actionAllowed(java.util.Collection<Node> nodes)
nodes
- Nodes to checkprotected void updateEnabledState()
JosmAction
JosmAction.updateEnabledState(Collection)
to respond to changes in the collection
of selected primitives.
Default behavior is empty.updateEnabledState
in class JosmAction
JosmAction.updateEnabledState(Collection)
,
JosmAction.initEnabledState()
,
JosmAction.listenToLayerChange()
protected void updateEnabledState(java.util.Collection<? extends OsmPrimitive> selection)
JosmAction
updateEnabledState
in class JosmAction
selection
- the collection of selected primitives; may be empty, but not nullJosmAction.updateEnabledState()
,
JosmAction.initEnabledState()
,
JosmAction.listenToSelectionChange()
private static boolean checkWaysArePolygon(java.util.Collection<Way> ways)
ways
- The ways collection to check