// 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:   DotFreqImageSource.java

package lt.monarch.charts.spectrum;

import lt.monarch.awt.MathImageSource;
import lt.monarch.charts.AxisMapper;

public class DotFreqImageSource extends MathImageSource
{

	protected AxisMapper xMapper;
	protected AxisMapper yMapper;

	public DotFreqImageSource(int i, int j, AxisMapper axismapper, AxisMapper axismapper1)
	{
		super(i, j);
		xMapper = axismapper;
		yMapper = axismapper1;
	}

	public final void addPoint(Object obj, Object obj1)
	{
		try
		{
			int i = xMapper.map(super.width - 1, obj);
			int j = super.height - 1 - yMapper.map(super.height - 1, obj1);
			super.imageData[i + j * super.width] += 2D;
			if(i - 1 >= 0)
				super.imageData[(i - 1) + j * super.width]++;
			if(i + 1 < super.width)
				super.imageData[i + 1 + j * super.width]++;
			if(j - 1 >= 0)
				super.imageData[i + (j - 1) * super.width]++;
			if(j + 1 < super.height)
			{
				super.imageData[i + (j + 1) * super.width]++;
				return;
			}
		}
		catch(ArrayIndexOutOfBoundsException _ex) { }
	}
}
