Added measure() method so that the component knows its size