/**
 *
 * Beschreibung
 *
 * @version 1.0 vom 06.09.2012
 * @author 
 */

import java.awt.Color;
import java.awt.Graphics;

public class GPoint extends GeoObject {

    // Anfang Attribute
    private int x;
    private int y;
    // Ende Attribute

    public GPoint(int x, int y) {
        super();
        this.x = x;
        this.y = y;
    }

    // Anfang Methoden
    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public void draw(Graphics gr) {
        gr.setColor(this.getColor());
        gr.drawRect(x-2,y-2,5,5);    
    }

    public double abstandZu(int mx, int my) {
        int dx = mx - x;
        int dy = my - y;
        double d = Math.sqrt(dx * dx + dy * dy);
        return d;
    }

    // Ende Methoden
} // end of Point
