Class ParallelWays
- java.lang.Object
-
- org.openstreetmap.josm.actions.mapmode.ParallelWays
-
public class ParallelWays extends java.lang.Object
Helper forParallelWayAction.
-
-
Constructor Summary
Constructors Constructor Description ParallelWays(java.util.Collection<Way> sourceWays, boolean copyTags, int refWayIndex)Constructs a newParallelWays.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidchangeOffset(double d)Offsets the way(s) d units.voidcommit()Performs the action by adding a new sequence command to the undo/redo queue.private static NodecopyNode(Node source, boolean copyTags)private static voidcopyNodeInMap(java.util.Map<Node,Node> splitNodeMap, Node node, boolean copyTags)java.util.List<Way>getWays()Returns the resulting parallel ways.booleanisClosedPath()Determines if the nodes graph form a closed pathprivate java.util.List<Command>makeAddWayAndNodesCommandList()
-
-
-
Constructor Detail
-
ParallelWays
public ParallelWays(java.util.Collection<Way> sourceWays, boolean copyTags, int refWayIndex)
Constructs a newParallelWays.- Parameters:
sourceWays- source wayscopyTags- whether tags should be copiedrefWayIndex- Need a reference way to determine the direction of the offset when we manage multiple ways
-
-
Method Detail
-
copyNodeInMap
private static void copyNodeInMap(java.util.Map<Node,Node> splitNodeMap, Node node, boolean copyTags)
-
isClosedPath
public boolean isClosedPath()
Determines if the nodes graph form a closed path- Returns:
trueif the nodes graph form a closed path
-
changeOffset
public void changeOffset(double d)
Offsets the way(s) d units. Positive d means to the left (relative to the reference way)- Parameters:
d- offset
-
commit
public void commit()
Performs the action by adding a new sequence command to the undo/redo queue.
-
makeAddWayAndNodesCommandList
private java.util.List<Command> makeAddWayAndNodesCommandList()
-
-