/*
 * @(#)Pix.java	1.00  04/04/00
 *
 * Jan Hnátek
 * 
 */

/**
 * The <code>Pix</code> class is my own implementation of java.awt.geom.Point2D.Double.
 * I had to make it because the Point2D.Double exists since JDK1.2 and I wanted my app to run 
 * under the JDK1.1.x browsers (IE5,NS4). 
 * <p>
 * It defines a point representing a location in (x,&nbsp;y) coordinate space. The storage 
 * representation of both values is <code>double</code>
 * <p>
 *
 * @see Point2D
 * @version 	1.00, 04/04/00
 * @author	Jan Hnátek
 */
public class Pix
//************//
{
	/**
	* The X coordinate of this <code>Pix</code>.
	*/
public double x;
	/**
	* The Y coordinate of this <code>Pix</code>.
	*/
public double y;

	/**
	 * Constructs and initializes a <code>Pix</code> with
         * coordinates (0,&nbsp;0).
	 */
public Pix ()		{ x = y = 0; }
	 /** Constructs and initializes a <code>Pix</code> with the
         * specified coordinates.
         * @param x,&nbsp;y the coordinates to which to set the newly
         * constructed <code>Pix</code>
         * coordinates (0,&nbsp;0).
	 */
public Pix (double ix, double iy)
	{
	x = ix;
	y = iy;
	}

	/**
	 * Returns the X coordinate of this <code>Pix</code> 
         * in <code>double</code> precision.
         * @return the X coordinate of this <code>Pix</code>.
	 */
public double getX ()			{ return x; }	
	/**
	 * Returns the Y coordinate of this <code>Pix</code> in 
         * <code>double</code> precision.
         * @return the Y coordinate of this <code>Pix</code>.
	 */
public double getY ()			{ return y; }	
	/**
	 * Sets the location of this <code>Pix</code> to the 
         * specified <code>double</code> coordinates.
         * @param x,&nbsp;y the coordinates to which to set this
         * <code>Pix</code>
	 */
public void setLocation (double ix, double iy)
	{
	x = ix;
	y = iy;
	}

	/**
	 * Returns a <code>String</code> that represents the value 
       * of this <code>Pix</code>. Real x,y values are multiplied by given coeficients.
       * @param xprecision,&nbsp;yprecision x&nbsp;y multiplification coeficients
       * @return a string representation of this <code>Pix</code>.
	 */	
public String toString (int xprecision, int yprecision)	
	{
	return ("["+(long)(x*xprecision)+","+(long)(y*yprecision)+"]"); 
	}
	/**
	 * Returns a <code>String</code> that represents the value 
       * of this <code>Pix</code>. Both x,y values are multiplied by the same coeficient.
       * @param precision common multiplification coeficient
       * @return a string representation of this <code>Pix</code>.
	 */	
public String toString (int precision)
	{
	return toString (precision, precision);
	}
	/**
	 * Returns a <code>String</code> that represents the value 
         * of this <code>Pix</code>.
         * @return a string representation of this <code>Pix</code>.
	 */
public String toString ()
	{
	return "Pix["+x+", "+y+"]";
	}	
}