org.openstreetmap.josm.command
Class ScaleCommand

java.lang.Object
  extended by org.openstreetmap.josm.command.PseudoCommand
      extended by org.openstreetmap.josm.command.Command
          extended by org.openstreetmap.josm.command.TransformNodesCommand
              extended by org.openstreetmap.josm.command.ScaleCommand

public class ScaleCommand
extends TransformNodesCommand


Nested Class Summary
 
Nested classes/interfaces inherited from class org.openstreetmap.josm.command.TransformNodesCommand
TransformNodesCommand.OldState
 
Field Summary
private  EastNorth pivot
          Pivot point
private  double scalingFactor
          Current scaling factor applied
(package private)  EastNorth startEN
          World position of the mouse when the user started the command.
 
Fields inherited from class org.openstreetmap.josm.command.TransformNodesCommand
nodes, oldStates
 
Constructor Summary
ScaleCommand(java.util.Collection<OsmPrimitive> objects, EastNorth currentEN)
          Creates a ScaleCommand.
 
Method Summary
 javax.swing.Icon getDescriptionIcon()
          Provides a descriptive icon of this command.
 java.lang.String getDescriptionText()
          Provides a description text representing this command.
 void handleEvent(EastNorth currentEN)
          Compute new scaling factor and transform nodes accordingly.
protected  void transformNodes()
          Scale nodes.
 
Methods inherited from class org.openstreetmap.josm.command.TransformNodesCommand
executeCommand, fillModifiedData, flagNodesAsModified, getNodesCenter, getParticipatingPrimitives, getTransformedNodes, storeOldState, undoCommand
 
Methods inherited from class org.openstreetmap.josm.command.Command
checkAndConfirmOutlyingOperation, getLayer, getOrig, invalidBecauselayerRemoved
 
Methods inherited from class org.openstreetmap.josm.command.PseudoCommand
getChildren
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pivot

private EastNorth pivot
Pivot point


scalingFactor

private double scalingFactor
Current scaling factor applied


startEN

EastNorth startEN
World position of the mouse when the user started the command.

Constructor Detail

ScaleCommand

public ScaleCommand(java.util.Collection<OsmPrimitive> objects,
                    EastNorth currentEN)
Creates a ScaleCommand. Assign the initial object set, compute pivot point. Computation of pivot point is done by the same rules that are used in the "align nodes in circle" action.

Method Detail

handleEvent

public void handleEvent(EastNorth currentEN)
Compute new scaling factor and transform nodes accordingly.

Specified by:
handleEvent in class TransformNodesCommand
Parameters:
currentEN - the current world position of the mouse

transformNodes

protected void transformNodes()
Scale nodes.

Specified by:
transformNodes in class TransformNodesCommand

getDescriptionText

public java.lang.String getDescriptionText()
Description copied from class: PseudoCommand
Provides a description text representing this command.

Overrides:
getDescriptionText in class TransformNodesCommand

getDescriptionIcon

public javax.swing.Icon getDescriptionIcon()
Description copied from class: PseudoCommand
Provides a descriptive icon of this command.

Overrides:
getDescriptionIcon in class TransformNodesCommand


JOSM