DataView.AddAttachedObject

Prototypes

void AddAttachedObject( String sName, Object obj )

Parameters

String sName
The name for the attachment. The name can contain any characters. If an attachment with the specified name already exists, the existing attachment is replaced.

Object obj
The Java object to add as an attachment.

Remarks

This method adds a Java object as an attachment to the DataView. You can retrieve the attachment later by calling the method GetAttachedObject.

The DataView class enables you to add attachments to a DataView. This enables you to associate additional information about a DataView with the DataView itself. The DataView does not use your attachments.

Example
x = rannor( 1:1000 );
y = ranuni( 1:1000 );

declare ScatterPlot plot = ScatterPlot.Create( "Example", x, y );

declare Histogram hist = Histogram.Create( "Normal", x, false );
plot.AddAttachedObject( "X Histogram", hist );

declare Histogram xhist;
xhist = (Histogram)plot.GetAttachedObject( "X Histogram" );
xhist.SetWindowPosition( 50, 50, 50, 50 );
xhist.ShowWindow();
See Also

DataView.GetAttachedObject