user manual

394 Appendix A: Controlling iTools from the IDL Command Line
Replacing Data in an iTool iTool Developer’s Guide
Replacing Data in an iTool
You can replace or update data in an existing iTool using either of two methods:
using the iTool’s creation routine and one of the VIEW keywords, or by retrieving
the data object and calling the SetData method. Both methods will change the data
stored in the Data Manager and will cause the display to be updated automatically.
Using the iTool Creation Routine
You can replace data in an existing iTool by using the iTool’s creation command with
the VIEW_NUMBER or VIEW_NEXT keyword set to a view that uses the data you
wish to replace.
Note
The visualization is removed and recreated when you replace data using this
technique. Any property changes you may have made to the old visualization will
be lost. To preserve changes made to the visualization, see “Using the SetData
Method” on page 395.
For example, suppose you have an iPlot tool with a single view, created with the
following command:
IPLOT, myData1
Assuming the iPlot tool is selected, the following command will replace the data in
the tool (
myData1) with a new data set (myData2):
IPLOT, myData2, VIEW_NUMBER=1
Note
The view number starts at 1, and corresponds to the position of the view within the
graphics window (not necessarily the position on the screen). In the case of a
gridded window layout, views are added to the iTool window beginning in the
upper left-hand corner, and proceeding left to right and then down. You can see the
position of a given view within the container by inspecting the tree view of the
Visualization Browser. You can also re-order views using the items in the
Edit Order menu in the iTool.
In our example, if
myData1 is not in use by any other iTool, it will be removed from
the iTools Data Manager by this operation. If
myData1 is used by a visualization in
another view or another iTool, it will not be deleted.