Пример #1
0
 /**
  * Erstellt ein neues Polygon und fügt das alte zur Liste hinzu. Außerdem werden die Beobachter
  * informiert.
  */
 public void bearbeitungAbschließen() {
   polygonliste.add(aktutellesPolygon);
   aktutellesPolygon = new Polygon();
   aktutellesPolygon.addObserver(this);
   setChanged();
   notifyObservers();
 }
Пример #2
0
 /**
  * Dem aktuellen Polygon einen Punkt hinzufuegen.
  *
  * @param x x-Koordinate
  * @param y y-Koordinate
  */
 public void punkthinzufuegen(int x, int y) {
   aktutellesPolygon.punkthinzufuegen(x, y);
   // System.out.println("Der Punkt " + x + " " + y + " wurde hinzugefügt.");
 }
Пример #3
0
 /** Konstruktor registriert den Beobachter */
 public PolygonModell() {
   polygonliste = new ArrayList<Polygon>();
   aktutellesPolygon = new Polygon();
   aktutellesPolygon.addObserver(this);
 }