public final class AlignInCircleAction extends JosmAction
Modifier and Type | Class and Description |
---|---|
static class |
AlignInCircleAction.PolarCoor |
JosmAction.LayerChangeAdapter, JosmAction.SelectionChangeAdapter
sc
changeSupport, enabled
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
Constructor and Description |
---|
AlignInCircleAction()
Constructs a new
AlignInCircleAction . |
Modifier and Type | Method and Description |
---|---|
private static boolean |
actionAllowed(Collection<Node> nodes)
Check if one or more nodes are outside of download area
|
void |
actionPerformed(ActionEvent e)
Perform AlignInCircle action.
|
protected static boolean |
checkWaysArePolygon(Collection<Way> ways)
Determines if ways can be joined into a polygon.
|
private static List<Node> |
collectNodesAnticlockwise(List<Way> ways)
Assuming all ways can be joined into polygon, create an ordered list of node.
|
private static List<Node> |
collectNodesWithExternReferers(List<Way> ways)
Collect all nodes with more than one referrer.
|
private static double |
distance(EastNorth n,
EastNorth m) |
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(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, getShortcut, initEnabledState, installAdapters, setTooltip
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
public AlignInCircleAction()
AlignInCircleAction
.public void actionPerformed(ActionEvent e)
private static List<Node> collectNodesWithExternReferers(List<Way> ways)
ways
- Ways from witch nodes are selectedprivate static List<Node> collectNodesAnticlockwise(List<Way> ways)
ways
- List of ways to be joinedprivate static boolean actionAllowed(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()
protected void updateEnabledState(Collection<? extends OsmPrimitive> selection)
JosmAction
updateEnabledState
in class JosmAction
selection
- the collection of selected primitives; may be empty, but not nullJosmAction.updateEnabledState()
,
JosmAction.initEnabledState()
protected static boolean checkWaysArePolygon(Collection<Way> ways)
ways
- The ways collection to check