import java.awt.Color; class TileParameters { int n; // the number of sides on a polygon int k; // vertex valence, the number of polygons that meet at each vertex boolean quasiregular; int layers; // the number of layers of polygons to display int skipNumber; Color bgColor; Color diskColor; boolean fill; boolean outline; boolean grayScale; boolean alternating; // alternating colors public void checkPars() { // n should be between 3 and 20 n = Math.max(n,3); n = Math.min(n,20); // k should be large enough, but no larger than 20 if (n==3) k = Math.max(k,7); else if (n==4) k = Math.max(k,5); else if (n<7) k = Math.max(k,4); else k = Math.max(k,3); k = Math.min(k,20); // skipNumber should be between 1 and n/2 if (skipNumber*2 >= n) skipNumber = 1; // layers shouldn't be too big if (n==3 || k==3) layers = Math.min(layers,5); else layers = Math.min(layers,4); } // checkPars public String toString() { return "[n="+n+ ",k="+k+ ",layers="+layers +",quasiregular="+quasiregular +",alternating="+alternating+"]"; } } // TileParameters