// dpoint Version 2002 enthält Zusatz für HyperbApp
// geeignet für alle meine Fraktal-Applets
// Oktober 2002 (C) Ulli Schwebinghaus
// einzige Version ab 2005

import java.awt.*;
import java.applet.*;

public class dPoint
{
  double x,y;
  Color col=Color.white;
  TCanvas tc;
  int w=2;
    
  dPoint()
  {
    x=0; y=0;
  }
  
  dPoint(double x,double y)
  {
    this.x=x; this.y=y;
  }
  
  dPoint(Color c,int d,TCanvas tc)
  {
    this.x=0; this.y=0;
    col=c;
    w=d;
    this.tc=tc;    
  }
  
  public void setPoint(double x,double y)
  {
    this.x=x; this.y=y;
  }
  
  public void setdPoint(dPoint P)
  {
    x=P.x; y=P.y;
  }
  
  public Point getPoint()
  {
    Point p=new Point();
    p.x=(int)Math.round(x);
    p.y=(int)Math.round(y);
    return p;
  }
  
  public void draw()
  {
    if (tc!=null)
    {
      int d=w/2;
      Graphics g=tc.getGraphics();
      g.setColor(col);
      g.fillOval((int)Math.round(x)-d,(int)Math.round(y)-d,w,w);
    }
  }

}