CLASS_NAME:
    itool_template

 PURPOSE (one line):
    Plots profiles of an extracted array of data.

 DESCRIPTION:
    This object class implements itool templates, which are used by itool
 itself and by The Template Manager.
 The Template Manager is a stand-alone GUI, which may be launched from a
 button in itool. Communication of data between itool and The
 Template Manager is important and is achieved through the use of IDL
 pointer variables. Specifically, itool and The Template Manager have
 access to each other's object references.
    The purpose of the "itool_template" object class is to store itool
 template data and to provide method routines for operating on those data.
    The primary data that are maintained in an instance of an itool
 template are the image (device) coordinates of key locations in that
 image. These locations are identified by the user of itool and are
 referred to as template "objects," meaning stars or planetary objects
 that appear on an image taken with a CCD camera mounted on a telescope.
    An itool photometry template keeps track of the locations of objects
 in an image, as their positiions shift from one exposure to another. As
 exposures are collected, preliminary photometry for the objects identified
 in a template may be computed and saved during the course of an observation
 run.

 CATEGORY:
    Widgets

 SUPERCLASSES:

 SUBCLASSES:

 CREATION:
    See itool_template::init

 METHODS:
    itool_template::cleanup
    itool_template::print
    itool_template::fmt
    itool_template::addobject
    itool_template::updateobjects
    itool_template::deleteobject
    itool_template::purgeobjects
    itool_template::getproperty
    itool_template::changeobjectname
    itool_template::setproperty
    itool_template::init

 MODIFICATION HISTORY:
    2004, Mar. Written by Doug Loucks, consultant for Lowell Observatory.


 -----------------------------------------------------------------------------
 -----------------------------------------------------------------------------
 -----------------------------------------------------------------------------
 METHOD NAME:
    itool_template::cleanup

 PURPOSE:
    Self-explanatory

 CALLING SEQUENCE:
    obj_destroy, oref

 INPUTS:
    oref : An itool_template object reference.


 -----------------------------------------------------------------------------
 METHOD NAME:
    itool_template::print

 PURPOSE:
    To print a template to standard output, or to a file.

 CALLING SEQUENCE:
    oref->print

 INPUTS:

 OPTIONAL INPUTS:
    
 KEYWORD PARAMETERS:
    LUN : Set this keyword to the logical unit number of the file to
          be written. If absent, output will go to IDL's standard output.


 -----------------------------------------------------------------------------
 METHOD NAME:
    itool_template::fmt

 PURPOSE:
    To format a list of objects for printing.

 CALLING SEQUENCE:
    result = oref->fmt()

 INPUTS:

 OPTIONAL INPUTS:
    
 KEYWORD PARAMETERS:

 OUTPUTS:
    result : A string array containing the formatted list of objects. If
             the object list is empty, a null string is returned.


 -----------------------------------------------------------------------------
 METHOD NAME:
    itool_template::addobject

 PURPOSE:
    To add a new object to the list of objects.

 CALLING SEQUENCE:
    oref->addobject, x, y

 INPUTS:
    x, y : the image (device) coordinates of the new object.


 -----------------------------------------------------------------------------
 METHOD NAME:
    itool_template::updateobjects

 PURPOSE:
    To add a new set of objects, replacing the existing set of objects.

 CALLING SEQUENCE:
    oref->updateobjects, new, objnam, x, y

 INPUTS:
    new    : a flag array, indicating "new" status for each object.
    objnam : a string array of object names.
    x, y   : arrays of x and y coordinates of the objects.


 -----------------------------------------------------------------------------
 METHOD NAME:
    itool_template::deleteobject

 PURPOSE:
    To delete a selected object from the object list.

 CALLING SEQUENCE:
    oref->deleteobject


 -----------------------------------------------------------------------------
 METHOD NAME:
    itool_template::purgeobjects

 PURPOSE:
    To purge the objects in the object list.

 CALLING SEQUENCE:
    oref->purgeobjects


 -----------------------------------------------------------------------------
 METHOD NAME:
    itool_template::getproperty

 PURPOSE:
   To retrieve "properties" defined for the itool_template object
 class. Properties are specified as keyword arguments.

 CALLING SEQUENCE:
    oref->getproperty

 INPUTS:

 OPTIONAL INPUTS:
    
 KEYWORD PARAMETERS:
    MODE : Set this keyword to a named variable in which the mode of
           the template will be returned. The mode of a selected template
           controls the behavior of a "left click" in itool's main draw
           widget. Two settings are possible: "Add Objects" or
           "Active Template Photometry," which are stored as 0 and 1,
           respectively and are selected via a combobox widget.
           If the mode is "Add Objects," new "objects" are added to a
           selected template, as the user "left-clicks" in the main draw
           widget. If the mode is "Active Template Photometry," left-clicking
           in the main draw widget launches photometric calculations for the
           "objects" in a template. The default mode for a new instance of a
           template is "Add Objects."

    MODIFIED     : Set this keyword to a named variable in which the modified
                   flag for the template will be returned.

    NUMOBJ       : Set this keyword to a named variable in which the number
                   of objects in the template will be returned.

    OBJ_SELECTED : Set this keyword to a named variable in which the index
                   of the currently-selected object will be returned.

    NEW          : Set this keyword to a named variable in which the array
                   of "new" flags will be returned.

    OBJNAM       : Set this keyword to a named variable in which the array
                   of object names will be returned.

    X, Y         : Set these keywords to named variables in which the
                   x and y coordinates of the objects will be returned.


 -----------------------------------------------------------------------------
 METHOD NAME:
    itool_template::changeobjectname

 PURPOSE:
    To change the name of an object that is highlighted (selected).

 CALLING SEQUENCE:
    oref->changeobjectname, objnam

 INPUTS:
    objnam : the new name to be given to the selected object.


 -----------------------------------------------------------------------------
 METHOD NAME:
    itool_template::setproperty

 PURPOSE:
    To set "properties" defined for the itool_template object class.
 Properties are specified as keyword arguments.

 CALLING SEQUENCE:
    oref->setproperty

 INPUTS:

 OPTIONAL INPUTS:
    
 KEYWORD PARAMETERS:
    MODE         : the mode of the template (see getproperty for details).
    NAME         : the name of the template.
    OBJ_SELECTED : the index of the selected object. A value of -1 indicates
                   that no object is selected.
    OBJNAM       : the name of the selected object.

 -----------------------------------------------------------------------------
 METHOD NAME:
    itool_template::init

 PURPOSE:
    To initialize a new instance of the itool_template object class.

 CALLING SEQUENCE:
    oref = obj_new('itool_template', templatename, new, objnam, x, y)

 INPUTS:
    templatename ; The name of the new template.
    new          ; An array of flags for the objects.
    objnam       ; An array of names for the objects.
    x            ; An array of x-coordinates for the objects.
    y            ; An array of y-coordinates for the objects.

 OPTIONAL INPUTS:
    
 KEYWORD PARAMETERS:

 OUTPUTS:
    oref = The object reference of the new instance of the itool_template
           object class.

 OPTIONAL OUTPUTS:

 COMMON BLOCKS:

 SIDE EFFECTS:

 RESTRICTIONS:

 PROCEDURE:
    After creating a new instance of this object-oriented widget application,
 it must be realized.

 EXAMPLE:
    oref = obj_new('itool_template', oitool, GROUP_LEADER=group_leader)
    oref->realize

 -----------------------------------------------------------------------------