@Override
  public void paintComponent(Graphics g) {
    super.paintComponent (g);
    boardRep = g;
    // amount of cols and rows
    cols = CELL_AMOUNT;
    rows = CELL_AMOUNT;
    // paint
    for (int i = 0; i < cols; i++) {

      int cellcol = ( i * rectSize ) + 1 + LEFTLEGEND_SPACE;
      for (int j = 0; j < rows; j++) {

        // calculate position of every field

        int cellrow = ( j * rectSize ) + 1;

        // set its color black, if its a black field
        if ( i % DOUBLE_COLUMN_DIVISOR == 0 ) {
          if ( j % DOUBLE_COLUMN_DIVISOR == 0 ) {
            g.setColor (whiteBG);
          }
          else {
            g.setColor (blackBG);
          }
        }
        else {
          if ( j % DOUBLE_COLUMN_DIVISOR == 0 ) {
            g.setColor (blackBG);
          }
          else {
            g.setColor (whiteBG);
          }
        }
        g.fillRect (cellcol, cellrow, rectSize, rectSize);

      }

      int a;
      if ( perspective == WHITE ) {
        a = i;
      }
      else {
        a = CELL_AMOUNT - 1 - i;
      }
      int fontWidth = g.getFontMetrics ().charWidth (legendAlph[a].indexOf (0));
      int fontSize = (int) ( LEFTLEGEND_SPACE * SCALING_TO_HALF );
      int vertSpaceLeft = (int) ( SCALING_TO_HALF * rectSize + SCALING_TO_HALF
          * fontSize );
      int vertSpaceBottom = (int) ( ( 1 + SCALING_TO_HALF ) * fontSize );
      int horSpaceBottom = (int) ( SCALING_TO_HALF * rectSize - SCALING_TO_HALF
          * fontWidth );
      // paint the legend to the left and the bottom
      Font f = new Font ("Dialog", Font.PLAIN, fontSize);
      g.setColor (Color.BLACK);
      g.setFont (f);
      g.drawString (legendAlph[a], cellcol + horSpaceBottom, rectSize
          * CELL_AMOUNT + vertSpaceBottom);
      g.drawString (legendNum[CELL_AMOUNT - 1 - a], 5, ( i ) * rectSize
          + vertSpaceLeft);

    }

    setHighlightPosition ();

    paintGrid ();
    setHighlightLast ();
    setPiecePics ();
  }