@Override
public List<Handle> getHandles(HandleGesture gesture) {
if (gesture == null) {
return UnmodifiableList.decorate(Arrays.asList(new Handle[] {
new Handle(this, x0, y0), new Handle(this, x1, y1) }));
} else {
Handle h = gesture.getHandle();
int dx = gesture.getDeltaX();
int dy = gesture.getDeltaY();
Handle[] ret = new Handle[2];
ret[0] = new Handle(this, h.isAt(x0, y0)
? Location.create(x0 + dx, y0 + dy) : Location.create(x0, y0));
ret[1] = new Handle(this, h.isAt(x1, y1)
? Location.create(x1 + dx, y1 + dy) : Location.create(x1, y1));
return UnmodifiableList.decorate(Arrays.asList(ret));
}
}