/* Copyright 2001 Michael R. Wick */ package Strategies; import java.awt.Canvas; import java.awt.Dimension; import java.awt.Point; import java.awt.Color; import java.awt.Graphics; import Shapes.*; import java.util.*; public class GrowShapeMutationStrategy extends ShapeMutationStrategy { public GrowShapeMutationStrategy(int w) { super(w); } public void mutate( Shape s ) { Point ctr; int d1, d2; ctr = s.getCenter(); d1 = r.nextInt(0, Math.abs( (origin.x - ctr.x) / 4) ); d2 = r.nextInt(0, Math.abs( (origin.y - ctr.y)/ 4) ); // Scale the shape } }