use Layer.java to a base class.