
144 Chapter 6: Creating a Visualization
Example: Image-Contour Visualization iTool Developer’s Guide
Finally, we handle the PALETTE parameter by calling the SetData method again, this
time to set the
PALETTE parameters of both the IDLitVisImage and IDLitVisContour
objects.
OnDataDisconnect Method
The OnDataDisconnect method is called automatically when a data value has been
disconnected from a parameter.
PRO example1_visImageContour::OnDataDisconnect, ParmName
CASE STRUPCASE(parmname) OF
'IMAGEPIXELS': BEGIN
self->SetProperty, DATA = 0
self._oImage->SetProperty, /HIDE
self._oContour->SetProperty, /HIDE
END
'PALETTE': BEGIN
self._oImage->SetProperty, PALETTE = OBJ_NEW()
self->SetPropertyAttribute, 'PALETTE', SENSITIVE = 0
END
ELSE: ; DO nothing
ENDCASE
END
Discussion
The OnDataDisconnect method takes a single argument, which contains the name of
the parameter that was disconnected. In the case of our
example1_visImageContour visualization, we handle the IMAGEPIXELS and
PALETTE parameters. For the IMAGEPIXELS parameter, we set the DATA property
of the parameter to 0, and hide both the image and the contour visualizations. For the
PALETTE parameter, we set the PALETTE property of the image to a null object, and
desensitize the property in the property sheet display.