
/* Generated by Interface Builder */

#import "ChaosPlot.h"
#import "CPlotStorage.h"
#import <math.h>
#import <appkit/appkit.h>


@implementation ChaosPlot


- drawSelf: (const NXRect *) r : (int) c
{
	PSsetgray(NX_WHITE);
	NXRectFill(r);
	PSsetgray(NX_BLACK);
	NXFrameRect(r);

	return self;
}

- plotPoint:(float)x :(float)y
{
	float xpos, ypos;

	xpos = x * bounds.size.width;
	ypos = y * bounds.size.height;

	[self lockFocus]; 
	PSsetinstance(YES);
	PSrectfill(xpos, ypos, 1, 1);
	[self unlockFocus];

	return self;
}

- plotDelayedPoint
{
	float x, y;
	[cPlotStorage retrieveX:&x Y:&y];
	return [self plotPoint:x :y];
}

- labelPlot:(char *)title Titlefont:titlefont 
	Xmax:(char *)xmax  Xlabel:(char *)xlabel  Xmin:(char *)xmin
	Ymax:(char *)ymax  Ylabel:(char *)ylabel  Ymin:(char *)ymin
	axisFont:axisfont
{
	[titleField setFont:titlefont];
	[titleField setStringValue:title];

	[xMaxField setFont:axisfont];
	[xMinField setFont:axisfont];
	[xLabelField setFont:axisfont];
	[yMaxField setFont:axisfont];
	[yMinField setFont:axisfont];
	[yLabelField setFont:axisfont];

	[xMaxField setStringValue:xmax];
	[xMinField setStringValue:xmin];
	[xLabelField setStringValue:xlabel];
	[yMaxField setStringValue:ymax];
	[yMinField setStringValue:ymin];
	[yLabelField setStringValue:ylabel];

	return self;
}

- setUp
{
	[self allocateGState];
	return self;
}

@end
