// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: packimports(3) fieldsfirst 
// Source File Name:   Projector2D.java

package lt.monarch.chart.chart2D;

import java.awt.Point;
import java.awt.Rectangle;
import lt.monarch.chart.NormalizedPoint;
import lt.monarch.chart.Projector;

// Referenced classes of package lt.monarch.chart.chart2D:
//			NormalizedPoint2D

public class Projector2D
	implements Projector
{

	private Rectangle area;

	public Projector2D()
	{
	}

	public Rectangle getProjectionArea()
	{
		return area;
	}

	public Point project(NormalizedPoint normalizedpoint)
	{
		NormalizedPoint2D normalizedpoint2d = (NormalizedPoint2D)normalizedpoint;
		return new Point((int)((double)area.width * normalizedpoint2d.x) + area.x, (int)((double)area.height - (double)area.height * normalizedpoint2d.y) + area.y);
	}

	public Point project(NormalizedPoint normalizedpoint, Point point)
	{
		NormalizedPoint2D normalizedpoint2d = (NormalizedPoint2D)normalizedpoint;
		point.x = (int)((double)area.width * normalizedpoint2d.x) + area.x;
		point.y = (int)((double)area.height - (double)area.height * normalizedpoint2d.y) + area.y;
		return point;
	}

	public void setProjectionArea(Rectangle rectangle)
	{
		area = rectangle;
	}
}
