public class SimplifyWayAction extends JosmAction
Modifier and Type | Field and Description |
---|---|
static double |
EARTH_RAD |
sc
Constructor and Description |
---|
SimplifyWayAction()
Constructs a new
SimplifyWayAction . |
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e) |
protected void |
alertSelectAtLeastOneWay() |
protected void |
buildSimplifiedNodeList(java.util.List<Node> wnew,
int from,
int to,
double threshold,
java.util.List<Node> simplifiedNodes)
Builds the simplified list of nodes for a way segment given by a lower index
from
and an upper index to |
protected boolean |
confirmSimplifyManyWays(int numWays) |
protected boolean |
confirmWayWithNodesOutsideBoundingBox(java.util.List<? extends OsmPrimitive> primitives) |
static double |
course(double lat1,
double lon1,
double lat2,
double lon2) |
static double |
dist(double lat1,
double lon1,
double lat2,
double lon2) |
protected boolean |
isRequiredNode(Way way,
Node node)
Replies true if
node is a required node which can't be removed
in order to simplify the way. |
SequenceCommand |
simplifyWay(Way w)
Simplifies a way with default threshold (read from preferences).
|
SequenceCommand |
simplifyWay(Way w,
double threshold)
Simplifies a way with a given threshold.
|
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.
|
static double |
xtd(double lat1,
double lon1,
double lat2,
double lon2,
double lat3,
double lon3) |
destroy, getCurrentDataSet, getEditLayer, getShortcut, initEnabledState, installAdapters, setTooltip
public static final double EARTH_RAD
public SimplifyWayAction()
SimplifyWayAction
.protected boolean confirmWayWithNodesOutsideBoundingBox(java.util.List<? extends OsmPrimitive> primitives)
protected void alertSelectAtLeastOneWay()
protected boolean confirmSimplifyManyWays(int numWays)
public void actionPerformed(java.awt.event.ActionEvent e)
protected boolean isRequiredNode(Way way, Node node)
node
is a required node which can't be removed
in order to simplify the way.way
- the way to be simplifiednode
- the node to checknode
is a required node which can't be removed
in order to simplify the way.public final SequenceCommand simplifyWay(Way w)
w
- the way to simplifypublic SequenceCommand simplifyWay(Way w, double threshold)
w
- the way to simplifyprotected void buildSimplifiedNodeList(java.util.List<Node> wnew, int from, int to, double threshold, java.util.List<Node> simplifiedNodes)
from
and an upper index to
wnew
- the way to simplifyfrom
- the lower indexto
- the upper indexthreshold
- public static double dist(double lat1, double lon1, double lat2, double lon2)
public static double course(double lat1, double lon1, double lat2, double lon2)
public static double xtd(double lat1, double lon1, double lat2, double lon2, double lat3, double lon3)
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()
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()