public void drawRect(Rect rect) {
   g2d.drawRect(rect.fromX, rect.fromY, rect.getWidth(), rect.getHeight());
 }