|
DemoShapes |
|
1 // joi/3/shapes/DemoShapes.java 2 // 3 // 4 // Copyright 2003 Bill Campbell and Ethan Bolker 5 6 /** 7 * A short demonstration program for HLine and Box. 8 * 9 * @version 3 10 */ 11 12 public class DemoShapes 13 { 14 /** 15 * Paint some shapes on a Screen and draw it to a Terminal. 16 */ 17 18 public static void main( String[] args ) 19 { 20 Terminal t = new Terminal(); 21 Screen s = new Screen( 36, 12 ); 22 23 HLine h1 = new HLine( 10, 'R' ); 24 Box b1 = new Box( 5, 6, 'G' ); 25 Box b2 = new Box( 5, 6, 'B' ); 26 27 h1.paintOn( s ); // at position (0,0) 28 b1.paintOn( s, 2, 2 ); 29 b2.paintOn( s, 4, 5 ); 30 31 t.println( "A Screen with an HLine and two Boxes:" ); 32 s.draw( t ); 33 } 34 } 35
|
DemoShapes |
|