public void buildMatrix()
    {
        this.getSize().setWidth(this.RowCells * this.CellSize.getWidth());
        this.getSize().setHeight(this.Rows * this.CellSize.getHeight());
        this.Matrix.clear();
        int row = 0;
        int z = 0;

        for(int i = 0; i < Cells; i++)
        {
            this.Matrix.add(new Rectangle(z * CellSize.getWidth(), row * CellSize.getHeight(), CellSize.getWidth(), CellSize.getHeight()));
            z++;
            if(z == RowCells)
            {
                row++;
                z = 0;
            }
        }
    }