* @param deltaX x coordinate
* @param deltaY y coordinate
*/
public void translateSelectedPoint (double deltaX, double deltaY)
{
WhiteboardPoint modifyPoint = getModifyPoint();
if (modifyPoint == null)
return;
double x = whiteboardPoint.getX ();
double y = whiteboardPoint.getY ();
if (modifyPoint.getX() == x && modifyPoint.getY() == y)
{
this.whiteboardPoint.setX(x + deltaX);
this.whiteboardPoint.setY(y + deltaY);
this.width -= deltaX;
this.height -= deltaY;
modifyPoint.setX(x + deltaX);
modifyPoint.setY(y + deltaY);
}
else if (modifyPoint.getX() == x + width && modifyPoint.getY() == y)
{
this.whiteboardPoint.setY(y + deltaY);
this.width += deltaX;
this.height -= deltaY;
modifyPoint.setX(x + width);
modifyPoint.setY(y + deltaY);
}
else if (modifyPoint.getX() == x && modifyPoint.getY() == y + height)
{
this.whiteboardPoint.setX(x + deltaX);
this.width -= deltaX;
this.height += deltaY;
modifyPoint.setX(x + deltaX);
modifyPoint.setY(y + height);
}
else if (modifyPoint.getX() == x + width
&& modifyPoint.getY() == y + height)
{
this.width += deltaX;
this.height += deltaY;
modifyPoint.setX(x + width);
modifyPoint.setY(y + height);
}
this.setModifyPoint(modifyPoint);
this.recalculateSelectionPoints();
}