user manual
134 Chapter 6: Creating a Visualization
Creating a New Visualization Type iTool Developer’s Guide
MIN_VALUE = minn, MAX_VALUE = maxx
ENDIF
END
ELSE: self->ErrorMessage, 'Unknown parameter'
ENDCASE
END
Discussion
The OnDataChangeUpdate method must accept two arguments: an object reference
to the data object whose data has changed (
oSubject in the previous example), and
a string containing the name of the parameter associated with the data object
(
parmName in the example).
Note
The string
<PARAMETER SET> is a special case value for the second argument,
used to indicate that the object reference is not a single data object but a parameter
set. Calling OnDataChangeUpdate with a parameter set rather than a data item
provides a simple way to update a group of data values with a single statement; this
can be very useful when creating the visualization for the first time.
We use a CASE statement to determine which parameter has been modified, and
process the data as appropriate. We first handle the special case where the parameter
has the value
<PARAMETER SET> by looping through all of the parameters in the
parameter set object, calling the OnDataChangeUpdate method again on each
parameter.
Next, we handle the parameter (
Y) by calling the IDLitData::GetData method on the
data object reference stored in the
oSubject argument. We use the N_ELEMENTS
function to determine whether any data was returned. If data was returned, we
determine the minimum and maximum values. Finally, we use the SetProperty
method to insert the changed data (using the TEMPORARY function to avoid
making a copy of the data) into the DATAY property of the IDLitVisPlot object
stored in the visualization’s
_oPlot class structure field. Similarly, we insert the new
minimum and maximum values into the MIN_VALUE and MAX_VALUE properties
of the IDLitVisPlot object.
Creating an OnDataDisconnect Method
The visualization class OnDataDisconnect method is called automatically when a
data value has been disconnected from a parameter. A visualization class based on
the IDLitVisualization class must implement this method in order for changes or
additions to the data parameters to be updated automatically in the resulting