1   package appletSample; // NOPMD nimi saa kelvata
2   
3   import java.awt.Color;
4   
5   import sample.CarSample.Car;
6   import sample.UkkoSample.Ukko;
7   import fi.jyu.mit.graphics.ControlButtons;
8   import fi.jyu.mit.graphics.EasyApplet;
9   import fi.jyu.mit.graphics.SpacePanel;
10  import fi.jyu.mit.graphics.TouchPad;
11  
12  /**
13   * Sovelma, joka käyttää kuvapaneelia.
14   * @author vesal
15   * @version 28.08.2008
16   */
17  public class CarManApplet extends EasyApplet {
18  
19      private static final long serialVersionUID = 8729837737198762872L;
20  
21      /**
22       * Alustetaan sovelmalle kuviot.
23       * @see java.applet.Applet#init()
24       */
25      @Override
26      public void init() {
27          SpacePanel panel = getPanel(); 
28          Car car = new Car(0, 0, 0);
29  
30          panel.add(car);
31          panel.scale(-4, -4, 4, 4);
32  
33          Ukko ukko = new Ukko(-3,3,0.01,180,Color.RED); panel.add(ukko);
34  
35          setTouchPad(true,true);
36          setControlButtons(true);
37  
38          add(new TouchPad(ukko, false));
39          add(new ControlButtons(ukko));
40     }
41  }
42