1  import java.awt.*;
 2  public class line extends primitive
 3  {
 4      point Begin;
 5      point End;
 6
 7
 8      public line(float XB,float YB,float XE,float YE )
 9      {
10          Begin=new point(XB,YB);
11          End  =new point(XE,YE);
12      }
13
14      public void receive( visitor v)
15      {
16          v.visitLINE(this);
17      }
18
19      public void zeichne(Graphics g)
20      {
21          int x1,y1,x2,y2;
22          x1=(int) Begin.X;
23          y1=(int) Begin.Y;
24          x2=(int) End.X;
25          y2=(int) End.Y;
26          g.drawLine(x1,y1,x2,y2);
27      }
28  }