Package org.eclipse.gef.fx.nodes

# Class AbstractRouter.ControlPointManipulator

java.lang.Object
org.eclipse.gef.fx.nodes.AbstractRouter.ControlPointManipulator

Enclosing class:
  AbstractRouter

protected static class AbstractRouter.ControlPointManipulator extends Object
A `AbstractRouter.ControlPointManipulator` can be used to record, perform, and roll back control point changes during routing.

## Constructor Summary

Constructors
Constructor
Description
`ControlPointManipulator(Connection c)`
Constructs a new `AbstractRouter.ControlPointManipulator` for the given `Connection`.

## Method Summary

Modifier and Type
Method
Description
`Vector`
`addRoutingPoint(int index, Point point, double dx, double dy)`
Records the specified change.
`Vector`
`addRoutingPoint(Vector delta)`
Records the specified change.
`void`
`addRoutingPoints(int index, Point point, double... deltas)`
Records the given changes.
`void`
`applyChanges()`
Performs the recorded changes.
`Connection`
`getConnection()`
Returns the `Connection` that is manipulated.
`int`
`getIndex()`
Returns the current insertion index for manipulations.
`Point`
`getPoint()`
Returns the current `Point` on the `Connection`.
`void`
`setRoutingData(int index, Point point, Vector direction)`
Initializes this `AbstractRouter.ControlPointManipulator` for the recording of changes.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### ControlPointManipulator

public ControlPointManipulator(Connection c)
Constructs a new `AbstractRouter.ControlPointManipulator` for the given `Connection`.

Parameters:
  `c` - The `Connection` that is manipulated.

## Method Details

### addRoutingPoint

public Vector addRoutingPoint(int index, Point point, double dx, double dy)
Records the specified change.

Parameters:
  `index` - The index at which to insert a control point.
  `point` - The start coordinates for the change.
  `dx` - The horizontal component of the out direction.
  `dy` - The vertical component of the out direction.
Returns:
  A `Vector` specifying the out direction.

### addRoutingPoint

public Vector addRoutingPoint(Vector delta)
Records the specified change.

Parameters:
  `delta` - A `Vector` specifying the out direction.
Returns:
  A `Vector` specifying the out direction.

### addRoutingPoints

public void addRoutingPoints(int index, Point point, double... deltas)
Records the given changes.

Parameters:
  `index` - The start index for the changes.
  `point` - The start coordinates for the changes.
  `deltas` - The out directions for the new points.

### applyChanges

public void applyChanges()
Performs the recorded changes.

### getConnection

public Connection getConnection()
Returns the `Connection` that is manipulated.

Returns:
  The `Connection` that is manipulated.

### getIndex

public int getIndex()
Returns the current insertion index for manipulations.

Returns:
  The current index.

### getPoint

public Point getPoint()
Returns the current `Point` on the `Connection`.

Returns:
  The current `Point`.

### setRoutingData

public void setRoutingData(int index, Point point, Vector direction)
Initializes this `AbstractRouter.ControlPointManipulator` for the recording of changes.

Parameters:
  `index` - The index of the control point after which points are to be added.
  `point` - The start coordinates for the changes.
  `direction` - The current direction.