Template Method
- drawSelection calls draw
- Must declare draw in SelectableShape
- No implementation at that level!
- Declare as abstract method
public abstract void draw(Graphics2D g2)
- Defined in CarShape, HouseShape
- drawSelection method calls draw, translate
- drawSelection doesn't know which
methods--polymorphism
- drawSelection is a template method
- Ch6/scene2/SelectableShape.java
- Ch6/scene2/HouseShape.java