public final class CreateCircleAction extends JosmAction
Modifier and Type | Class and Description |
---|---|
private static class |
CreateCircleAction.PolarNode
Class designed to create a couple between a node and its angle relative to the center of the circle.
|
private static class |
CreateCircleAction.PolarNodeComparator
Comparator used to order PolarNode relative to their angle.
|
JosmAction.ActiveLayerChangeAdapter, JosmAction.LayerChangeAdapter, JosmAction.SelectionChangeAdapter
sc
Constructor and Description |
---|
CreateCircleAction()
Constructs a new
CreateCircleAction . |
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e) |
private static int[] |
distributeNodes(CreateCircleAction.PolarNode[] angles,
int nodesCount)
Distributes nodes according to the algorithm of election with largest remainder.
|
private static void |
notifyNodesNotOnCircle() |
private static java.util.List<Node> |
orderNodesByTrafficHand(java.util.List<Node> nodes)
Order nodes according to left/right hand traffic.
|
private static java.util.List<Node> |
orderNodesByWay(java.util.List<Node> nodes,
Way way)
Order nodes according to way direction.
|
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.
|
destroy, getCurrentDataSet, getEditLayer, getLayerManager, getShortcut, initEnabledState, installAdapters, listenToLayerChange, listenToSelectionChange, setTooltip, updateEnabledStateOnCurrentSelection, waitFuture
public CreateCircleAction()
CreateCircleAction
.private static int[] distributeNodes(CreateCircleAction.PolarNode[] angles, int nodesCount)
angles
- Array of PolarNode ordered by increasing anglesnodesCount
- Number of nodes to be distributedpublic void actionPerformed(java.awt.event.ActionEvent e)
private static java.util.List<Node> orderNodesByTrafficHand(java.util.List<Node> nodes)
nodes
- Nodes list to be ordered.private static java.util.List<Node> orderNodesByWay(java.util.List<Node> nodes, Way way)
nodes
- Nodes list to be ordered.way
- Way used to determine direction.private static void notifyNodesNotOnCircle()
protected 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()