The Walt Disney Company has agreed to buy Lucasfilm in a stock-and-cash deal valued at $4 billion which will also give Disney control of the Star Wars franchise.