Release 1.2 1992  Techno-Sciences, Inc.

nxyView

INHERITS FROM	View: Responder : Object

DECLARED IN	NXYView.h

CLASS DESCRIPTION

nxyView is the primary class of the nxyPalette, a plotting palette which may be used from Interface Builder. nxyPalette is based on the 2D plotting package nxpplot written by Tom Pulliam and Dennis Jespersen.  By loading nxyPalette into Interface Builder, an instance of nxyView may be dragged from the palette into the user's application. Parameters for the view may set from its Inspector from within IB. The view should be connected to an instance of the user's application using the id nxyView.  Data may be passed to the view for plotting using a (NXStream) stream. The user's application may be compiled by adding either all the appropriate source modules (NXYView.m/h, Plot.m/h, auxil.m, defs.h, title.psw) to the Project, or by adding the library of compiled source, libnxyPalette.a (which should be installed in some suitable directory such as /usr/local/lib), and the include files NXYView.h and Plot.h to the Project.  Most of the actual work in generating the plot is done by Plot.m. See the example MyPlotter and the source code for more details.

INSTANCE VARIABLES

Inherited from Object	Class	isa;

Declared in NXYView	    id	  plotParam
	    id	  plotInspectorPanel
	    id	  delegate

plotParam 	id of the instance of Plot class that does most of  the calculations
				 plotInspectorPanel			            id of the IB Inspector panel for this palette

    
METHOD TYPES

Methods for setting parameter from the Inspector
										 -setGrid:(int)grid_state
										 - setBorder:(int)border_state
										 -(int)gridState
										 -(int)borderState
										 -setAutoMaxMinState:(int)state
										 -(int)autoMaxMinState
										 -setAutoPaperState:(int)state
										 -(int)autoPaperState
										 -setXLinLogState:(int)state
										 -(int)xLinLogState
										 -setYLinLogState:(int)state
										 -(int)yLinLogState
										 -setMainTitle:(const char *)mainTITLE
										 -setXaxisLabel:(const char *)xAxisLabel
										 -setYaxisLabel:(const char *)yAxisLabel
										 -(const char *)mainTitle
										 -(const char *)xaxisLabel
										 -(const char *)yaxisLabel
										 -setXincValue:
										 -setXminValue:
										 -setXmaxValue:
										 -setYincValue:
										 -setYminValue:
										 -setYmaxValue:
										 -(float)xIncValue
										 -(float)xMinValue
										 -(float)xMaxValue
										 -(float)yIncValue
										 -(float)yMinValue
										 -(float)yMaxValue
										 -setLogoFlag:(int)state;
										 -(int)logoFlag;
										 - copyToPasteboard:sender;

Drawing methods
	- drawSelf: 
										             - initFrame:
	- clear:
	- initPlot:
	
Printing
	- doPrinting: 
	
Saving to PS
	- saveEPS: 

Copying to pasteboard
	- copyToPasteboard: 

Setting the delegate	
	- setDelegate: 

Archiving
	- read: 
- write:

Reading data and drawing
	- clearNXYView:
	- plotDataFromStream:

METHOD USED BY DELEGATE
 
         Reading in data from a stream	 	- nxyView:sender   provideDataStream:

INSTANCE METHODS AVAILABLE TO THE USER

clear
- clear:sender

Used to clear the entire plot area. Should not be called by the user, instead use -clearNXYView.
See also:  - clearNXYView:sender

clearNXYView
- clearNXYView:sender

Clear the plot in the view by resetting the min/max values to zero. Does not remove the axis labels or title.
See also:  - plotDataFromStream:sender

copyToPasteboard
- copyToPasteboard:sender

Copies the contents of NXYView (with a bounding box) into the NeXT pasteboard, which may then be pasted into other NeXT applications.

doPrinting
- doPrinting:sender

Sends the view to the printer via the standard NeXT print object. Prints only the plot and (if invoked) its border. 

nxyView:sender  provideDataStream
- nxyView:sender  provideDataStream:(NXStream)dataStream

Plots two or more columns of data in the view from a stream. The user should write the data to a (NXStream)stream then make an object ("Controller") which is the delegate of the view and which is responsible for providing the data using this method. 

plotDataFromStream
- plotDataFromStream:sender

Method which is messaged to start plotting action on the user's data. Actual data should be supplied via delegate using the method "nxyView:sender provideDataStream". If this method (or the delegate) is unavailable, NXYView will alert the user (with an Alert panel) with the option of accessing data via an Open panel.

saveEPS
- saveEPS:sender

Saves the view to an EPS file with bounding box the size of the instance of nxyView.

setDelegate
- setDelegate:anObject

Sets the views delegate to anObject. This is normally done in IB with connections.

whyTheBeep (in Plot.m)
- whyTheBeep:sender

This method is NOT implemented, but is in place to be implemented by the user for error detection. See the source code for Plot.m.

CONSTANTS AND DEFINED TYPES

			#ifndef MIN
			#define MIN(x,y) ((x)<(y)? (x) : (y))
			#endif

			#ifndef MAX
			#define MAX(x,y) ((x)>(y)? (x) : (y))
			#endif

			#ifndef ABS
			#define ABS(x) ( (x)<0? (-(x)) : (x) )
			#endif

			#ifndef SGN
			#define SGN(x) ( (x)<0? -1.0 : 1.0 )
			#endif

			#define XOFFSET 100.0		/* offsets (in pixels) of axis origin from */
			#define YOFFSET  50.0		/* lower left hand corner of window        */

			#define NO 0
			#define YES 1