src/main/java/chalmers/pimp/model/tools/ShapeTool.java
private ILayer createRect(MouseStatus mouseStatus) {
    Point originPoint = getOriginPoint(mouseStatus);
    Point maxPoint = getMaxPoint(mouseStatus);

    int x = model.getViewport().getTranslatedX(originPoint.getX());
    int y = model.getViewport().getTranslatedY(originPoint.getY());
    int width = maxPoint.getX() - originPoint.getX();
    int height = maxPoint.getY() - originPoint.getY();

    return LayerFactory.createRectangle(x, y, width, height, model.getSelectedColor());
  }
/**
   * Creates and returns a rectangle based on the origin point of the rectangle and the current
   * position of the mouse.
   *
   * @param mouseStatus the current mouse status.
   * @return a rectangle.
   */
Creates and returns a rectangle based on the origin point of the rectangle and the current
position of the mouse.

@param mouseStatus the current mouse status.
@return a rectangle.
Creates and returns a rectangle based on the origin point of the rectangle and the current position of the mouse . @param mouseStatus the current mouse status . @return a rectangle .
private ILayer createRect(MouseStatus mouseStatus) {
    Point originPoint = getOriginPoint(mouseStatus);
    Point maxPoint = getMaxPoint(mouseStatus);
    int x = model.getViewport().getTranslatedX(originPoint.getX());
    int y = model.getViewport().getTranslatedY(originPoint.getY());
    int width = maxPoint.getX() - originPoint.getX();
    int height = maxPoint.getY() - originPoint.getY();
    return LayerFactory.createRectangle(x, y, width, height, model.getSelectedColor());
  }
private ILayer createRect ( MouseStatus mouseStatus ) { Point originPoint = getOriginPoint ( mouseStatus ) ; Point maxPoint = getMaxPoint ( mouseStatus ) ; int x = model . getViewport ( ) . getTranslatedX ( originPoint . getX ( ) ) ; int y = model . getViewport ( ) . getTranslatedY ( originPoint . getY ( ) ) ; int width = maxPoint . getX ( ) - originPoint . getX ( ) ; int height = maxPoint . getY ( ) - originPoint . getY ( ) ; return LayerFactory . createRectangle ( x , y , width , height , model . getSelectedColor ( ) ) ; }
Creates and returns a rectangle based on the origin point of the rectangle and the current
 position of the mouse.
Creates and returns a rectangle based on the origin point of the rectangle and the current position of the mouse .