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

import java.awt.*;

public class GLine extends GeoObject {

    // Anfang Attribute
    protected GPoint point1 = null;
    protected GPoint point2 = null;
    // Ende Attribute

    public GLine(GPoint point1, GPoint point2) {
        super();
        this.point1 = point1;
        this.point2 = point2;
    }

    // Anfang Methoden
    public boolean dependsOn(GeoObject p) {
        boolean res = (p == point1) || (p == point2);
        return res;
    }

    public void draw(Graphics gr) {
        gr.setColor(getColor());    
        gr.drawLine(point1.getX(),point1.getY(),point2.getX(), point2.getY());
    }

    // Ende Methoden
} // end of GLine
