You might need to give scala a little help with the types. I'm not sure if this will work but you could try typing the ConstantTransformer
:
val vertexShapeTransformer: Transformer[Int, Shape] =
new ConstantTransformer[Shape](new Ellipse2D.Float(-10,-10,20,20))
UPDATE
This should work, the type that you can pass to Transformer is anything up to Integer (not Int):
val vertexShapeTransformer: Transformer[_ >: Integer, Shape] =
new ConstantTransformer(new Ellipse2D.Float(-10,-10,20,20))