projekt  
  einleitung
  applet
  quellcode
über  
  info
  team
quellcode
 
JAVADOC
SOURCECODE
import java.awt.event.*;
import javax.swing.*;
import java.awt.*;
import java.text.*;
import java.applet.*;


public class Main extends JApplet
{
  /**
   * this container for global access (e.g. .setCursor,...)
   */
  public static Container main;
  /**
   * unified numberformat for all number-textfields
   * (the x/y-metres will be displayed with following mask)
   */
  private static DecimalFormat numberFormat= new DecimalFormat("0.00E0");

  //the collision audio-files
  public static AudioClip collision;
  public static AudioClip crash;

  /**
   * applet has been loaded into the system
   */
  public void init()
  {
    try
	{
	  String plaf = "com.sun.java.swing.plaf.motif.MotifLookAndFeel";
	  UIManager.setLookAndFeel(plaf);
      SwingUtilities.updateComponentTreeUI(this);
    }
	catch (UnsupportedLookAndFeelException e)
	{
      System.err.println(e.toString());
    }
	catch (ClassNotFoundException e)
	{
      System.err.println(e.toString());
    }
	catch (InstantiationException e)
	{
      System.err.println(e.toString());
    }
	catch (IllegalAccessException e)
	{
      System.err.println(e.toString());
    }

    Container rootPane= getContentPane();
    //public boolean isFocusTraversable()
    main= rootPane;
      Screen screen = new Screen(); //make screen
    rootPane.add(screen, BorderLayout.CENTER);
      //JPanel optionPanel= new JPanel(new GridLayout(3,1));
      JPanel guiPanel= new JPanel(new BorderLayout());
        JPanel massControl= new JPanel(new BorderLayout());
          MassPanel massPanel= new MassPanel(); // make mass panel
        massControl.add(massPanel,BorderLayout.NORTH);
          ControlPanel controlPanel= new ControlPanel(); // make control panel
        massControl.add(controlPanel,BorderLayout.SOUTH);
      guiPanel.add(massControl, BorderLayout.NORTH);
        GlobalPanel globalPanel= new GlobalPanel(); //make global panel
      guiPanel.add(globalPanel, BorderLayout.SOUTH);
    rootPane.add(guiPanel, BorderLayout.EAST);

    collision = getAudioClip(getCodeBase(), "collision.wav");
    crash = getAudioClip(getCodeBase(), "crash.wav");
  }

  public void start()
  {
  }

	
  /**
   * language-dependent-number-string -> double
   */
  public static double str2double(String str)
  {
    double r=0;
    try
    {
      r=numberFormat.parse(str).doubleValue();
    } catch(ParseException e)
    {
      Main.error("getXMetres()","Can't parse "+str);
    }
    return r;
  }

  /**
   * double -> language-dependent-number-string
   */
  public static String double2str(double d)
  {
    return numberFormat.format(d);
  }

  /**
   * prints out a error-message
   */
  public static void error(String caption, String msg)
  {
    JOptionPane.showMessageDialog(null,msg,caption,JOptionPane.ERROR_MESSAGE);
  }
}