public class RotateCommand extends TransformNodesCommand
Command.OldNodeState
Modifier and Type | Field and Description |
---|---|
private EastNorth |
pivot
Pivot point
|
private double |
rotationAngle
computed rotation angle between starting click and current mouse pos
|
private double |
startAngle
angle of rotation starting click to pivot
|
nodes, oldStates
IS_INCOMPLETE, IS_OK, IS_OUTSIDE
Constructor and Description |
---|
RotateCommand(java.util.Collection<? extends OsmPrimitive> objects,
EastNorth currentEN)
Creates a RotateCommand.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
protected double |
getAngle(EastNorth currentEN)
Get angle between the horizontal axis and the line formed by the pivot and given point.
|
java.lang.String |
getDescriptionText()
Provides a description text representing this command.
|
void |
handleEvent(EastNorth currentEN)
Compute new rotation angle and transform nodes accordingly.
|
int |
hashCode() |
protected void |
setRotationAngle(double rotationAngle)
Set the rotation angle.
|
protected void |
transformNodes()
Rotate nodes.
|
executeCommand, fillModifiedData, flagNodesAsModified, getDescriptionIcon, getNodesCenter, getParticipatingPrimitives, getTransformedNodes, storeOldState, undoCommand
checkOutlyingOrIncompleteOperation, ensurePrimitivesAreInDataset, getAffectedDataSet, getOrig
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getChildren
private final double startAngle
private double rotationAngle
public RotateCommand(java.util.Collection<? extends OsmPrimitive> objects, EastNorth currentEN)
objects
- objects to fetch nodes fromcurrentEN
- cuurent eats/northprotected final double getAngle(EastNorth currentEN)
currentEN
- cuurent eats/northpublic final void handleEvent(EastNorth currentEN)
handleEvent
in class TransformNodesCommand
currentEN
- the current world position of the mouseprotected void setRotationAngle(double rotationAngle)
rotationAngle
- The rotate angleprotected void transformNodes()
transformNodes
in class TransformNodesCommand
public java.lang.String getDescriptionText()
PseudoCommand
getDescriptionText
in interface PseudoCommand
getDescriptionText
in class TransformNodesCommand
public int hashCode()
hashCode
in class TransformNodesCommand
public boolean equals(java.lang.Object obj)
equals
in class TransformNodesCommand