AnnSelect example for Visual J++
Note: This topic is for Document/Medical only.
This example for the AnnSelect event displays a message box showing the number of selected annotation objects. It then goes through the array of selected objects to see if any of them are polygons.
private void LEAD1_annSelect(Object source, LTOCXU.LEAD.AnnSelectEvent e)
{
boolean bSelected = false;
MessageBox.show( e.uCount + " objects were selected" );
for( int x = 0 ; x < e.uCount ; x ++ )
{
short sType = LEAD1.AnnGetType( e.aObjects.toSafeArray().getInt( x ) );
if( sType == LTOCXU.AnnObjectConstants.ANNOBJECT_POLYGON )
bSelected = true;
}
if( !bSelected )
MessageBox.show( "No Polygon Objects were selected" );
}