1:
2: /**
3: Abstract class for simple character graphics figures to send to
4: the screen. It is intended to be used as a base class for the kinds
5: of figures that will be used in graphics applications.
6: */
7: public abstract class Figure
8: {
9: private int offset;
10:
11: public abstract void drawHere( );
12:
13: /**
14: Draws the figure at lineNumber lines down
15: from the current line.
16: */
17: public void drawAt(int lineNumber)
18: {
19: int count;
20: for (count = 0; count < lineNumber; count++)
21: System.out.println( );
22: drawHere( );
23: }
24:
25: public Figure( )
26: {
27: offset = 0;
28: }
29:
30: public Figure(int theOffset)
31: {
32: offset = theOffset;
33: }
34:
35: public void setOffset(int newOffset)
36: {
37: offset = newOffset;
38: }
39:
40: public int getOffset( )
41: {
42: return offset;
43: }
44: }