ftp.nice.ch/pub/next/science/mathematics/HippoDraw.2.0.s.tar.gz#/HippoDraw/Hippo.bproj/HGraphicView.h

This is HGraphicView.h in view mode; [Download] [Up]

/* Hippo Graphic View	by Paul Kunz	June 1991
 * a subclass of GraphicView in /NextDeveloper/Examples/Draw
 * to add or over-ride so that it can handle hippo Graphic objects
 *
 * Copyright (C)  1991  The Board of Trustees of
 * The Leland Stanford Junior University.  All Rights Reserved.
 */
 
#define HGRAPHICVIEW_H_ID "$Id: HGraphicView.h,v 2.24.2.2 1994/02/08 20:28:45 rensing Exp $"

#import <appkit/appkit.h>
#import "Draw.subproj/GraphicView.h"
#import "hippo.h"

@class HDrawApp;
@interface HGraphicView : GraphicView
{
    id		prefPanel;	/* the Preferences Panel */
    id		prefForm;	/* Preferences Panel Form */
    id 		tupleList;	/* List used for archiving & closing */
    id		cutList;	/* List of Plot objects that display Cuts */
    id		rotateCursor; 	/* the cursor for grabbing graphs */
    HDrawApp	*hippoDraw;	/* Instance of HippoDraw controler */
}
/* The following methods over-ride the super class */
+ initialize;
 /*
  * Registers the defaults
  */
  
+ convert:(NXTypedStream *)ts to:(const char *)type using:(SEL)writer toPasteboard:pb;
 /*
  * over ride method from super class inorder to make this class
  * a scrapper
  */
  
- initFrame:(const NXRect *)frameRect;
 /*
  * Designated initializer for class.
  */
  
- (BOOL)validateCommand:menuCell;
 /*
  * Invoked with menuCell by autoupdate mechanism.   Returns YES
  * if menuCell's action is valid for selected Graphic(s).
  */
  
- (BOOL) hasCutsSelected;
 /*
  * Returns YES if any of the selected Plots has a cut applied or
  * is a Plot displaying a cut.
  */

- addPages:(int) n;
 /*
  * add the specified number of pages to the document
  */
  
/* The following methods are extensions for Hippo */

- addPlotOfType:(graphtype_t) type;
 /*
  * Creates and adds a new Plot of specified type to the GraphicView,
  * selects it and returns the newly created plot.
  * The type corresponds to the hippo graphtype_t
  * 
  * See also: -addPlotOfType:andSelect:
  */
  
- addPlot:plot andSelect:(BOOL) selFlag;
 /*
  * Adds a new Plot to the GraphicView.
  * If selFlag is YES then
  * also selects the newly created plot and brings front the
  * data selection inspector.
  *
  * See also: -addPlotOfType:
  */
 
- calcPlacement: (const NXSize *)theSize result:(NXPoint *)location;
  /*
   * given the rectangle, which defines the current size and position 
   * of some set of objects, return the displacement needed to nicely
   * place the objects.
   */
   
- hTupleForFile:(const char *)filename index:(int) iValue;
 /*
  * Returns the HTuple object that contains the iValue-th ntuple in
  * file filename, or nil if none found.
  */

  
/*- addCut:plot;*/
 /*
  * Adds the Plot plot to the Cut Plot list.   Used with pasting a
  * cut plot.
  */
  
- cutList;
 /*
  * Returns a List object that contains Plot objects which support
  * displays of Cuts.
  */
  
- plotList;
 /*
  * Returns a List object that contains all Plot objects in the view.
  */
- (display *) displayList;
 /*
  * Returns list of Hippo display structures.
  */
- firstPlot;
 /*
  * Returns the Plot object is only one is selected or
  * returns the first Plot of a Overlay group, if only one is selected.
  */
  
- reDrawPlot;
  /* reDraws the plots.   Temporary method until each plot modification
  * method is implemented as graphicPerform style method.
  */
  
	
- (BOOL)move:(NXEvent *)event;
	/* overrides Graphic View's move: to do interactive 3D tracking */
	
- graphicsPerformNOP: g;
 /*
  * caches extended bounds of single graphic g
  */
  
- graphicsPerform:(SEL)aSelector with:(void *)argument
                   andDraw:(BOOL)flag inList:aList;
 /*
  * Sends message aSelector with argument argument to graphic objects
  * in List aList.   If flag is YES, redraws the graphic.
  */
  
- graphicsPerform:(SEL)aSelector with:arg1 with:arg2;
 /*
  * Sends message aSelector with arguments arg1 and arg2.
  */
  
- graphicsPerform:(SEL)aSelector with:(void *)argument1 with:(void *)argument2 andDraw:(BOOL)flag;

- copyPSToPasteboard:pboard;
  /* Copies only the PostScript code to the pasteboard
  */
  
- pasteFromPasteboard:(Pasteboard *)pboard andLink:(LinkType)doLink at:(const NXPoint *)center;
 /* 
  * Overrides the GraphicView method (implemented in gvPasteboard) in
  * order to bind plots to ntuple if needed.
  */
- writePSToStream:(NXStream *)stream;
 /* 
  * over-rides method in super class in order to bind displays
  */
  
- bindDisplays;
  /*
   * Binds all the displays to their ntuples.   This method is called
   * opening a document after both the Plot object and ntuple file
   * have been read.
   */

- bindDisplaysInList:list;
  /*
   * Binds any displays contained in Plot objects in the list list 
   * to their ntuples.   This is a private method used for both
   * opening documents and pasting from the PasteBoard.
   */ 
- replace:oldTuple with:newTuple;
 /*
  * Receiving view replaces oldTuple with newTuple for plots in its view.
  */
  
- closeTupleFile:(const char *) filename;
  /*
   * Informs each Plot object in the view that references n-tuple
   * in the file filename, that the file is closed.
   */
   
- openTuple:pasteBoard
    userData:(const char *)args
    error:(char **)errorMsg;
  /*
   * Method for reading ascii n-tuple from pasteboard
   */
   
- calcDefaultPlotSize:(NXRect *) bbox;
 /*
  * Calculates the default plot size and returns it via
  * the argument.
  */
  
- (BOOL) hasPFunctions;
 /* 
  * Responds YES if plot functions have been loaded
  */
  
- startArchivingTo:(const char *)directory;
 /*
  * Save the source file of any functions in the directory of the
  * document
  */
  
- (int) finishUnarchivingFrom:(const char *) directory;
 /*
  * Informs the current list of HTuples that unarchiving is about
  * finished so that they can attach an tuple column functions.
  * Returns 0 if successful, non-zero otherwise.
  */
  
- write:(NXTypedStream *)stream;
  /*
   * Writes the HGraphicView object to NXTypedStream stream.
   */
   
- read:(NXTypedStream *)stream;
  /*
   * Reads the HGraphicView object from the NXTypedStream stream.
   */
   
/* Following methods makes up for used method not implemented
 * in the NS 3.0 version of GraphicView.
 */

- graphicsPerformSingle:(SEL)aSelector with:(void *)argument on:(id) g;

- loadImageFromStream:(NXStream *)stream at:(const NXPoint *)location allowAlpha:(BOOL)alphaOk;
/*
 * Creates a new Image object using the PostScript or TIFF found in the
 * given stream and inserts it as the only item in the selection (i.e.
 * it deslects everything else).   The new Graphic is centered at the
 * given point p, and the GraphicView is scrolled to make the Graphic
 * visible.
 */

- insertGraphicNoSelect:graphic;
/*
 * Inserts the specified graphic into the glist and draws it.
 */


- copySelectionAsPS:(NXStream *)stream;

- (BOOL) isAllowed;
 /* Checks if any selected graphic is a cutPlot.  Returns
  * YES if cut: or delete: method can proceed
  */

@end

/* Following methods handle Menu targets and keyboard events */

@interface HGraphicView(Menu)

- addPage:sender;
  /*
   * extend the document by 1 page and move all the objects up.
   */

- deletePage:sender;
 /*
  * Deletes the last page if empty
  */
- addSaveWindow:sender;
 /*
  * add a save window to the document
  */     

- alignAll:sender;
 /*
  * Aliases for -overlay: method.   Kept temporarily for
  * backward compatiblity.
  */
   
- alignSize:sender;
 /*
  * Aliases for -overlay: method.   Kept temporarily for
  * backward compatiblity.
  */
  
- alignXRange:sender;
  /* Forces all selected Plots to accept the X range of the first 
   * selected plot
   */
   
- alignYRange:sender;
  /* Forces all selected Plots to accept the Y range of the first 
   * selected plot if the first selected Plot is  not a 1D plot.
   */
   
- alignXNumBins:sender;
  /* Forces all selected Plots to accept the number of bins on the X
   * axis of the first selected plot.
   */

- alignYNumBins:sender;
  /* Forces all selected Plots to accept the number of bins on the Y
   * axis of the first selected plot if that plot is not 1D plot.
   */

- cut:sender;
 /*
  * Cut selected Graphic objects, but check if any are Plot objects
  * displaying a cut.   If so, prompt user first.
  */

- delete:sender;
 /*
  * Delete selected Graphic objects, but check if any are Plot objects
  * displaying a cut.   If so, prompt user first.
  */

- overlay:sender;
 /*
  * Forms an Overlay Group from the selected Graphics.
  */
  
- unoverlay:sender;
 /*
  * Un-does an Overlay Group.
  */
  
- prefPanel:sender;
 /*
  * Brings up Preferences Panel
  */
  
- prefButton:sender;
 /*
  * Responds to either preference Panel button.
  */

@end

 /*
  * methods to handle a script. see file hgvScript.m
  */
@interface HGraphicView(Script)

- executeScript:sender;

@end

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.