1   package fi.jyu.mit.graphics;
2   
3   /**
4    * Luokka jolla voi helposti luoda kuviota avaruuteen.
5    * Avaruuteen voi lisätä kuvioita, esimerkiksi
6    * <pre>
7    *      space.addLine(0,0,100,100).setColor(Color.RED);
8    *      space.addCircle(0, 0, 1).setColor(Color.RED);
9    *      space.addShape(new Line(0, 0, 10, 10)).setColor(Color.RED);
10   * </pre>
11   * @author Markus Kivioja
12   *
13   */
14  public class EasySpace extends Space implements Easy {
15      
16      /**
17       * Luo uuden avaruuden
18       *
19       */
20      public EasySpace() {
21          super();
22      }
23      
24      @Override
25      public Drawable addShape(Drawable shape) {
26          return add(shape);
27      }
28      
29      @Override
30      public Line addLine(double x1, double y1, double x2, double y2) {
31          return (Line)add(new Line(x1, y1, x2, y2));
32      }
33      
34      @Override
35      public Line addLine(double x1, double y1, double z1, double x2, double y2, double z2) {
36          return (Line)add(new Line(x1, y1, z1, x2, y2, z2));
37      }
38      
39      @Override
40      public Circle addCircle(double x, double y, double r) {
41          return (Circle)add(new Circle(x, y, r));
42      }
43      
44      @Override
45      public Circle addCircle(double x, double y, double z, double r) {
46          return (Circle)add(new Circle(x, y, z, r));
47      }
48      
49      @Override
50      public Polygon addPolygon(double[] xpoints, double[] ypoints) {
51          return (Polygon)add(new Polygon(xpoints, ypoints));
52      }
53  
54      @Override
55      public Polygon addPolygon(double[][] points) {
56          return (Polygon)add(new Polygon(points));
57      }
58  
59      @Override
60      public Axis addAxis(double xLength, double yLength, double zLength) {
61          return (Axis)add(new Axis(xLength, yLength, zLength));
62      }
63      
64      @Override
65      public Axis addAxis(double xLength, double yLength, double zLength, double x, double y, double z) {
66          return (Axis)add(new Axis(xLength, yLength, zLength, x, y, z));
67      }
68      
69      @Override
70      public FillPolygon addFillPolygon(double[] xpoints, double[] ypoints) {
71          return (FillPolygon)add(new FillPolygon(xpoints, ypoints));
72      }
73  
74      @Override
75      public FillPolygon addFillPolygon(double[][] points) {
76          return (FillPolygon)add(new FillPolygon(points));
77      }
78  }
79  
80