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.
|
JosmAction.ActiveLayerChangeAdapter, JosmAction.LayerChangeAdapter, JosmAction.SelectionChangeAdaptersc| 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 void |
notifyNodesOutsideWorld() |
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.
|
static void |
runOn(DataSet ds)
Run the action on the given dataset.
|
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.
|
checkAndConfirmOutlyingOperation, destroy, getLayerManager, getShortcut, initEnabledState, installAdapters, listenToLayerChange, listenToSelectionChange, setHelpId, setTooltip, updateEnabledStateOnCurrentSelection, updateEnabledStateOnCurrentSelection, updateEnabledStateOnModifiableSelection, waitFuturepublic 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)
public static void runOn(DataSet ds)
ds - datasetprivate 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()
private static void notifyNodesOutsideWorld()
protected void updateEnabledState()
JosmActionJosmAction.updateEnabledState(Collection) to respond to changes in the collection
of selected primitives.
Default behavior is empty.updateEnabledState in class JosmActionJosmAction.updateEnabledState(Collection),
JosmAction.initEnabledState(),
JosmAction.listenToLayerChange()protected void updateEnabledState(java.util.Collection<? extends OsmPrimitive> selection)
JosmActionupdateEnabledState in class JosmActionselection - the collection of selected primitives; may be empty, but not nullJosmAction.updateEnabledState(),
JosmAction.initEnabledState(),
JosmAction.listenToSelectionChange()