
/* Generated by Interface Builder */

#import "UHOvalShape.h"

@implementation UHOvalShape

- initFrame:(const NXRect *)frameRect;
{
	[super initFrame:frameRect];
	choice = UH_OVAL;
	return self;
}

-(const char *)getInspectorClassName;
{
	return "UHOvalShapeInspector";
}

- drawSelf:(const NXRect *)rects :(int)rectCount
{
	float inset=0.0;
	float size = MIN(bounds.size.width, bounds.size.height);
	if(isBordered)inset=lineWidth;

	PStranslate((bounds.size.width/2.00),(bounds.size.height/2.00));

			if(isFilled){
				PSgsave();
				NXSetColor(fillColor);
				if(choice==UH_CIRCLE)
					PSscale(size-2.*inset,size-2.*inset);
				else
					PSscale(bounds.size.width-2.*inset,bounds.size.height-2.*inset);
				PSarc(0.,0.,.5,0.,360.);
				PSfill();
				PSgrestore();
			}
			if (isBordered) {
				PSsetlinewidth(lineWidth);
				NXSetColor(lineColor);
				if(choice==UH_CIRCLE)
					PSscale(size-lineWidth,size-lineWidth);
				else
					PSscale(bounds.size.width-lineWidth,bounds.size.height-lineWidth);
				PSarc(.0,.0,.5,0,360);
				PSmatrix();
				PSdefaultmatrix();
				PSsetmatrix();
				PSstroke();
			}

	return self;
}

@end
